Exporting databases (command line)

You can unload data from a database to a reload file, a new database, or an existing database using the Unload utility (dbunload) on the command line.

Prerequisites

DBA authority.

Context and remarks

Many.

 Unload all or part of a database
  • Run the Unload utility (dbunload), and use the -c option to specify the connection parameters.

    To unload the entire database to the directory c:\DataFiles on the server computer:

    dbunload -c "DBN=demo;UID=DBA;PWD=sql" c:\DataFiles

    The statements required to recreate the schema and reload the tables are written to reload.sql in the local current directory.

    To export data only, use -d.

    For example:

    dbunload -c "DBN=demo;UID=DBA;PWD=sql" -d c:\DataFiles

    The statements required to reload the tables are written to reload.sql in the local current directory.

    To export schema only, use -n.

    For example:

    dbunload -c "DBN=demo;UID=DBA;PWD=sql" -n

    The statements required to recreate the schema are written to reload.sql in the local current directory.

Results

The data is unloaded to the specified location.

Next

None.

 See also