Wednesday, June 25, 2008

Export Utility

  • The Export utility provides a simple way for you to transfer data objects between Oracle databases,even if they reside on platforms with different hardware and software configurations.
  • Run the catexp.sql or catalog.sql script
  • To use Export, you must have the CREATE SESSION privilege on an Oracle database.
  • To export tables owned by another user, you must have the EXP_FULL_DATABASE role enabled. This role is granted to all DBAs.

The following schema names are reserved and will not be processed by Export:
  • ORDSYS
  • MDSYS
  • CTXSYS
  • ORDPLUGINS
  • LBACSYS
Parameter Files
exp username/password PARFILE=filename

The following example shows a partial parameter file listing:

FULL=y
FILE=dba.imp
GRANTS=y
INDEXES=y
CONSISTENT=y

Invoking Export As SYSDBA

To invoke Export as SYSDBA, use the following syntax, adding any desired parameters or parameter filenames:

exp \'username/password AS SYSDBA\'

Optionally, you could also specify an instance name:
exp \'username/password@instance AS SYSDBA\'

Export Modes

The Export utility provides four modes of export:

  • Full
  • User (Owner)
  • Table
  • Tablespace
Objects Exported and Imported in Each Mode

Object

Table Mode

User Mode

Full Database Mode

Tablespace Mode

Analyze cluster

No

Yes

Yes

No

Analyze tables/statistics

Yes

Yes

Yes

Yes

Application contexts

No

No

Yes

No

Auditing information

Yes

Yes

Yes

No

B-tree, bitmap, domain functional indexes

Yes

Yes

Yes

Yes

Cluster definitions

No

Yes

Yes

Yes

Column and table comments

Yes

Yes

Yes

Yes

Database links

No

Yes

Yes

No

Default roles

No

No

Yes

No

Dimensions

No

Yes

Yes

No

Directory aliases

No

No

Yes

No

External tables (without data)

Yes

Yes

Yes

No

Foreign function libraries

No

Yes

Yes

No

Indexes owned by users other than table owner

Yes (Privileged users only)

Yes

Yes

Yes

Index types

No

Yes

Yes

No

Java resources and classes

No

Yes

Yes

No

Job queues

No

Yes

Yes

No

Nested table data

Yes

Yes

Yes

Yes

Object grants

Yes (Only for tables and indexes)

Yes

Yes

Yes

Object type definitions used by table

Yes

Yes

Yes

Yes

Object types

No

Yes

Yes

No

Operators

No

Yes

Yes

No

Password history

No

No

Yes

No

Postinstance actions and objects

No

No

Yes

No

Postschema procedural actions and objects

No

Yes

Yes

No

Posttable actions

Yes

Yes

Yes

Yes

Posttable procedural actions and objects

Yes

Yes

Yes

Yes

Preschema procedural objects and actions

No

Yes

Yes

No

Pretable actions

Yes

Yes

Yes

Yes

Pretable procedural actions

Yes

Yes

Yes

Yes

Private synonyms

No

Yes

Yes

No

Procedural objects

No

Yes

Yes

No

Profiles

No

No

Yes

No

Public synonyms

No

No

Yes

No

Referential integrity constraints

Yes

Yes

Yes

No

Refresh groups

No

Yes

Yes

No

Resource costs

No

No

Yes

No

Role grants

No

No

Yes

No

Roles

No

No

Yes

No

Rollback segment definitions

No

No

Yes

No

Security policies for table

Yes

Yes

Yes

Yes

Sequence numbers

No

Yes

Yes

No

Snapshot logs

No

Yes

Yes

No

Snapshots and materialized views

No

Yes

Yes

No

System privilege grants

No

No

Yes

No

Table constraints (primary, unique, check)

Yes

Yes

Yes

Yes

Table data

Yes

Yes

Yes

No

Table definitions

Yes

Yes

Yes

Yes

Tablespace definitions

No

No

Yes

No

Tablespace quotas

No

No

Yes

No

Triggers

Yes

Yes

Yes

Yes

Triggers owned by other users

Yes (Privileged users only)

No

No

No

User definitions

No

No

Yes

No

User proxies

No

No

Yes

No

User views

No

Yes

Yes

No

User-stored procedures, packages, and functions

No

Yes

Yes

No


Table-Level and Partition-Level Export

You can export tables, partitions, and subpartitions in the following ways:
  • Table-level Export: In table-level Export, you can export an entire table (partitioned or nonpartitioned) along with its indexes and other table-dependent objects. If the table is partitioned, all of its partitions and subpartitions are also exported. This applies to both direct path Export and conventional path Export. You can perform a table-level export in any Export mode.
  • Partition-level Export: In partition-level Export, you can export one or more specified partitions or subpartitions of a table. You can only perform a partition-level export in Table mode.
ExpModes ::=
[FULL = Y]
| [OWNER = (username [, username]... )]
| [TABLES=([schemaname.]tablename[:partition_name][,[schemaname.]
tablename [: partition_name]]...)
| [TABLESPACES = (tablespace_name [, tablespace_name]...) ExpTSOpts]

ExpTSOpts ::=
[TRANSPORT_TABLESPACE = N]
[TTS_FULL_CHECK = { Y | N }]

ExpOpts ::=
[ ExpFileOpts
| LOG = filename
| COMPRESS = { Y | N }
| ROWS = { Y | N }
| QUERY = SQL_string
| DIRECT = { Y | N }
| FEEDBACK = integer
| STATISTICS = { COMPUTE | ESTIMATE | NONE }
| INDEXES = { Y | N }
| CONSTRAINTS = { Y | N }
| GRANTS = { Y | N }
| TRIGGERS = { Y | N }
],

ExpOpts_Cont ::=
[ CONSISTENT = { Y | N }
| OBJECT_CONSISTENT = { Y | N }
| FLASHBACK_SCN = SCN_number
| FLASHBACK_TIME = DATE
| BUFFER = integer
| RESUMABLE = { Y | N }
| RESUMABLE_NAME = resumable_string
| RESUMABLE_TIMEOUT = integer
],

ExpFilOp ::=
[
PARFILE = filename
| FILE = filename
| FILESIZE = number_of_bytes
| VOLSIZE = number_of_bytes
| LOG = filename
| RECORDLENGTH = integer
]

No comments: