Description

The bdbpost tool reads data from standard input unless –I option is provided and creates a new database table if that table does not exist. If the Append option is selected, this option appends data to an existing table.

The bdbpost tool also compares current data dictionary information with the information in the dump. If the information does not match, the bdbpost tool returns an error. If the current data dictionary is not present, the tool creates a data dictionary based on the dump.

For each table, bdbpost prints information such as the table name, indexes, the number of records, and any errors.

Note: If you import a dump that contains Workflow tables, you must specify –n.

The bdbpost tool is used to import data from sequential dumps that are created with bdbpre.

This example shows how to use a sequential dump created by bdbpre.

On system 1:

bdbpre –Ntimcs016 –C000-003 > timcs_dump

On system 2:

bdbpost < timcs_dump

The example demonstrates the use of sequential dumps that are created with the –x or –t option of bdbpre. In this case the –D option is mandatory to specify the directory name in which .S or .F files are stored:

bdbpost –ddb2 –t"|" –D./seqdir
bdbpost –x –D./seqdir
  • –D directory name

    Specifies the directory in which the sequential files, which are files with extension .S or .F, are located. Use this option if you have used the –x or –t option of bdbpre to create the dump files.

  • -L lang

    In an environment where multiple data languages are used, you can import a dump where a column is not an MLF (multi language field) into a table where that column is an MLF. The –L option can be used to specify the data language that must be used to insert the data into the table. The data language is a code according to ISO639.2 and must be configured in the target environment.

  • -T

    The default behavior of bdbpost is to preserve the time stamp values of the rcd_utc column (if present). This way, a straightforward export/import is neutral with regards to the data contained in the table. If the –T option is specified, all time stamp values of the rcd_utc column are updated to the time at which the import is done.

  • –t separator character

    Use this option if you want to import data from a sequential file that is created with the –t option of bdbpre. If you use the –t option, you must also specify a directory with the –D option.

Example

To load a sequential dump into the ttimcs016000 table, first move the sequential dump to the ttimcs directory with the name ttimcs016000.S. The command bdbpost –Dttimcs –t"|" searches for an .S file in ttimcs. If that file is found, the corresponding tables are created or appended.

Note: With the –D option, all .S files in that directory are used to create and append the tables, therefore, you must ensure to remove unwanted .S files before you run bdbpost
  • –x

    Use this option to load a sequential dump with fixed-length records without any separators. Use this option to import data from a sequential file that is created with the –x option of bdbpre. If you use the –x option, you must also specify a directory with the –D option.

Example

If you used bdbpre to create sequential dumps in the directory dumps. Bdbpost -D dumps -x searches for .F files in dumps and for each file found, the corresponding table is created or appended.

With bdbpost you can use these parameters:

  • –u/U

    Print usage information.

  • –v/V

    Print information about the version of bdbpost.

  • –p package combination

    The name of the package combination to be used.

  • <pattern>

    Pattern to specify tables that are filtered out of the dump. Wildcards such as * and ? are allowed.

  • –c

    Company number for the tables to be created.

  • –C

    Range of company numbers on which to perform the bdbpost operation. This must be the last option specified in the command, other than the <pattern> option.

  • –x

    Import files with fixed length records. Use this option to import files created with the –x option of bdbpre.

  • –D directory name

    Specifies the directory that contains the files that must be imported.

  • –e file

    File to store the names of unsuccessfully created tables.

  • -g

    Skip import of logical linked tables.

    This parameter is only of use when the append option is chose [-A].

  • –k

    The existing tables are dropped.

  • –K

    The existing tables are dropped after a backup is made, if DBMS supports this.

  • –l

    Display contents of the dump file.

  • –I file

    Redirects input from file.

  • –E error

    Redirects errors to error.

  • –m

    Ignore domain constraints. Data will be imported even if the data does not fit the domain constraints. Be careful with this option because this involves importing data that does not match the application criteria.

  • –i

    Ignore domain range error and skip record.

  • –n

    Ignore referential integrity constraints. To be used if a range of tables is imported. Ensure to repair the reference counters afterwards using the Reorganize Tables (ttaad4225m000) session.

  • –A

    Append to an existing table. If duplicate records exist, do not overwrite the records from the dump. Create the table if the table does not already exist.

    If –A option is not given the import will fail if the table already exists.

  • –R

    Append to an existing table or create a new one. If a record already exists, the record in the dump replaces the table. A summary is provided at the end. Note that only the existence of the primary key is checked.

    If a primary key exists, the record is replaced. If the primary key does not exists but a secondary key exists, error 100, duplicate record, occurs.

  • –t separator character

    Specify the used separator. Use this option if the dump file was created with the –t option of bdbpre. With this option the –D option is required.

  • –f

    Fast mode. First the rows are inserted and afterwards the indexes are built, resulting in a balanced Index tree in the database.

    If you use the –f option, note that:

    • If you interrupt bdbpost, this can result in table inconsistency.
    • You cannot create an index in case of a duplicate conflict.
    • For large tables, adding indexes can take a long time.
  • -F

    Import referential integrity counters. When a table dump was created using the -F option, importing this dump with the option -F does not require a refint. When using the -F option, ensure to also specify the -n option and import the complete set of the exported tables. The reference values in the dump are only valid if all data that is referred to and referred from is exported / imported.

    You can import a bdbpre dump that contains referential integrity counters, without using the -F option of bdbpost. The counters in the dump are ignored, but a refint run is required afterwards. The bdbpost program produces a fatal error when attempting to import referential integrity counters while none are present in the dump.

  • –M

    Can be specified with the options –x, -t or –I to specify that the input file consists of multiple files.

    If bdbpre was executed with this option the bdbpost must be run with –M as well. For more information, see also the –M option of bdbpre.

  • –r rows/transaction

    Defines after which number of inserted rows a commit is performed. The default value is 100. A number less than 100 is changed to 100.

  • -W all

    Import all data, both checked-in and checked-out data if applicable, from the table dump.

  • -W ci

    Import only checked-in data. Ignore checked-out data in the table dump.

  • -W nomodelcheck

    Allow to import a table that is part of a model, where other tables that are part of this model are not present in the dump. Workflow information that was dumped in the table dump headers, and incomplete modules that were marked as incomplete, can be imported.

  • -W notablesharingcheck

    Allow to import tables and companies, where not all the companies are present in the company set(s) that define a deployment. This applies only to models and deployments that use the ForeignCompnr in the Relation section of an object model.

  • -X stderr

    Write trace data to stderr.

  • -X filename

    Write trace data to filename.

  • -Y

    Add additional trace information.

Examples

bdbpre –Nttadv000 –C000-010 > dump
bdbpost < dump

Creates all tables in the dump.

bdbpost –l < dump

Gives the names of tables in the dump.

bdbpost –C000-005 < dump

Creates tables only in the given company range.

bdbpre –Nticom000 –C000-010 > dump
bdbpost –C000-005 ticom* < dump

Creates tables only in the given company range and where the table name matches the ticom pattern.

bdbpost –R –C000-005 ttadv* < dump

Creates and appends tables only in the specified company range and where the table name matches the ttadv pattern. If duplicate records exist, these records are replaced with records from the dump.

If you use the –m or –n option, the data in the database can violate the LN integrity constraints. Data can violate the LN domains or can violate LN referential integrity.

See also bdbpre and refint.