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:
- Connect to the primary database by using the following
command:
db2 connect to db_name
- Suspend the I/O write operations on the primary database
by using the following command:
db2 set write suspend for database
While the database is in suspended state, you should not
be running other utilities or tools. You should be only making a copy
of the database. You can optionally flush all buffer pools before
you issue SET WRITE SUSPEND to minimize the recovery
window. This can be achieved by using the FLUSH BUFFERPOOLS ALL statement.
- Create one or multiple split mirrors from the primary database
by using the 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.
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 EXCLUDE
LOGS with the SET WRITE command, do not
include the log files in the copy.
- Resume the I/O write operations on the primary database
by 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
by using the split-mirror database as the backup:
- Stop the database instance by using the following command:
db2stop
- Copy the split-off data by using operating system-level commands.
Important: Do not copy the split-off log files, because the
original logs are needed for rollforward recovery.
- Start the database instance by using the following command:
db2start
- Initialize the primary database:
db2inidb database_alias as mirror
where database_alias represents
the database alias.
- Roll forward the database to the end of the logs, or to a point-in-time,
and stop.