Progress
Database Administration
Guide and Reference


SQLDUMP Utility

A command-line utility that dumps application data from SQL-92 tables into one or more files. You can load the data from the files into another database with the SQLLOAD utility. The SQLDUMP utility does not dump data from Progress 4GL tables.

Before you can execute SQLDUMP against a database server, the server must be configured to accept SQL connections and must be running. See "Creating and Deleting Databases," for instructions on creating a database and "Starting Up and Shutting Down," for information about starting a Progress database or database server.

SYNTAX

Operating System
Syntax
UNIX
Windows
sqldump -u user_name [ -a password ] [ -C code-page-name ] 
-t [ owner_name.]table_name1 
       [ [,owner_name.]table_name2, ...  ] 
database_name  

-u user_name

Specifies the user id SQLDUMP used to connect to the database. If you omit the user_name and password parameter values, SQLDUMP prompts you for the values. If you omit user_name and supply a password, SQLDUMP uses the value defined in the USER environment variable as the user_name value.

-a password

Specifies the password used by the database for authentication.

-C code-page-name

A case-insensitive character string that specifies the name of the dump file’s code page. If the -C parameter specifies a code page name that is not valid, Progress reports a run-time error. If the -C parameter does not appear at all, the code page name defaults to the client’s internal code page, which is:

-t owner_name.table_name

Specifies a list of one or more tables to dump to a file. This parameter is required. Pattern matching is supported in both owner_name and table_name, using a percent sign (%) for one or more characters and an underscore (_) for a single character. The pattern matching follows the standard defined by the LIKE predicate in SQL-92.

You can dump a single table, a set of tables, or all tables. If you omit the optional owner_name qualifier, SQLDUMP uses the name specified by the -u parameter.

database_name

Specifies the database where you are dumping tables. You can dump tables from one database each time you invoke SQLDUMP. There is no option flag preceding the database_name. This parameter is required and must be the last parameter specified. The database name is specified like a JDBC-style URL: db_type:T:host:portnum:dbname.

The SQLDUMP utility writes user data in row order into ASCII records with variable-length format. The column order in the files is identical to the column order in the tables. The utility writes both format and content header records to the dump file. You can dump multiple tables in a single execution by specifying multiple table names, separated by commas. Make sure there are no spaces before or after commas in the table list.

Data for one table always goes to a single dump file. Each dump file corresponds to one database table. For example, if you specify 200 tables in the SQLDUMP command, you will create 200 dump files. The SQLDUMP utility assigns the filenames that correspond to the owner_name and table_name in the database, with the file extension .dsql. If a dump file for a specified table already exists, it will be overwritten and replaced. Dump files are created in the current working directory.

The format of the records in a dump file is similar to the Progress 4GL .d file format:

Any error is a fatal error, and SQLDUMP halts the dumping process so that data integrity will not be compromised. SQLDUMP reports errors to standard output.

After successful processing, SQLDUMP writes a summary report to standard output. For each table SQLDUMP processes, the report shows:

EXAMPLES

This example directs the SQLDUMP utility to write the data from two tables to two dump files. The user_name and password for connecting to the database are tucker and sulky. The tucker account must have the authority to access the customers and products tables in database salesdb with owner_name martin:

sqldump -u tucker -a sulky -t martin.customers,martin.products 
progress:T:thunder:4077:salesdb 

This example directs the SQLDUMP utility to write the data from all tables in the salesdb database that begin with any of these strings: cust, invent, and sales, and having any owner name that the user tucker has authority to access. The user_name and password for connecting to the database are tucker and sulky:

sqldump -u tucker -a sulky -t%.cust%,%.invent%,%.sales% 
progress:T:thunder:4077:salesdb 

This example directs the SQLDUMP utility to write the data from all tables for all owner names in the salesdb database:

sqldump -u tucker -a sulky -t %.%  progress:T:thunder:4077:salesdb 

NOTES


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095