Copying the Database (dbcopy)

dbcopy copies the specified data from one application data area to another.

Caution: 

Do not use this utility to copy GEN (Environment) data.

At a Landmark command prompt, type

dbcopy [OPTIONS] sourcedataarea targetdataarea [name ...]

Consider the following options:

Program Option Description
-A or --faf=FAFfile

Use information in a specified field assignment file to change field or file names, or initialize field values in the destination file.

Using Field Assignment Files

-b or --brief Brief mode - do not display progress while the copy is in operation.
-B Use the business class parser when filtering and with the field assignment file.
-d or --drop Drop the specified file before copying data to it.
-f filterString or --filter=filterString Use a filter to select the data to copy.
--firstrow=N Start the copy from the specified row.
--helpers Allow helper threads for multiple threads loading a single table. Using this feature can potentially improve the performance of copying large tables. If you use dbcopy with multiple threads and this option, when the number of tables remaining to be processed is fewer than the running threads, dbcopy will use the now available threads to help in the copying of the remaining tables.
--ignorefaferrors Ignore most of the errors in the field assignment file.
--maxrows=N Copy at most the specified maximum number of rows.
--noconfigclear Do not fire configuration clear event. Using this option means the system will be out of sync. This is useful when a system is off-line and these utilities are being used. In that case, the system will be restarted anyway and the cache for configuration data will be automatically built upon access so processing the event is not needed.
-q or --quiet Use quiet mode and print errors only.
-s

Process (store) one record at a time. The insert buffer size setting from the %LARUNDIR%\dataarea\db.cfg file is overridden.

Lawson recommends that you use the parameter to process a file (table) that has only one record.

--sharedlock Use a shared rather than exclusive lock.
--showrules Print the field assignment file rules that will be used.
-T or --timings Print timings.
-t or --truncate Truncate the file before copying data.
--threads=n Run the dbcopy with the specified number of threads. If you use multiple threads, you may see a performance improvement. However, performance is dependent on other factors as well. Note also that a very large table will be processed in a single thread. The default is four.
-x count Set the number of rows in a transaction.
-v errorlevel or --errorlevel= errorlevel

errorlevel, tracelevel, and verbose specified in any order, where:

  • errorlevel = {n}none | {f}atal | {e}rror | {w}arning (warning is the default)

  • tracelevel = 0:6 where 0 is no message and 6 is everything

  • verbose = whether to display exception stacktrace

sourcedataarea The data area that you are copying data from.
targetdataarea The data area that you are copying data to.
name

A specific business class, module, database space, or business class pattern to execute the command against.

Use the prefixes file-, pattern-, space-, or module- to resolve ambiguity. File names can be the long or classic name and can include ? and *. Specifying "!" anywhere in the list will complement the selected files. Specifying @path reads names from the file, one per line. A hyphen ( - ) indicates stdin. A :L on a file name selects the lobs table. A :B on a file name selects the base table.