Database Backup and Restore

You can back up and restore your data from a Control-M/EM or Control-M/Server database with the following backup and restore options:

  • Hot Backup: Tracks changes to the database while Control‑M/Server is active. After a crash (or other event), you can restore the database to the previous state before the crash. Hot backups are performed in Archive Mode, which requires extra disk space for control files. You must specify an existing directory when implementing hot backups (dedicated PostgreSQL only).

  • Cold Backup: Copies the contents of the database to a file when Control‑M/Server is shut down. The database can be restored up to the date/time of the last backup. You can use cold backups to restore the database to the state it was in when the backup was performed. To perform a cold backup, Archive Mode must be disabled. You can run the ctm_backup_bcp utility even when the database is in Archive Mode. Shut down Control-M/Server before performing a cold backup (Existing Oracle and dedicated PostgreSQL only).

  • Archive Mode: Control-M/Server backs up the logs before overwriting them with new information. If the database subsequently crashes, you can use the archived logs to restore the database up until the most recent SQL transaction. If you enable Archive Mode, you should plan to keep it enabled for long term use. If you enable and disabled it frequently, the archived log files do not provide useful information for database restoration. You can only use Archive Mode option when Control-M is running with the database server supplied with the Control-M installation. The Control‑M/Server automatically shuts down during this procedure. If Archive Mode is enabled, database transactions might perform slowly, and archive files require more disk space (dedicated PostgreSQL only).

  • Restore and Rebuild: Restores data from a correct database structure. If the Control-M/Server database structure (schema) becomes corrupt, you must rebuild the database. After the rebuild, you must restore the data. When a cold restore is performed, the restore file must be exported from the database with the same encoding as the destination database. If you rebuild the database with UTF8 encoding, you must manually configure the environment settings, to enable the Control-M/Server components to support this encoding.

Before rebuilding the database running the Build DB option through ctm_menu, when using an existing PostgreSQL database, first kill all transactions and then run Build DB. To find out which transactions are still open, you can refer to the Transactions Report that is generated by running the List All Active Transactions option using ctm_menu.