[oracle] 11g – export data with expdp

Approach is as follow:

  1. create directory object inside oracle
  2. grant export rights
  3. perform export

step by step

  1. create physical directory on the drive where dump will be created:
    sudo mkdir /u01/app/oracle/exported_dbs
    sudo chown oracle:dba /u01/app/oracle/exported_dbs
  2. login as system admin into sqlplus:
    $ORACLE_HOME/bin/sqlplus sys/<password> as sysdba
  3. create oracle directory object:
    create directory db_dumps  as '/u01/app/oracle/exported_dbs';
    grant read,write on directory db_dumps to <dbuser>;
  4. grant export rights to db user:
    grant create any directory to <dbuser>;
    grant exp_full_database to <dbuser>;
  5. generate dump file:
    $ORACLE_HOME/bin/expdp <dbuser>/<password> schemas=<db_schema_to_export> directory=db_dumps dumpfile=db_dumpfile.dmp logfile=expdp_dbdump.log

note: replace values between <xxx> with your own values


Post a Comment

Your email is never published nor shared. You're allow to say what you want...