HP StorageWorks Storage Mirroring Recover Scripting Guide (T5437-96009, November 2009)
178 of 332
Creating a backup of the target by rotating
connections
The following two scripts create multiple copies of your data on the target, but only one
copy is active at a time. This allows you the time and availability to backup the inactive
copy of data. This is especially helpful when you have applications with interdependent
files.
Backups occur sequentially from the first file to the last file. Therefore, when you are
using applications that have interdependent files, such as a database application whose
database and log files must be synchronized, Storage Mirroring Recover cannot be
actively updating files on the target while the backup is running, or there becomes an
opportunity for interdependent files to become mismatched, causing a corrupt
application on the backup. For example, suppose the following scenario occurs on a
target machine that contains a replica of a database.
1. The backup process which is currently running sequentially through the files on the
target, reaches the database log file and starts writing the log file to tape. At the
same time, Storage Mirroring Recover receives additional updates to the database.
The database file on the target is updated, but since the log file is in use by the
backup, the associated log operation is placed on the Storage Mirroring Recover
queue on the target.
2. When the log file is finished being backed up, the backup process continues with
the next sequential file, which is not necessarily the database that corresponds
with that log file.
3. Since the log file is no longer in use, Storage Mirroring Recover applies the log
operation from the Storage Mirroring Recover queue.
4. Eventually, the backup process reaches the database file and writes it to tape.
At this point, the database file on the tape backup contains an extra update that the log
file on the tape backup does not. The two files do not correspond, so the database on the
tape backup will not be time consistent.
The two scripts identify an existing connection, disconnect it, establish a new
connection, and initiate a difference mirror. The connections in the two scripts transmit
the same data to two different locations, allowing you to backup the idle files on the
inactive connection.
# Script 1 #
$TheSource = "alpha";
$TheTarget = "beta";
$TheUser = "admin";
$ThePassword = "password";