Databases Reference
In-Depth Information
You can also use
FLASHBACK_TIME
to specify that the export file should be created with consistent committed
transactions as of a specified time. When using
FLASHBACK_TIME
, Oracle determines the SCN that most closely
matches the time specified and uses that to produce an export consistent with that SCN. The syntax for using
FLASHBACK_TIME
is as follows:
FLASHBACK_TIME="TO_TIMESTAMP{<value>}"
For some OSs, double quotation marks appearing directly on the command line must be escaped by a backslash
(
\
), because the OS treats them as special characters. For this reason, it's much more straightforward to use a
parameter file. Here are the contents of a parameter file that uses
FLASHBACK_TIME
:
directory=dp_dir
content=metadata_only
dumpfile=inv.dmp
flashback_time="to_timestamp('24-jan-2013 07:03:00','dd-mon-yyyy hh24:mi:ss')"
Depending on your OS, the command line version of the previous example must be specified as follows:
flashback_time=\"to_timestamp\(\'24-jan-2013 07:03:00\',
\'dd-mon-yyyy hh24:mi:ss\'\)\"
This line of code should be specified on one line. Here, the code has been placed on two lines in order to fit on
the page.
You can't specify both
FLASHBACK_SCN
and
FLASHBACK_TIME
when taking an export; these two parameters are
mutually exclusive. If you attempt to use both parameters at the same time, Data Pump throws the following error
message and halts the export job:
ORA-39050: parameter FLASHBACK_TIME is incompatible with parameter FLASHBACK_SCN
Importing When Objects Already Exist
When exporting and importing data, you often import into schemas in which the objects have been created (tables,
indexes, and so on). In this situation, you should import the data but instruct Data Pump to try not to create already
existing objects.
You can achieve this with the
TABLE_EXISTS_ACTION
and
CONTENT
parameters. The next example instructs Data
Pump to append data in any tables that already exist via the
TABLE_EXISTS_ACTION=APPEND
option. Also used is the
CONTENT=DATA_ONLY
option, which instructs Data Pump not to run any DDL to create objects (only to load data):
$ impdp mv_maint/foo directory=dp_dir dumpfile=inv.dmp \
table_exists_action=append content=data_only
Existing objects aren't modified in any way, and any new data that exist in the dump file are inserted into any
tables.
You may wonder what happens if you just use the
TABLE_EXISTS_ACTION
option and don't combine it with the
CONTENT
option:
$ impdp mv_maint/foo directory=dp_dir dumpfile=inv.dmp \
table_exists_action=append