Thursday, May 15, 2014

Export Import Script Reference

expdp directory=EXPORTDP dumpfile=tables_periodcode_hkgrf3_exp.dmp logfile=tables_periodcode_dbas_exp.log tables=RRS.RA_ASI_DISTANCE,RRS.RA_ASTI_DETAIL,RRS.RA_AUDITSTORE,RRS.RA_BANDEDPACKITEM,RRS.RA_CONVERT_VOLUME,RRS.RA_INJCTSCDAT,RRS.RA_MPROJ_STATUS,RRS.RA_QC_PANEL,RRS.RA_SCHEDULE,RRS.RA_SG_MPIBD_STATUS,RRS.RA_SG_MP_STATUS,RRS.RA_SG_STORE_STATUS,RRS.RA_SHOP_TREND,RRS.RA_SQSTATUS,RRS.RA_STORE_ACV,RRS.RA_SUSTATUS,RRS.RA_SW_GENFACTOR_STATUS2 query=\"where periodcode in \(\'20101406\',\'20101407\',\'20101408\',\'20101409\',\'20101410\',\'20101411\',\'20101412\',\'20111401\',\'20111402\',\'20111403\',\'20111404\',\'20111405\',\'20111406\',\'20111407\',\'20111408\',\'20111409\',\'20111410\',\'20111411\',\'20111412\',\'20111601\',\'20111602\',\'20111603\',\'20111604\',\'20111605\',\'20111606\',\'20121401\',\'20121402\',\'20121403\',\'20121404\',\'20121405\',\'20121406\',\'20121407\',\'20121408\',\'20121409\',\'20121410\',\'20121411\',\'20121412\',\'20121606\',\'20131401\',\'20131402\',\'20131403\',\'20131404\',\'20131405\'\)\"

Export Partitions like (this works only in 11g)

expdp directory=EXPDP1 dumpfile=CA_RAW_2013.dmp logfile=CA_RAW_2013.log TABLES=RRS.CA_RAW:P2013%


select 'exec rrs.p_create_partition.create_partition('||replace (substr(partition_name,2,instr(partition_name,'_',-1)-2),'2011','2012')||','||substr(partition_name,instr(partition_name,'_',-1)+1)||','||''''||table_name||''''||');' from dba_tab_partitions where table_owner='RRS' and table_name='SC_RAW' and partition_name like '%20111412%' and partition_name like '%\_%' ESCAPE '\';

No comments:

Post a Comment