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 开发者_JAVA技巧to do that?
Thanks.
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.
精彩评论