Monday, 26 May 2014

Export Oracle Database to Network Location using Data Pump

Export Oracle Database to Network Location using Data Pump

Step1: Create a public database link from where the database reside

DROP PUBLIC DATABASE LINK DBDUMP;

CREATE PUBLIC DATABASE LINK DBDUMP
 CONNECT TO SYSTEM
 IDENTIFIED BY
 USING '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.2)(PORT=1525))(CONNECT_DATA=(SID=ORCL)))';

Note: 192.168.56.2 is the Database server which will be backed up

Step2: Create a directory where backup command will execute and grant proper permission which user will take backup

DROP DIRECTORY DATAPUMP_CBS;

CREATE OR REPLACE DIRECTORY 
DATAPUMP_CBS AS 
'/u01/ORCL_backup/';

GRANT EXECUTE, READ, WRITE ON DIRECTORY SYS.DATAPUMP_CBS TO ORBHRM WITH GRANT OPTION;

Step3: Export backup command 

expdp /passwd full=y  network_link=DBDUMP directory=DATAPUMP_CBS dumpfile=ORCLFULLDB-$(date +%Y%m%d) logfile=ORCLFULLDBLOG-$(date +%Y%m%d) EXCLUDE=STATISTICS CONTENT=ALL

No comments:

Post a Comment