使用impdp network link 跳過expdp直接匯入資料
源資料庫:rman01
目標資料庫: rman02
實驗步驟:
1. 配置源資料庫與目標資料庫的tnsnames.ora資訊
2. 在源資料庫建立測試表,建立public db link
3. 在目標庫使用 imp network_link 引數 直接匯入schema
4. 檢視測試結果
------------------------------------------------------------------------------------------------------
1. 配置源資料庫與目標資料庫的tnsnames.ora資訊
源資料庫tnsname.ora配置資訊如下:
[oracle@localhost admin]$ more tnsnames.ora
# tnsnames.ora Network Configuration File: /data/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
RMAN02 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.248.129)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rman02)
)
)
RMAN01 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rman01)
)
)
# tnsnames.ora Network Configuration File: /data/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
RMAN02 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.248.129)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rman02)
)
)
RMAN01 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rman01)
)
)
目標資料庫 tnsnames.ora配置資訊如下:
[oracle@localhost admin]$ more tnsnames.ora
# tnsnames.ora Network Configuration File: /data/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
RMAN01 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.248.132)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rman01)
)
)
RMAN02 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rman02)
)
)
# tnsnames.ora Network Configuration File: /data/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
RMAN01 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.248.132)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rman01)
)
)
RMAN02 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rman02)
)
)
2. 在源資料庫建立測試表,建立public db link
SQL> conn user01/gaoxu
Connected.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
TEST TABLE
Connected.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
TEST TABLE
SQL> create public database link rman02_to_rman01 connect to system identified by gaoxu using 'RMAN01';
Database link created
Database link created
3. 在目標庫使用 imp network_link 引數 直接匯入schema
[oracle@localhost dpdump]$ echo "/as sysdba" | impdp directory=EXP_PUMP_DIR logfile=rman02_to_rman01.log network_link=rman02_to_rman01 schemas=user01 remap_schema=user01:user02
Import: Release 11.2.0.1.0 - Production on Wed Jul 30 20:50:05 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Username:
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYS"."SYS_IMPORT_SCHEMA_01": /******** AS SYSDBA directory=EXP_PUMP_DIR logfile=rman02_to_rman01.log network_link=rman02_to_rman01 schemas=user01 remap_schema=user01:user02
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
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 "USER02"."TEST" 37 rows
Job "SYS"."SYS_IMPORT_SCHEMA_01" successfully completed at 20:52:23
4. 檢視測試結果
SQL> conn user02/gaoxu
Connected.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
TEST TABLE
SQL> select count(*) from test;
COUNT(*)
----------
37
Connected.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
TEST TABLE
SQL> select count(*) from test;
COUNT(*)
----------
37
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28719055/viewspace-1337936/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- impdp+network link 跳過expdp直接匯入目標庫
- oracle impdp network_link直接匯入資料包ora-39064 ora-29285Oracle
- 【EXPDP/IMPDP】使用 EXPDP/IMPDP工具“模糊”匯出和匯入
- 關於impdp匯入資料的network_link的使用介紹
- Oracle資料泵匯出匯入(expdp/impdp)Oracle
- 通過EXPDP/IMPDP匯出匯入遠端資料倒本地
- Oracle使用資料泵expdp,impdp進行資料匯出匯入Oracle
- 資料庫泵(expdp/impdp)匯入匯出流程資料庫
- 使用EXPDP/IMPDP匯入匯出表中資料/後設資料測試
- expdp impdp 資料庫匯入匯出命令詳解資料庫
- oracle匯入匯出之expdp/impdpOracle
- expdp impdp只匯出匯入viewView
- Oracle expdp/impdp匯出匯入命令及資料庫備份Oracle資料庫
- Oracle expdp/impdp匯入匯出備份資料庫指令碼Oracle資料庫指令碼
- Oracle使用impdp的network_link遷移資料庫Oracle資料庫
- 使用資料泵impdp匯入資料
- expdp與impdp全庫匯出匯入
- expdp與impdp全庫匯出匯入(二)
- expdp_impdp使用network_link遠端使用者需要EXP_FULL_DATABASE角色Database
- 資料泵IMPDP 匯入工具的使用
- Impdp資料泵匯入
- 資料泵(expdp,impdp)高版本匯入低版本操作例項
- 使用expdp、impdp遷移資料庫資料庫
- Oracle 12c expdp和impdp匯出匯入表Oracle
- 資料泵datapump(expdp/impdp)的parfile用法,避免跳脫字元字元
- oracle impdp network_link引數使用介紹Oracle
- expdp impdp Data Pump(資料泵)使用解析
- EXPDP 和 IMPDP 資料泵的使用_1
- EXPDP 和 IMPDP 資料泵的使用_2
- 【IMPDP】使用IMPDP自動建立使用者並完成資料的匯入
- Oracle 低版本匯入高版本按使用者expdp/impdpOracle
- oracle10g expdp資料泵的bug,按schema匯出,匯入impdp時無jobOracle
- expdp透過db_link遠端匯出
- 關於資料庫使用impdp+network_link遷移時,job的遷移資料庫
- 使用資料泵(expdp、impdp)遷移資料庫流程資料庫
- 通過NETWORK_LINK在客戶端執行EXPDP客戶端
- 透過NETWORK_LINK在客戶端執行EXPDP客戶端
- IMPDP匯入遠端資料庫資料庫