bikt
bikt

Reputation: 173

Oracle exporting custom tables with data, triggers, sequences into dmp file

topic says all, i need to export custom tables with data, triggers and sequences into dmp file.

exp SYSTEM/password FULL=y FILE=dba.dmp LOG=dba.log CONSISTENT=y

This example helps to export all database, but i need to export custom objects. Maybe someone can tell me how to do that?

Thanks.

Upvotes: 1

Views: 5996

Answers (1)

Blair
Blair

Reputation: 3751

You need to create a parameter file which specifies the tables that you want to include.

Here is an example:

DIRECTORY=DATA_PUMP_DIR
FILESIZE=2G
EXCLUDE=INDEX
EXCLUDE=CONSTRAINT
EXCLUDE=GRANT,ROLE_GRANT,DEFAULT_ROLE
EXCLUDE=VIEW,PACKAGE,PROCEDURE,FUNCTION
EXCLUDE=COMMENT,JOB,SYNONYM
EXCLUDE=TABLE:" NOT IN ('table1','table2','table3')"

Then run the expdb utility, specifying your parameter file path:

${ORACLE_HOME}/bin/expdp user/pass@db SCHEMAS=schemaname DUMPFILE=$DMPFILE LOGFILE=$DMPLOG PARFILE=$DATA_PUMP_PAR

That will export table1, table2 and table3 with associated sequences, data and triggers.

Upvotes: 1

Related Questions