手机版
你好,游客 登录 注册
背景:
阅读新闻

expdp/impdp 参数network_link使用测试

[日期:2013-04-02] 来源:Linux社区  作者:luoping [字体:大 中 小]

三:同一个数据库中不同用户之间迁移数据

环境接着上面,这里把HTZ的数据库迁移到同一个数据库的SCOTT用户下面

1,删除SCOTT用户
[Oracle11g@rhel4 admin]$ sqlplus / as sysdba
 
SQL*Plus: Release 11.2.0.3.0 Production on Tue Mar 26 20:30:28 2013
 
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
 
SQL> drop user scott cascade;
 
User dropped.
 
SQL> Drop public database link "orcl11g";
 
Database link dropped.
 
SQL> 
SQL> create public database link "orcl11g"
  2  connect to htz
  3  identified by "oracle"
  4  using 'ORCL11G';
 
Database link created.
 
SQL> grant exp_full_database TO  htz;
 
Grant succeeded.
2,导数据

[oracle11g@rhel4 admin]$ impdp system/oracle directory=dump  logfile=scott_impdp.log  remap_schema=htz:scott network_link=orcl11g
 
Import: Release 11.2.0.3.0 - Production on Tue Mar 26 20:34:25 2013
 
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
 
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYSTEM"."SYS_IMPORT_SCHEMA_01":  system/******** directory=dump logfile=scott_impdp.log remap_schema=htz:scott network_link=orcl11g 
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 2.115 GB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
. . imported "SCOTT"."TEST"                            19096576 rows
. . imported "SCOTT"."DEPT"                                  4 rows
. . imported "SCOTT"."EMP"                                  14 rows
. . imported "SCOTT"."SALGRADE"                              5 rows
. . imported "SCOTT"."BONUS"                                  0 rows
Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
ORA-39082: Object type ALTER_PROCEDURE:"SCOTT"."BBW_INSERT" created with compilation warnings
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "SYSTEM"."SYS_IMPORT_SCHEMA_01" completed with 1 error(s) at 20:35:49       

三种常用的方式已经测试成功。

更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12

linux
相关资讯       expdp  expdp/impdp  expdp参数 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款