Using a split mirror as a backup image

Use the following procedure to create a split mirror of a database in a different location on the same system for use as a backup image outside of a Db2® pureScale® environment. This procedure can be used instead of performing backup database operations on the database.

Procedure

To use a split mirror as a backup image:
  1. Connect to the primary database using the following command:
    db2 connect to <db_name>
  2. Suspend the I/O write operations for the primary database using the following command:
    db2 set write suspend for database
    Note: While the database is in suspended state, you should not be running other utilities or tools. You should only be making a copy of the database. You can optionally flush all buffer pools before issuing SET WRITE SUSPEND to minimize the recovery window. This can be achieved using the FLUSH BUFFERPOOLS ALL statement.
  3. Create one or multiple split mirrors from the primary database using appropriate operating system-level and storage-level commands.
    Note:
    • Ensure that you copy the entire database directory including the volume directory. You must also copy the log directory and any container directories that exist outside the database directory. If you are using multiple storage groups, you must copy all paths, including files and subdirectories of those paths. To gather this information, refer to the DBPATHS administrative view, which shows all the files and directories of the database that need to be split.
    • If you specified the EXCLUDE LOGS with the SET WRITE command, do not include the log files in the copy.
  4. Resume the I/O write operations on the primary database using the following command:
    db2 set write resume for database

Assuming that a failure would occur on the system, perform the following steps to restore the database using the split-mirror database as the backup:

  1. Stop the database instance using the following command:
    db2stop
  2. Copy the split-off data using operating system-level commands.
    Important: Do not copy the split-off log files, because the original logs are needed for rollforward recovery.
  3. Start the database instance using the following command:
    db2start
  4. Initialize the primary database:
    db2inidb database_alias as mirror
    where database_alias represents the database alias.
  5. Rollforward the database to the end of the logs, or to a point-in-time, and stop.