Running the JADE Database Utility in Batch Mode

The jdbutilb program, installed with your JADE software, enables you to automate the JADE Database utility by running it in batch mode. You can use this batch mode utility, for example, to automate the process of resetting timestamps when replacing database files in a runtime deployment environment, or to initiate an offline backup of selected database files.

Run the batch JADE Database utility (for example, from a command script), specifying the following.

jdbutilb path=database-path 
        ini
=initialization-file-name [backup [file-list] backupDir=directory [compress] [overwrite] [excludeFrozenFiles] [excludeFrozenPartitions] [verify] [nostatus]] [backupJournal journal=number backupDir=directory journalDir=directory [lastJournal=number] [compress] [overwrite] [verify] [nostatus]] [certify [file-list] [nostatus]] [changeFilePaths backupinfoPath=directory file-name [part=partition-id] [newBackupPath=directory|<default>]| [newDatabasePath=directory|<default>] [nostatus]] [clearDeltaMode] [clearFilePath [file-list]] [clearFilePathAudited [file-list]] [clearRole] [commandFile=command-file-name] [compact [workers=number-of-worker-threads] [file-list] [nostatus]] [convertToBackup [workers=number-of-worker-threads]] [delete [file-list]] [dumpJournal journal=number [journalDir=directory] [nostatus] [lastJournal=number]] [fileAttributes [file-list] initSize=Kbytes extentSize=Kbytes| initSize=Kbytes|extentSize=Kbytes] [freeSpace [file-list] [nostatus]] [freezeSchemaFiles] [generateEnvironmentIdentity] [generateServerIdentity] [generateUUID] [journalingRates journal=number [journalDir=directory] [nostatus] [lastJournal=number] [samplingInterval=minutes]] [listBackupinfoFilenames] [listFiles] [listPartitionsfile-name] [makeBackupinfo baseDir=directory deltaDir=directory outputDir=directory] [mapFile [file-list]] [markOffline [file-list]] [markOnline [file-list]] [productionMode=true|false] [recover [recoverTo=date time|lastJournal=journal-file-number |lastSerialNumber=audit-record-number] [clearSDSRole] [nostatus]] [reindex [file-list] [nostatus]] [resetTS [file-list]] [restore backupDir=directory [noRecovery] [verify] [recoverTo=date time|lastJournal=number |lastSerialNumber=number] [clearSDSRole] [clearFilePaths] [excludeFrozenFiles] [excludeFrozenPartitions] [nostatus]] [restoreFile backupDir=directory file-list [verify] [clearFilePaths] [excludeFrozenFiles] [excludeFrozenPartitions] [nostatus]] [restoreJournal backupDir=directory journal=number [nostatus] [lastJournal=number]] [restorePartitionFile backupDir=directory file-name part=partition-id [verify] [clearFilePaths] [nostatus]] [setFilePath fileDir=directory [file-list]] [setFilePathAudited fileDir=directory [file-list]] [setUserFileVersions version=version-number [file-list]] [showInfo] [thawSchemaFiles] [touchDB] [unmapFile [file-list]] [verifyChecksums [workers=number-of-worker-threads]] [verifyJournal journal=number [journalDir=directory] [nostatus] [lastJournal=number]] [help]

You can specify only one of the certify, compact, delete, freeSpace, reindex, or resetTS database operations at a time, but you can specify a file list for the operation that is executed if you do not want all database files processed. (Each file in a list is space-separated, and is specified with the data file prefix only.)

If you run the batch JADE Database utility regularly and you use the same or similar commands, you can use the commandFile operation to specify a text file (for example, a .txt or a .cmd file) that contains a list of the commands and their arguments, with each command on a separate line in the command file.

You then need only to specify the program name, the operation, and the name of the command file. As JADE does not look for any other command when it detects the commandFile operation, ensure that you specify this as the last command in the command line.

Simple file masks are supported; for example, _user* processes all file names containing the _user prefix.

The following is an example of the command for the certify operation of the _rootdef.dat, _userscm.dat, _userxrf.dat, _usergui.dat, _userint.dat, _userdev.dat, mydata.dat, and shrdemo.dat files, with the status message display suppressed.

jdbutilb path=d:\salesdb ini=d:\salesdb\jade.ini clearDeltaMode certify _user* mydata shrdemo nostatus

In the following examples, the production (primary) offline backup is loaded to a test machine with a different configuration. The database is restored using default locations and a large file is then relocated to another drive.

jdbutilb path=e:\test\system restore ini=e:\test\jade.ini backupDir=g:\overnightOffline verify noRecovery clearSDSRole clearFilePaths 
jdbutilb path=e:\test\system ini=e:\test\jade.ini setFilePath fileDir=f:\test\system nameOfaBigFile

In the following example, a secondary system has had more disk added so some files of employee data are moved to a new drive.

jdbutilb path=e:\ProdB\system ini=e:\ProdB\jade.ini setFilePath fileDir=f:\ProdB\system emp*

In the following example, a production system file is moved to a new drive, using the unaudited command so that it is not re-done in roll-forward recovery.

jdbutilb path=e:\ProdA\system ini=e:\ProdA\jade.ini setFilePath fileDir=f:\ProdA\system AcctHist

Batch database utility program operations that consist of a number of steps or that take longer than a few seconds (for example, backup, certify, or restore) can optionally display a progress report of each specified operation while that operation is running, unless status output is suppressed. (For details, see "nostatus", later in this chapter.)

For details about the parameters that provide advanced diagnostic capabilities when performing certify and freespace evaluation operations, see "Database Diagnostics Section [DBUtil]", in the JADE Initialization File Reference.

Standard database operation information is output to stdout and error information is output to stderr. For details about displaying and redirecting the output from JADE batch utilities, see the DisplayApplicationMessages, LogServer, and UseLogServer parameters under "JADE Log Section [JadeLog]", in the JADE Initialization File Reference.

At the end of the operation, the running display provides a completion report, highlighting the number of files processed and the number of files found with error.

Detailed results of the certification, compaction, free-space evaluation, and checksum verification operations are written to the appropriate log file in your specified database directory.

If the jdbutilb executable program fails, a non-zero exit code is returned and an error message is displayed; for example, if the database directory was invalid.