Product Documentation

Database Integrity Utilities

Previous Topic

Next Topic

dbschema - Schema Export Utility

The dbschema utility generates FairCom DB SQL statements to recreate the specified database elements and data.

Operational Model:

  • Client

The FairCom DB SQL utility, dbschema, recreates specified database elements and data.

Syntax

dbschema [ -h ] [ -d ] [-u user_name ] [-a password ] [ -o outfile ]

[ -S BASIC | <cert_filename> ]

[ -p [ user_name.]procedure_name [ , ... ] ]

[ -t [ user_name.]table_name [ , ... ] ]

[ -T [ user_name.]trigger_name [ , ... ] ]

[ database_name ]

Description

Generates c-treeSQL statements to recreate the specified database elements and data. If the dbschema statement omits all arguments, it displays definitions for all elements (tables, views, indexes, procedures, and triggers) for the default database on the screen.

Options

  • -h - Displays brief online help of dbschema syntax and options.
  • -d - In conjunction with the -t option, specifies that dbschema generates c-treeSQL INSERT statements for data in the tables, in addition to CREATE statements. The output of the dbschema command invoked with the -d option can be directed to a command file and executed in interactive c-treeSQL to duplicate and load table definitions.
  • -u user_name - The user name c-treeSQL uses to connect to the database. c-treeSQL verifies the user name against a corresponding password before it connects to the database. If omitted, the default value depends on the environment. (On UNIX, the value of the DH_USER environment variable specifies the default user name. If DH_USER is not set, the value of the USER environment variable specifies the default user name.)
  • -a password - The password c-treeSQL uses to connect to the database. c-treeSQL verifies the password against a corresponding user name before it connects to the database. If omitted, the default value depends on the environment. (On UNIX, the value of the DH_PASSWD environment variable specifies the default password.)
  • -S BASIC | <cert_filename> - Basic TLS encryption or cross checked authentication using <cert_filename>
  • -o outfile - Redirects the output to the specified file. The default is standard output.
  • -t [ user_name.]table_name [ , ... ] - A comma-separated list of tables and views for which definitions should be generated. Specify a list of specific tables, or use the % to generate definitions for all tables.

    Note: With the -t option, the % character is not a true wildcard character. It substitutes for the entire table_name argument and cannot be used for pattern matching within in a character string. This differs from the behavior of the % in the -p and -T options.

    By default, dbschema generates definitions for tables owned by the current user. Use the optional user_name qualifier to specify a table owned by a different user.

  • -p [ user_name.]procedure_name [ , ... ] - A comma-separated list of stored procedures for which definitions should be generated. The table names in the list can include the ‘%’ and underscore, ‘ _ ’, characters, which provide pattern-matching semantics:
    • The ‘%’ matches zero or more characters in the procedure name
    • The underscore ‘ _ ’ matches a single character in the procedure name

    By default, dbschema generates definitions for procedures owned by the current user. Use the optional user_name qualifier to specify a procedure owned by a different user.

  • -T [ user_name.]trigger_name [ , ... ] - A comma-separated list of triggers for which definitions should be generated. The table names in the list can include the ‘%’ and underscore ‘ _ ’ characters, which provide pattern-matching semantics:
    • The ‘%’ matches zero or more characters in the trigger name
    • The underscore ‘ _ ’ character matches a single character in the trigger name

    By default, dbschema generates definitions for triggers owned by the current user. Use the optional user_name qualifier to specify a trigger owned by a different user.

  • database_name - The database for which dbschema should generate definitions. If you omit database_name, dbschema uses the default database, if specified. (How you define the default database varies between operating systems. On UNIX, the value of the DB_NAME environment variable specifies the default database.)

See Also

TOCIndex