Running the Database Maintenance Wizard through CLI
Database Maintenance process through CLI is the alternative interface with which you can perform the cleanup offline.
This approach has the following features:
- Easy adoption of Offline Database Maintenance on UNIX environments.
- Ability to integrate with other custom or business processes.
- Additional features are available along with those in GUI.
- Allows better tracking of Offline Database Maintenance process.
Running Database Maintenance Offline
To invoke Offline Database Maintenance, the dbm_cli.nsh script is executed. This NSH script can be used seamlessly in both UNIX and Windows setups. The script is located on the Application Server machine at:
<BSA_NSH_HOME>/br/dbm-rcp/dbm_cli.nsh
Following table lists the different exit codes that are returned when the NSH script is executed:
Exit Code | Definitions (applicable commands) |
|---|---|
0 | SUCCESS_EXIT_CODE (All commands) |
1 | ERROR_EXIT_CODE (All commands) |
2 | IN_PROGRESS_EXIT_CODE (STATE Command) |
3 | COMPLETED_EXIT_CODE (STATE Command) |
4 | FAILED_EXIT_CODE (STATE Command) |
5 | STOPPED_EXIT_CODE (STATE Command) |
6 | TIME_OUT_EXIT_CODE (STATE Command) |
7 | COMPLETED_WITH_ERROR_EXIT_CODE (STATE Command) |
8 | NOT_STARTED_EXIT_CODE (STATE Command) |
Commands used in Offline Database Maintenance
Following commands are available with Offline Database Maintenance CLI.
Command Name | Description | Command Use | Output |
|---|---|---|---|
Help | This command launches the Database Maintenance CLI help. | -help For example: ./dbm_cli.nsh -help | Displays all the Database Maintenance CLI commands and their description on the console. |
Run | Launches the Database Maintenance Offline Run. List of Modules supported in Database Maintenance CLI is as follows:
If any of the following modules is selected for cleanup, then the retention value for JRE is also specified.
Result retention period specified for JRE and Audit Trail modules takes precedence over the retention period specified for other modules. As a result, after the maintenance process, the JRE and Audit Trail details might not be available if the job runs retention values for a particular module are greater than the retention period of the JRE and Audit Trail modules. | -run {'Database Maintenance module name'=<retention period>}: For example: ./dbm_cli.nsh -run Snapshot=45:Audit=30:JRE=20 -dur 120 | Displays the following confirmation message on the console Started Database Maintenance run for the input <CLI-Input for the -run command> |
Duration | Passed with Run command. It is used to specify the duration (in minutes) for which Database Maintenance should run. Valid range is from 60 to 1440 minutes. This is an optional command. If not specified then the Database Maintenance run will proceed till the end of cleanup. | -dur {Time in minutes} For example: ./dbm_cli.nsh -run Snapshot=45:Audit=30:JRE=20 -dur 120 | Displays the confirmation message of the –run command since it is passed along with it. |
Force | Passed with Run command. The command will force Database Maintenance to proceed although deletable data is under 30% (of the total data) for that module. This is an optional command. | -force For example: ./dbm_cli.nsh -run Snapshot=45:Audit=30:JRE=20 -dur 120 -force | Displays the confirmation message of the –run command since it is passed along with it. |
Stop | Stops the current Database Maintenance run (if running). | -stop For example: ./dbm_cli.nsh -stop | Displays the complete status of the last Database Maintenance run that was stopped. Also shows module wise details in the final output. Refer State command for details. |
State | This command will provide the current state of Database Maintenance along with useful information about the cleanup and DB state. | -state For example: ./dbm_cli.nsh -state | Displays the complete status of the last Database Maintenance run that was stopped. Also shows module wise details in the final output. |
Evaluate | This is an analytical feature where you know the best retention period for a specific module that you can pass to Database Maintenance for cleanup. Virtual scenarios are created of different retention periods and the amount of cleanup that will be done for them in a given module. | - eval For example: ./dbm_cli.nsh -eval | Displays the various scenarios for each module based on the live analysis on the customer DB. |
Impacted Jobs | This command lists the impacted Jobs of the specified module, for which the Job Runs will be deleted as per the specified retention period in the CLI command. Valid Database Maintenance Modules are listed below:
| - impact {'Database Maintenance module name'=<retention period>} For example: ./dbm_cli.nsh -impact Snapshot=45 | Displays the following confirmation message on the console Jobs Impacted have been exported into <BSA_NSH_HOME>/br/dbm-rcp/ jobs_impacted_<CLI_Module_Name>_retention.csv |
Logs | This command simply exports the Database Maintenance run log. It is useful for debugging while troubleshooting. | -logs For example: ./dbm_cli.nsh -logs | Displays the following confirmation message on the console Log file <BSA_NSH_HOME>/br/dbm-rcp/run_log.log exported |