【impdp】使用impdp工具排除特定表的匯入
在《【imp】使用imp工具遷移資料時迂迴地排除特定表的匯入》(http://space.itpub.net/519536/viewspace-672170)文中提到使用imp工具迂迴的完成排除特定表匯入問題。使用impdp工具可以非常容易的實現。
1.環境準備
1)建立使用者sec並給予
sys@ora10g> drop user sec cascade;
sys@ora10g> create user sec identified by sec default tablespace TBS_SEC_D;
sys@ora10g> grant dba to sec;
2)在sec使用者下建立三張表,為每張表中初始化一條資料
sys@ora10g> conn sec/sec
sec@ora10g> create table t1 (x int);
sec@ora10g> create table t2 (x int);
sec@ora10g> create table t3 (x int);
sec@ora10g> insert into t1 values(1);
sec@ora10g> insert into t2 values(2);
sec@ora10g> insert into t3 values(3);
sec@ora10g> commit;
sec@ora10g> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
T2 TABLE
T1 TABLE
T3 TABLE
2.使用expdp工具生成sec使用者的備份檔案
ora10g@asdlabdb01 /db_backup/dpump_dir$ expdp system/oracle directory=dpump_dir dumpfile=sec.dmp schemas=sec
Export: Release 10.2.0.3.0 - 64bit Production on Thursday, 01 September, 2010 22:34:30
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01": system/******** directory=dpump_dir dumpfile=sec.dmp schemas=sec
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 192 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
. . exported "SEC"."T1" 4.914 KB 1 rows
. . exported "SEC"."T2" 4.914 KB 1 rows
. . exported "SEC"."T3" 4.914 KB 1 rows
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
/db_backup/dpump_dir/sec.dmp
Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at 02:34:36
3.刪除sec使用者
sys@ora10g> drop user sec cascade;
User dropped.
4.使用impdp工具完成匯入
1)匯入操作
ora10g@asdlabdb01 /db_backup/dpump_dir$ impdp system/oracle directory=dpump_dir dumpfile=sec.dmp exclude=table:"in('T1')"
Import: Release 10.2.0.3.0 - 64bit Production on Thursday, 01 September, 2010 22:35:20
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_FULL_01": system/******** directory=dpump_dir dumpfile=sec.dmp exclude=table:in('T1')
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
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "SEC"."T2" 4.914 KB 1 rows
. . imported "SEC"."T3" 4.914 KB 1 rows
Job "SYSTEM"."SYS_IMPORT_FULL_01" successfully completed at 02:35:23
5.小結
在Oracle 10g時代,推薦選用expdp/impd工具完成邏輯備份及資料遷移,該工具的主要特點是:迅速、便捷!
Good luck.
secooler
10.09.01
-- The End --
1.環境準備
1)建立使用者sec並給予
sys@ora10g> drop user sec cascade;
sys@ora10g> create user sec identified by sec default tablespace TBS_SEC_D;
sys@ora10g> grant dba to sec;
2)在sec使用者下建立三張表,為每張表中初始化一條資料
sys@ora10g> conn sec/sec
sec@ora10g> create table t1 (x int);
sec@ora10g> create table t2 (x int);
sec@ora10g> create table t3 (x int);
sec@ora10g> insert into t1 values(1);
sec@ora10g> insert into t2 values(2);
sec@ora10g> insert into t3 values(3);
sec@ora10g> commit;
sec@ora10g> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
T2 TABLE
T1 TABLE
T3 TABLE
2.使用expdp工具生成sec使用者的備份檔案
ora10g@asdlabdb01 /db_backup/dpump_dir$ expdp system/oracle directory=dpump_dir dumpfile=sec.dmp schemas=sec
Export: Release 10.2.0.3.0 - 64bit Production on Thursday, 01 September, 2010 22:34:30
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01": system/******** directory=dpump_dir dumpfile=sec.dmp schemas=sec
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 192 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
. . exported "SEC"."T1" 4.914 KB 1 rows
. . exported "SEC"."T2" 4.914 KB 1 rows
. . exported "SEC"."T3" 4.914 KB 1 rows
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
/db_backup/dpump_dir/sec.dmp
Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at 02:34:36
3.刪除sec使用者
sys@ora10g> drop user sec cascade;
User dropped.
4.使用impdp工具完成匯入
1)匯入操作
ora10g@asdlabdb01 /db_backup/dpump_dir$ impdp system/oracle directory=dpump_dir dumpfile=sec.dmp exclude=table:"in('T1')"
Import: Release 10.2.0.3.0 - 64bit Production on Thursday, 01 September, 2010 22:35:20
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_FULL_01": system/******** directory=dpump_dir dumpfile=sec.dmp exclude=table:in('T1')
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
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "SEC"."T2" 4.914 KB 1 rows
. . imported "SEC"."T3" 4.914 KB 1 rows
Job "SYSTEM"."SYS_IMPORT_FULL_01" successfully completed at 02:35:23
5.小結
在Oracle 10g時代,推薦選用expdp/impd工具完成邏輯備份及資料遷移,該工具的主要特點是:迅速、便捷!
Good luck.
secooler
10.09.01
-- The End --
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25462274/viewspace-2094942/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【EXPDP/IMPDP】使用 EXPDP/IMPDP工具“模糊”匯出和匯入
- 資料泵IMPDP 匯入工具的使用
- truncate表後impdp匯入該表時加exclude=index引數並不能排除索引資料的匯入Index索引
- 然後再全庫匯入排除view資料庫在impdp匯入View資料庫
- 將表匯入到其他使用者的impdp命令
- 【IMPDP】使用IMPDP自動建立使用者並完成資料的匯入
- impdp 匯入 指令碼指令碼
- 【imp】使用imp工具遷移資料時迂迴地排除特定表的匯入
- EXPDP/IMPDP工具的使用
- Expdp,impdp工具的使用
- Impdp資料泵匯入
- Oracle 12c expdp和impdp匯出匯入表Oracle
- 排除表和query查詢條件的expdp、impdp
- 使用資料泵impdp匯入資料
- oracle匯入匯出之expdp/impdpOracle
- expdp impdp只匯出匯入viewView
- 【IMPDP】使用工具IMPDP匯入資料時ORA-39002、ORA-39070錯誤排查
- 使用EXPDP/IMPDP匯入匯出表中資料/後設資料測試
- impdp匯入資料後,system 表空間整理
- expdp與impdp全庫匯出匯入
- oracle impdp 匯入大表報告顯示 out of rowsOracle
- IMPDP匯入遠端資料庫資料庫
- Oracle資料泵匯出匯入(expdp/impdp)Oracle
- expdp與impdp全庫匯出匯入(二)
- rac環境下使用impdp匯入資料出錯
- 資料庫泵(expdp/impdp)匯入匯出流程資料庫
- Oracle 12.1.0.2 impdp匯入慢診斷Oracle
- oracle排除表匯入匯出Oracle
- Oracle使用資料泵expdp,impdp進行資料匯出匯入Oracle
- impdp匯入時使用table_exists_action引數的區別
- EXP COMPRESS以及EXP/IMP EXPDP/IMPDP匯入表結構注意
- IMPDP 多個表空間物件匯入到一個表空間中物件
- expdp impdp 資料庫匯入匯出命令詳解資料庫
- expdp/impdp中匯出/匯入任務的管理和監控
- 【匯出匯入】IMPDP table_exists_action 引數的應用
- 【impdp】IMPDP中的TRANSFORM引數--【資料泵】EXPDP匯出表結構(真實案例)後傳ORM
- impdp匯入包含xmltype型別欄位空表報錯問題XML型別
- 用impdp匯入資料的一次經歷