Control-M/Server Database Backup and Restore
The following procedures describe how to back up and restore a Control-M/Server database:
-
Enabling Archiving of a Control-M/Server Database (Oracle and PostgreSQL only)
-
Backing up a Control-M/Server Oracle, MSSQL, or PostgreSQL Database with a Cold Backup
-
Backing up a Control-M/Server Dedicated PostgreSQL Database with a Hot Backup
-
Restoring a Control-M/Server Oracle or PostgreSQL Database from a Backup
Enabling Archiving of a Control-M/Server Database (Oracle and PostgreSQL only)
This procedure describes how to archive database log files when they become full.
If a database crash occurs, you can use the archived files to restore the database up until the most recent SQL transaction. Hot backups require that Archive Mode be enabled, but the backup procedure automatically sets Archive Mode if it was not previously set. For more information about hot backups, see Database Backup and Restore.
Begin
-
Display the Control-M Main Menu by typing the ctm_menu command.
-
In the Control-M Main menu, enter the number for the Database Menu option.
The Database Utilities Menu appears.
-
In the Database Utilities Menu, enter the number for the Management option.
The Management Menu appears.
-
In the Management Menu, enter the number for Set Database Archive Mode option.
-
At the prompt for the mode, type ON.
-
At the prompt for the destination directory, enter the name of the destination for archived log files.
-
When you are done, enter q to quit.
Backing up a Control-M/Server MSSQL Database
This procedure describes how to back up a Control-M/Serer MSSQL database onto a backup device. BMC recommends that you back up your Control-M/Server databases onto backup devices daily. You can complete this procedure while the database is running.
Performing this procedure has the same effect as running the ctmdbbck utility.
Begin
-
Display the Control-M Main Menu by typing the ctm_menu command.
-
In the Control-M Main Menu, enter the number for the Database Maintenance option.
-
In the Database Maintenance menu, enter the number for the List Backup Devices option, and write down the name of the device that you want to use.
When backing up an MSSQL database, the full path is a path on the database server computer.
-
Return to the Database Maintenance menu, and enter the number of the Backup Database option.
-
Enter the name of the backup device you wrote down in step 3.
The backup device must be either a valid device defined in the SQL database, or the full path name of a file to be created by the backup procedure.
-
Respond to the subsequent prompts that are displayed.
-
When you are done, enter q to quit.
The Control‑M/Server database is backed up onto a backup device.
Backing up a Control-M/Server Oracle, MSSQL, or PostgreSQL Database with a Cold Backup
This procedure describes how to back up a Control-M/Server Oracle, MSSQL, or dedicated PostgreSQL database onto a backup device with a cold backup. For more information on cold backup, see Database Backup and Restore. BMC recommends that you back up your Control-M/Server databases onto backup devices daily. You can complete this procedure while the database is running. To perform a cold backup, Archive Mode must be disabled.
Before You Begin
-
Disable the Archive Mode.
-
Shut down Control-M/Server.
Begin
-
Display the Control-M Main Menu by typing ctm_menu command.
-
In the Control-M Main menu, enter the number for the Maintenance option.
-
In the Maintenance menu, enter the number for the Backup Database option.
Oracle: The following prompt appears:
Enter a destination directory name [<ctm_home_dir>]:
PostgreSQL: The following prompt appears:
Enter a destination file name [<ctm_home_dir>]:
-
Press Enter to accept the default directory, or enter the name of a different directory where you want the backup to be saved.
The backup procedure assigns its own filename.
After you have disabled the Archive Mode, a cold backup is automatically performed.
The following prompt appears:
Specify archiving process destination directory:
-
Enter the directory path and filename in which the archive process will store its control files.
The backup procedure begins. Informational messages report the progress of the backup.
-
When you are done, enter q to quit.
-
When the backup is complete, start Control-M/Server.
Backing up a Control-M/Server Dedicated PostgreSQL Database with a Hot Backup
This procedure describes how to back up a Control-M/Server dedicated PostgreSQL database onto a backup device with a hot backup. For more information on hot backup, see Database Backup and Restore.
BMC recommends that you back up your Control-M/Server databases onto backup devices daily. You can complete this procedure while the database is running.
Before you begin
-
Enable the Archive Mode.
Begin
-
Display the Control-M Main Menu by typing ctm_menu command.
-
In the Control-M Main menu, enter the number for the Maintenance option.
-
In the Maintenance menu, enter the number for the Backup Database option.
The following prompt appears:
Enter a destination file name [<ctm_home_dir>]:
-
Press Enter to accept the default directory, or enter the name of a different directory where you want the backup to be saved.
The backup procedure assigns its own filename.
The following prompt appears:
Enter your choice for backup mode (Hot or Cold) [H/C]:
-
Select either H for hot backup, and press Enter.
The following prompt appears:
Specify archiving process destination directory:
-
Enter the directory path and filename in which the archive process will store its control files.
The backup procedure begins. Informational messages report the progress of the backup.
-
When you are done, enter q to quit.
Backup Device Parameters
The following table describes backup device parameters:
Variable | Description |
---|---|
<dev_logical_name> |
Logical name of the device |
{disk|tape} |
Type of device. This device can be either a disk file or a tape drive. Backups to disk files are faster and do not require operator intervention.
|
<file_full_path_name| device_name> |
Full path name (for disk) or a device name (for tape) |
Restoring a Control-M/Server MSSQL Database from a Backup
This procedure describes how to restore the Control-M/Server MSSQL database from a database failure or data corruption.
Performing this procedure has the same effect as running the ctmdbrst utility.
Begin
Display the Control-M Main Menu (ctm_menu).
-
In the Control-M Main menu, enter the number for the Database Maintenance option.
-
In the Database Maintenance menu, enter the number for the Restore Database option.
-
Follow the displayed prompts.
The backup device must be a valid device defined in the database, or the full path name of a backup file to be used as input for the ctmdbrst utility.
-
If you do not know the name of the backup device, display the list of backup devices by entering the number of the List Backup Devices option in the Database Maintenance menu, and then note the name of the device.
-
Type q to quit.
To recover from a hot restore failure (for PostgreSQL):
Begin
-
Stop any PostgreSQL processes currently running on the computer.
-
Go to the pgsql parent directory. On UNIX for example, this directory is the user ctm_em directory./li>
-
Check if pgsql_old_<current_date> exists. If so, this means that the restore process renamed the old (now corrupted) directory.
-
Rename it to pgsql.
-
Start the PostgreSQL server.
Restoring a Control-M/Server Oracle or PostgreSQL Database from a Backup
This procedure describes how to restore the Control-M/Server Oracle or PostgreSQL database are down as the result of a crash. If this is not the case, the restore procedure fails.
Performing this procedure has the same effect as running thectmdbrstutility.
Before You Begin
If you want to perform a restore from a Cold backup and Archive Mode is active, deactivate Archive Mode (using option 1 of the Database Maintenance menu) before performing the steps described below.
Begin
-
Shut down Control‑M/Server, and verify there are no other users or processes connected to the SQL Server.
-
Display the Control-M Main Menu by typing ctm_menu command.
-
In the Control-M Main menu, enter the number for the Maintenance option.
-
In the Maintenance menu, enter the number for the Restore Database option.
The following prompt appears:
Enter a destination directory name [<ctm_home_dir>]:
-
Press Enter to accept the default directory, or type the name of the directory in which the backup was saved.
-
When you are done, enter q to quit.
Control-M performs the restore as follows:
-
If Archive Mode is not active, a restore is automatically performed using information from the most recent Cold backup.
-
If Archive Mode is active, a restore is automatically performed using information from the most recent Hot backup.
(For PostgreSQL only) - If a hot restore process failed, it is possible to revert back to the file system as it existed before the restore process began. For details, see the following instructions.
The hot restore process uses the ctm_em/pgsql/data/pg_xlog directory to recover the database up until the point of failure. If this directory was damaged during the failure, the database can only be recovered up until the last database log switch.
-
Reverting Back to a PostgreSQL Database
This procedure describes how to revert back if a hot restore fails for a PostgreSQL database.
Performing this procedure has the same effect as running the ctmdbrst utility.
Begin
-
Stop any PostgreSQL processes currently running on the computer.
-
Go to the pgsql parent directory. On UNIX for example, this directory is the user ctm_em directory.
-
Check if pgsql_old_<current_date> exists.
If it exists, the restore process renamed the old (now corrupted) directory.
-
Rename it to pgsql.
-
Start the PostgreSQL server.
Rebuilding a Control-M/Server Database
This procedure describes how to rebuild a Control-M/Server database if the database structure (schema) is corrupt. After you rebuild the database, you need to restore the data.
Before You Begin
-
Before rebuilding the database, verify that the following requirements are met:
-
Back up the database data (see Backing up a Control-M/Server MSSQL Database)
-
Shut down Control-M/Server and Control-M/Server Configuration Agent
-
The SQL database is running
-
No Control-M/Server utilities are connected to the SQL Server
Begin
-
Display the Control-M Main Menu by typing the ctm_menu command.
-
In the Control-M Main menu enter the number for the Database Menu option.
The Database Utilities Menu appears.
-
In the Database Utilities Menu, enter the number for Management.
Management Menu appears.
-
In the Management Menu, enter the number for the Build Database option.
-
Follow the prompts online, and specify or change the parameters as required.
Default values are provided for most of the parameters. Modify them as required.
When rebuilding the database, working in an existing mode, the full path names of the log and data devices must be different from the original path names.
-
In the Main Menu, enter the number of the Database Maintenance option.
-
In the Database Maintenance, enter the number of the Cold Database Restore option to load the data into the new database.
-
Follow the displayed prompts.
The backup device must be a valid device defined in the database, or the full path name of a backup file to be used as input for the ctmdbrst utility.
If you do not know the name of the backup device, display the list of backup devices by entering the number of the List Backup Devices option in the Database Maintenance menu, and then note the name of the device.
-
When you are done, enter q to quit.