Monday, April 06, 2009

Generate exp parfile for table mode export

We have exp job based on the schema. Now we want to use table mode exp. The following script can thus be used to generate parfile. Every month we have release, which may add new tables. So using script to generate the parfile could be handy. It is obviously possible to modify the query to generate the table list based on some condition.



spool export.par
set echo off heading off feed off
set linesize 200
pro userid=/
pro buffer=52428800
pro compress=n
pro constraints=y
pro indexes=y
pro grants=y
pro direct=Y
pro consistent=n
pro statistics=none
pro tables=(
select decode(rownum, 1, ' ', ',') ||
owner || '.' || table_name
from dba_tables where owner = 'DENIS';
pro )
spool off



  

The generated parfile looks like:


userid=/
buffer=52428800
compress=n
constraints=y
indexes=y
grants=y
direct=Y
consistent=n
statistics=none
tables=(

DENIS.BM
,DENIS.X
,DENIS.MY_LOAD_METRICS
,DENIS.T1
,DENIS.A
,DENIS.BI
,DENIS.T2
,DENIS.T14
,DENIS.PLAN_TABLE
)

No comments: