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 in 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 using the following command:
db2 connect to <db_name>
- Configure the General Parallel File System (GPFS™) on the secondary cluster by extracting
and importing the settings from the primary cluster. On the primary
cluster, run the following GPFS command:
mmfsctl filesystem syncFSconfig -n remotenodefile
where remotenodefile is
the list of hosts in the secondary cluster.
- 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.
- Determine which file systems must be suspended and copied using
the following command:
db2cluster -cfs -list -filesystem
- Suspend each GPFS file system
that contains container data or log data using the following command:
/usr/lpp/mmfs/bin/mmfsctl filesystem suspend-write
where filesystem represents
a file system that contains data or log data.Note: While
the GPFS file systems are suspended,
write operations are blocked. You should only be performing the split
mirror operations during this period to minimize the amount of time
that operations are blocked.
- 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.
- Resume the GPFS file systems
that were suspended using the following command for each suspended
file system:
/usr/lpp/mmfs/bin/mmfsctl filesystem resume
where filesystem represents
a suspended file system that contains data or log data.
- Resume the I/O write operations for the primary database using
the following command:
db2 set write resume for database
Assuming that a situation requires you to restore the database
using the split mirror as the backup image, perform the following
steps:
- Stop the primary database instance using the following command:
db2stop
- List the cluster manager domain using the following command:
db2cluster -cm -list -domain
- Stop the cluster manager on each host in the cluster using the
following command:
db2cluster -cm -stop -host host -force
Note: The
last host which you shut down must be the host from which you are
issuing this command.
- Stop the GPFS cluster on
the primary database instance using the following command:
db2cluster -cfs -stop -all
- Copy the split-off data off the primary database using appropriate
operating system-level commands.
Important: Do not copy
the split-off log files, because the original logs are needed for
rollforward recovery.
- Start the GPFS cluster on
the primary database instance using the following command:
db2cluster -cfs -start -all
- Start the cluster manager using the following command
db2cluster -cm -start -domain domain
- Start the database instance using the following command:
db2start
- Initialize the primary database using the following command:
db2inidb database_alias as mirror
- Rollforward the primary database to the end of the logs, or to
a point-in-time, and stop.