EXPORT USER

You can use the EXPORT USER command to export the data belonging to the application of the database user logged onto the database.

Prerequisites

You require the Demo Database DEMODB.

You can use the EXPORT USER command to export objects that are owned by the database user who is logged on to the database instance. Start the Loader as database administrator MONA and log on to the demo database DEMODB. Use the Session Mode.

loadercli –d demodb –u mona,red

Examples

The data of the user MONA is to be exported.

You can make entries after the keyword CATALOG and/or DATA to select what is to be exported, the database catalog and/or the data belonging to the application.

Export of the Database Catalog of the Database User who is Logged On

You can export the database catalog information of the database user belonging to the application.

EXPORT USER
  
CATALOG OUTSTREAM 'mona_ddl.catalog'

The database catalog (CATALOG) is exported in the DDL format (default value).

See also:

Loader, Data Stream

Export of the Application Data of the Database User who is Logged On

You can export the application data of the database user.

EXPORT USER
  
DATA OUTSTREAM 'mona_pages.data'

The application data (DATA) is exported in the PAGES format (default value).

EXPORT DB
  
DATA OUTSTREAM 'mona_records.data' RECORDS

The application data (DATA) is exported in the RECORDS format.

A PAGES export uses a database format (based on a page), and is therefore faster than an export that uses the RECORDS format of the Loader.

You may not change a data file in either case as the binary format is specific to the Loader.

See also:

Loader, PAGES, RECORDS

Export of the Database Catalog and the Application Data of the Database User who is Logged On

You can export the data belonging to the application of the database user logged onto the database

EXPORT USER
  
CATALOG OUTSTREAM 'mona_ddl.catalog'
  
DATA OUTSTREAM 'mona_pages.data'

Observe the sequence of the syntax elements. Always enter the syntax element for the export of the database catalog first, and then the syntax element for the export of the application data.

Excluding Tables from the Export

By specifying a data stream after the keyword CONFIGURATION, you can exclude the application data of the tables specified in this data stream. The tables must be identified in the data stream by specifying their schema and the table name.

The CITY and HOTEL tables are to be excluded from the export. Create the hotel_table.configuration  file with the following contents:

HOTEL,CITY

HOTEL,HOTEL

Specify the following export command in the Loader session mode. Observe the sequence of the syntax elements. First, enter the syntax element that excludes the table from the export.

EXPORT USER
  CONFIGURATION INSTREAM 'hotel_table.configuration'
  CATALOG OUTSTREAM 'mona_ddl.catalog'
  DATA OUTSTREAM 'mona_pages.data'

The database catalog entries of all tables are always exported, regardless of the restrictions made in hotel_table.configuration.

Additional Log Functions

If you specify a data stream after the keyword PACKAGE, the command entries from the SYSLOADER.TRANSFORMATIONMODEL table are exported to the specified data stream. This is an additional log option. Always enter the PACKAGE syntax element as the last syntax element.

EXPORT USER
  CATALOG OUTSTREAM 'mona_ddl.catalog'
  PACKAGE OUTSTREAM 'mona_csv.package'

See also:

Loader, Additional Log Functions (package_spec)

Complete Syntax of the EXPORT USER Command

Combining the syntax options can result in correspondingly complex commands. Observe the sequence of the syntax elements.

EXPORT USER
  CONFIGURATION INSTREAM FILE 'hotel_table.configuration' CSV ASCII

  CATALOG OUTSTREAM FILE 'mona_ddl.catalog' DDL
  DATA    OUTSTREAM FILE 'mona_pages.data' PAGES
  PACKAGE OUTSTREAM FILE 'mona_csv.package' CSV

For a complete syntax description, see EXPORT USER Command in the Loader documentation.

See also:

Other example commands for Exporting

Corresponding Import command IMPORT USER