Total Pageviews

Monday, January 30, 2017

Data Pump using DB link

1)Create DB link for Data Pump on temp database to access orcl:

CREATE public DATABASE LINK pushpak
CONNECT TO scott IDENTIFIED BY tiger
USING '192.168.200.129:1521/orcl.cybage.com';

2)Expdp for exporting tables

expdp dumpfile=table.dmp logfile=table.log directory=DATA_PUMP_DIR tables=emp
scp to temp db location
impdp dumpfile=table.dmp logfile=table.log directory=DATA_PUMP_DIR tables=emp table_exists_action=replace SQLFILE=file.sql

3)To import tablespace to using db_link

[cybage@oracle dpdump]$ impdp tablespaces=NEW  logfile=new.log network_link=pushpak remap_tablespace=new:users table_exists_action=replace


Import: Release 11.2.0.1.0 - Production on Thu Jan 12 23:37:03 2017

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Username: scott
Password:

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SCOTT"."SYS_IMPORT_TABLESPACE_01":  scott/******** tablespaces=NEW logfile=new.log network_link=pushpak remap_tablespace=new:users table_exists_action=replace
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 27 MB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . imported "SCOTT"."EMP_NEW"                               14 rows
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "SCOTT"."SYS_IMPORT_TABLESPACE_01" successfully completed at 23:37:12

No comments:

Post a Comment