用IMIPDP高效导入百万级以上数据
思路:1,备份目标系统元数据2,将目标系统用户DROP掉(这样可以快速DROP索引及约束)3,导入数据(这个步骤不导入索引及约束)4,导入索引约束及权限等元数据。5,作一次统计分析。--------CODE excerpt:1, expdp ... schemas=user1,user2 content=metadata_only2,drop user user1/user2 cascade ;3, impdp ... schemas=user1,user2 include=user,system_grant,role_grant,default_role,table/table,table_table_data parallel=4 4,impdp schemas=user1,user2 exclude=user,system_grant,role_grant,default_role,table/table,table_table
expdp, impdp, --- (query, sample, transform,include,parfile) parameter test,
expdp ' hldba/Thinkhl123@hluat ' directory=exp_dir dumpfile=t_owner_house02.dmp tables=owners.T_OWNER_HOUSE sample=1 compression=all query="" resblock_id=1618 ""reuse_dumpfiles=yimpdp ' hldba/Thinkhl123@hluat ' directory=exp_dir dumpfile=t_owner_house02.dmp sqlfile=owner_house.sqlimpdp ' hldba/Thinkhl123@hluat ' directory=exp_dir dumpfile=t_owner_house02.dmp sqlfile=owner_house2.sql transform=segment_attributes:nimpdp ' hldba/Thinkhl123@hluat ' directory=exp_dir dumpfile=t_ow
expdp 使用QUERY 导出部分数据。
AIX , ORACLE 11G:expdp hldba/dba123@appdev directory=EXP_DIR log=tmp1.log dumpfile=tmp1.dmp tables=tp1 query="" where OWNER='HLDBA' " "-- 注意,双引号正确使用方法,SHELL需要一个,EXPDP也需要一个。---LOG信息如下:/home/oracle/dump_data$log dumpfile=tmp1.dmp tables=tp1 query="" where OWNER='HLDBA' " " <Export: Release 11.2.0.1.0 - Production on Wed Apr 13 12:02:58 2011Copyright (c) 1982, 2009, Oracle and/or its af
impdp usage -- EXCLUDE
IMPDP 应该很熟悉了,但是个别参数确不太常用,偶而用一次,受尽折磨。。现在记录下来,以备后查。参数EXCLUDE.要求:1,一定要用“”;2,一定要用SQL语法限定方式,只是少了WHERE关键字。3,在AIX 平台,由于“”被SHELL识别了,但是“”是ORACLE也需要看到的,怎么办呢,两种选择,要么PARFILE,要么用转义字符,请按下面例子:SAMPLE:impdp sysmgr/sysmgr directory=exp_dir logfile=dev_test_0409.log network_link=apptest schemas=test remap_schema=test:dev exclude=table:""IN ('T_1','T_N')""[@more@]
expdp, impdp characteristic 特性--索引
impdp characteristic 特性:1, the dump file by expdp does not contain index data, although it contains the DDL statements of index . I guess it's because of the ROWID . When you load data into the destination table by impdp. The ROWID value of index will get changed. So it is meaningless store index data in dump file. 2, table_exists_action = append.when impdp data , if the table which will be loaded already exists in the destination . this parameter will skip the TABLE DDL statement. Just load d