用dblink从源数据库导出expdp文件到目标数据库
来源:互联网 发布:崩坏3矩阵怎么回血 编辑:程序博客网 时间:2024/05/01 10:10
本次演示的是用dblink,直接把expdp文件从源数据库 直接传送到 目标服务器中
源数据库ip:192.168.103.110
目标数据库ip:192.168.103.106
源数据库:
创建测试表,用于导出测试:
SQL>conn scott/tiger;Connected.SQL>create table tab_test(a int);Tablecreated.SQL>insert into tab_test select 1 from dual;1 row created.SQL>commit;Commitcomplete.SQL>select * from tab_test; A---------- 1
目标数据库:
[oracle@rac1dump]$ sqlplus / as sysdba
授予scott创建dblink的权限
SQL>grant create public database link to scott;Grantsucceeded.
授予scott创建目录的权限
SQL>grant create any directory to scott;Grantsucceeded.
切换到scott用户
SQL>conn scott/tiger;Connected.
创建dblink
SQL>create public database link from_110_link connect to scott identified by tiger 2 using '(DESCRIPTION = 3 (ADDRESS_LIST = 4 (ADDRESS = (PROTOCOL =TCP)(HOST = 192.168.103.110)(PORT =1521)) 5 ) 6 (CONNECT_DATA = (SERVICE_NAME =orcl) 7 ) 8 )';Databaselink created.
创建接受数据文件的目录
SQL>create directory dump_dir as '/u01/app/oracle/dump';Directory created.
用oracle用户导出expdp文件
[oracle@rac1~]$ expdp scott/tiger tables=tab_test directory=dump_dir network_link=from_110_link dumpfile=exp.dmp logfile=exp.log Export:Release 11.2.0.4.0 - Production on Sat Nov 21 15:08:30 2015Copyright(c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.Connectedto: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bitProductionWith thePartitioning, Real Application Clusters, Automatic Storage Management, OLAP,DataMining and Real Application Testing optionsStarting"SCOTT"."SYS_EXPORT_TABLE_01": scott/******** tables=tab_testdirectory=dump_dir network_link=from_110_link dumpfile=exp.dmp logfile=exp.logEstimatein progress using BLOCKS method...Processingobject type TABLE_EXPORT/TABLE/TABLE_DATATotalestimation using BLOCKS method: 64 KBProcessingobject type TABLE_EXPORT/TABLE/TABLE. .exported "SCOTT"."TAB_TEST" 5.429 KB 1 rowsMastertable "SCOTT"."SYS_EXPORT_TABLE_01" successfullyloaded/unloaded******************************************************************************Dump fileset for SCOTT.SYS_EXPORT_TABLE_01 is: /u01/app/oracle/dump/exp.dmpJob"SCOTT"."SYS_EXPORT_TABLE_01" successfully completed at SatNov 21 15:08:38 2015 elapsed 0 00:00:07
查看刚刚导出的文件(dump_dir目录):
[oracle@rac1~]$ ll /u01/app/oracle/dumptotal 96-rw-r-----1 oracle dba 94208 Nov 21 15:08 exp.dmp-rw-r--r--1 oracle dba 1137 Nov 21 15:08 exp.log
再把文件导入到数据库中:
[oracle@rac1~]$ impdp scott/tiger DIRECTORY=dump_dir dumpfile= exp.dmp Import:Release 11.2.0.4.0 - Production on Sat Nov 21 15:12:51 2015Copyright(c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.Connectedto: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bitProductionWith thePartitioning, Real Application Clusters, Automatic Storage Management, OLAP,DataMining and Real Application Testing optionsMastertable "SCOTT"."SYS_IMPORT_FULL_01" successfullyloaded/unloadedStarting"SCOTT"."SYS_IMPORT_FULL_01": scott/******** directory= dumpfile=Processingobject type TABLE_EXPORT/TABLE/TABLEProcessingobject type TABLE_EXPORT/TABLE/TABLE_DATA. . imported"SCOTT"."TAB_TEST" 5.429 KB 1 rowsJob"SCOTT"."SYS_IMPORT_FULL_01" successfully completed at SatNov 21 15:12:58 2015 elapsed 0 00:00:05
查询,有表和数据
SQL> select * from tab_test; A---------- 1
0 0
- 用dblink从源数据库导出expdp文件到目标数据库
- 用expdp远程导出dmp文件并impbp导入数据库
- 从数据库导出到.csv文件方法
- oracle用expdp导出数据库用户
- 通过dblink导出数据库数据
- expdp利用dblink将远程数据导出到本地
- exp,expdp导出数据库出错
- kettle从数据库导出到csv文件注意事项
- 从数据库导出xml文件
- 关于读取Excel文件数据到数据库,以及从数据库导出数据到Excel的例子
- Oracle--oracle导出表结构到sql文件 ,数据库的导入导出CMD命令exp和imp、使用数据泵导入(impdp)和导出(expdp)
- 从数据库导出数据到Excel
- NPOI从数据库中导出到Excel
- 从数据库导出到excal(winform)
- 从SQL数据库导出到Excel
- Oracle导出表到目标数据库 不删除目标数据库表的数据
- 使用expdp导出远端的数据库
- expdp impdp 数据库导入导出命令详解
- latex与word之间的各种转化方法
- jquery效果队列
- 浅谈在三级城市如何运营一家网络公司
- iOS设计第三方框架
- 安卓源码--切换阿拉伯语重启机器报错
- 用dblink从源数据库导出expdp文件到目标数据库
- 关闭error, forbidden warning
- 关于C++中的引用传递
- nginx多站点配置
- android突出当前应用程序的代码
- Android Studio配置教程
- 操作系统概念(第五章) CPU调度
- 强类型Dataset使用事务(改进原有方法)
- hive基础命令