EXPDP
SQL> create directory datadir1 as '/data/oracle/bkup1/MYQAA';
Directory created.
SQL> create directory datadir2 as '/data/oracle/bkup1/MYQAA';
Directory created.
SQL> grant read, write on directory datadir1 to Read_DBA;
Grant succeeded.
SQL> grant read, write on directory datadir2 to Read_DBA;
Grant succeeded.
expdp system/manager schemas=QAUSER dumpfile=datadir1:full%U.dmp parallel=4 logfile=datadir2:expfull.log
Or you can build a par file before running it
Build par file, expdp_myqaa.prfl, with the content below
FULL=Y
DUMPFILE=EXPDP_DUMPDIR:expdp_MYQAA_ROWS_FULL%U_030408:0101.dmp
LOGFILE=EXPDP_LOGDIR:expdp_MYQAA_ROWS_FULL_030408:0101.log
PARALLEL=4
CONTENT=ALL
Run it:
expdp "'/ as sysdba'" parfile=expdp_myqaa.prfl
IMPDP
create directory datadir1 as '/data/oracle/bkup1/dp';
create user MY_OWNER identified by my123 default tablespace DATA_d temporary tablespace temp;
impdp jb_dba schemas=BS_OWNER REMAP_SCHEMA=BS_OWNER:DP_USER
dumpfile=datadir1:full%U.dmp table_exists_action=replace logfile=datadir1:impschema.log
Or you can build a par file before importing the data in.
nohup impdp "'/ as sysdba'" parfile=impdp_mydata.prfl > myoutput.log &
impdp_mydata.prfl content:
DUMPFILE=EXPDP_DUMPDIR:expdp_MYQAA_ROWS_FULL%U_030408:0101.dmp
LOGFILE=EXPDP_LOGDIR:impdp_MYQAA_BS_OWNER_030408:0101.log
PARALLEL=4
SCHEMAS=BS_OWNER
Check current directories
SQL> col DIRECTORY_PATH format a89
SQL> col DIRECTORY_NAME format a32
SQL> col OWNER format a16
SQL> set linesize 189
SQL> select * from dba_directories;
OWNER DIRECTORY_NAME DIRECTORY_PATH
---------------- -------------------------------- -----------------------------------------------------------------------------------------
SYS TEST_VFS /data/backup/expdp
SYS EXPDP_LOGDIR /data/backup/expdp/DB01/log
Thanks.
ReplyDeleteGood post. I found lot of useful articles on datapump in this link.
ReplyDeletehttp://www.acehints.com/p/site-map.html