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.
–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
–Ddirectory nameSpecifies the directory in which the sequential files, which are files with extension
.Sor.F, are located. Use this option if you have used the–xor–toption of bdbpre to create the dump files.-LlangIn 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
–Loption 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.-TThe default behavior of bdbpost is to preserve the time stamp values of the
rcd_utccolumn (if present). This way, a straightforward export/import is neutral with regards to the data contained in the table. If the–Toption is specified, all time stamp values of thercd_utccolumn are updated to the time at which the import is done.–tseparator characterUse this option if you want to import data from a sequential file that is created with the
–toption of bdbpre. If you use the–toption, you must also specify a directory with the–Doption.
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.
–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
-
–xUse 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
–xoption of bdbpre. If you use the–xoption, you must also specify a directory with the–Doption.
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/UPrint usage information.
–v/VPrint information about the version of bdbpost.
–ppackage combinationThe 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.
–cCompany number for the tables to be created.
–CRange 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.–xImport files with fixed length records. Use this option to import files created with the
–xoption of bdbpre.–Ddirectory nameSpecifies the directory that contains the files that must be imported.
–efileFile to store the names of unsuccessfully created tables.
-gSkip import of logical linked tables.
This parameter is only of use when the append option is chose [-A].
–kThe existing tables are dropped.
–KThe existing tables are dropped after a backup is made, if DBMS supports this.
–lDisplay contents of the dump file.
–IfileRedirects input from file.
–EerrorRedirects errors to error.
–mIgnore 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.
–iIgnore domain range error and skip record.
–nIgnore 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.
–AAppend 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
–Aoption is not given the import will fail if the table already exists.–RAppend 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.
–tseparator characterSpecify the used separator. Use this option if the dump file was created with the –t option of bdbpre. With this option the
–Doption is required.–fFast 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.
-FImport 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
-Foption of bdbpost. The counters in the dump are ignored, but arefintrun is required afterwards. The bdbpost program produces a fatal error when attempting to import referential integrity counters while none are present in the dump.–MCan be specified with the options
–x,-tor–Ito specify that the input file consists of multiple files.If bdbpre was executed with this option the bdbpost must be run with
–Mas well. For more information, see also the–Moption of bdbpre.–rrows/transactionDefines 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 allImport all data, both checked-in and checked-out data if applicable, from the table dump.
-W ciImport only checked-in data. Ignore checked-out data in the table dump.
-W nomodelcheckAllow 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 notablesharingcheckAllow 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 stderrWrite trace data to stderr.
-XfilenameWrite trace data to filename.
-YAdd 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.