DEV Community

Hisyam Johan
Hisyam Johan

Posted on

Export Oracle DB Schema via Data Pump

  1. Create a directory at OS level
    mkdir -p <dir.path>
    ie. mkdir -p /u02/mybackdir
    p/s: change the folder owner to oracle (optional) ie. chown -R oracle:oinstall /u02

  2. Run this command to enter in SQL mode (as user oracle) : sqlplus / as sysdba

  3. create directory <dir.name> as '<dir.path>';
    ie. SQL> create directory datapump as '/u02/mybackdir';

  4. grant read, write on directory <dir.name> to <sql.user>;
    ie. SQL> grant read, write on directory datapump to hms_a;

  5. check if directory successfully created @ SQL> select * from dba_directories;

  6. cd /u01/app/oracle/product/11.2.0.4/dbhome_1/bin

  7. expdp DUMPFILE=<dir.name>:<dumpfile.name> LOGFILE=<dir.name>:<logfile.name> schemas='<schema.name>'
    expdp DUMPFILE=datapump:myschema.dmp LOGFILE=datapump:myschema.log schemas='MY_SCHEMA'

Top comments (0)