Monday, 29 April 2013

Datapump - I


This is a first post and i want to share some datapump steps.
CONN / AS SYSDBA

Create a user:-
ALTER USER scott IDENTIFIED BY tiger ACCOUNT UNLOCK;

Create directory :-
CREATE OR REPLACE DIRECTORY test_dir AS '/u01/app/oracle/oradata/';
GRANT READ, WRITE ON DIRECTORY test_dir TO scott;

Drop directory
sql>drop directory '/oradata/datapump';

Create directory at OS level:-
$ mkdir datapump

 Table level export

$expdp system/manager dumpfile=emp.dmp directory=datapump tables=scott.emp,scott.dept;

 Table level import

$ impdp system/manager dumpfile=emp.dmp logfile=abcd.log directory=datapump tables=scott.emp;


* 'TABLE_EXISTS_ACTION=APPEND' parameter allows data to be imported into existing tables

Schema level Import/Export:-
$expdp system/manager directory=datapump schemas=scott dumpfile=scott.dump logfile=scott.log
$impdp system/manager directory=datapump schemas=scott dumpfile=scott.dmp logfile=scottimp.log

Database Import/export:-
$expdp system/password full=Y directory=TEST_DIR dumpfile=DB10G.dmp logfile=expdpDB10G
$impdp system/password full=Y directory=TEST_DIR dumpfile=DB10G.dmp logfile=impdpDB10G

Estimate_only:-
  'estimate_only=y' Estimating How Much Disk Space Will Be Consumed durin export but not take actual export

2 comments:

Ask your Questions....