Answer the question
In order to leave comments, you need to log in
How to export tables but some of the tables are without data?
Good afternoon, I want to export the database dump, I do it completely, but I can’t understand how to copy only the structure from the selected tables, without data, I try to do it using the command (example): expdp userbase/base parfile=base.par
In the file itself:
SCHEMAS=userbase
DUMPFILE=base.dmp
DIRECTORY=my_dp_dir
LOGFILE=dump.log
JOB_NAME=dump_job
EXCLUDE=TABLE:"='BONUS_20110101'"
EXCLUDE=STATISTICS
QUERY=TRANSACTION:"WHERE 1=0"
Answer the question
In order to leave comments, you need to log in
>EXCLUDE is a complete table skip?
Yes.
> How it is possible to exclude not all table, but only the data, lines in it?
Write a WHERE 1=0
condition > check the state of the table, but why is it used when dumping?
This is not a test. QUERY allows you to limit the selection of rows and tables when exporting. Specifically, this condition says to select from the TRNSACTION table only those rows for which the condition 1=0 is true. Obviously there are no such rows, so no data will be exported.
You can specify multiple QUERY for multiple tables, for example:
SCHEMAS=userbase
DUMPFILE=base.dmp
DIRECTORY=my_dp_dir
LOGFILE=dump.log
JOB_NAME=dump_job
EXCLUDE=TABLE:"='BONUS_20110101'"
EXCLUDE=STATISTICS
QUERY=TRANSACTION:"WHERE 1=0"
QUERY=MY_TABLE:"WHERE 1= 0"
QUERY=MY_ANOTHER_TABLE:"WHERE 1=0"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question