Domanda

Good day, everyone!

I need do a backup of only tables and their triggers and sequence. But I can't find the right way. I looked at the parameters of exp utility, but I only found the TRIGGER parameter. But I couldn't find a parameter to include sequence and exclude procedures, function, and package.

I found query parameter, so maybe where statement can help me, but I don't understand how it work, because cos where statement is superimposed on all tables.

How can I export only tables, sequence, and triggers of a schema?

I looked here, but didn't found a solution.

È stato utile?

Soluzione

The old 'exp' utility does provide many options and can get you backup of tables and triggers ONLY (not sequence or any other type objects).

Pls use advanced 'expdp' (data pump) for better options. You can use 'INCLUDE or EXCLUDE' object switch to meet your goal.

INCLUDE and EXCLUDE

The INCLUDE and EXCLUDE parameters can be used to limit the export/import to specific objects. When the INCLUDE parameter is used, only those objects specified by it will be included in the export/import. When the EXCLUDE parameter is used, all objects except those specified by it will be included in the export/import. The two parameters are mutually exclusive, so use the parameter that requires the least entries to give you the result you require. The basic syntax for both parameters is the same.

INCLUDE=object_type[:name_clause] [, ...]
EXCLUDE=object_type[:name_clause] [, ...]
The following code shows how they can be used as command line parameters.

expdp scott/tiger@db10g schemas=SCOTT include=TABLE:"IN ('EMP', 'DEPT')" directory=TEST_DIR dumpfile=SCOTT.dmp logfile=expdpSCOTT.log

expdp scott/tiger@db10g schemas=SCOTT exclude=TABLE:"= 'BONUS'" directory=TEST_DIR dumpfile=SCOTT.dmp logfile=expdpSCOTT.log

Pls check out for more details...

http://www.oracle-base.com/articles/10g/oracle-data-pump-10g.php#IncludeExclude

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top