Swsrpbackup_sql and swsrprestore_sql are used in the backup operation of SQL Server by the replication management function.
NAME
swsrpbackup_sql - backup of SQL Server databases
SYNOPSIS
<program-directory>\bin\swsrpbackup_sql [-Xserver serverName] [-Xinstance instanceName] (-Xgroup groupName | -Xdevmap deviceMapFile) [-m] [-t] [-T] (-Xdblist dbListFile | dbName-1 dbName-2,,,dbName-i)
DESCRIPTION
This command backup of SQL Server databases. This command, in cooperation with SQL Server, performs copy of data of the target database volumes on to backup volumes by executing the swsrpmake command. The database backup history information is stored in msdb of SQL Server.
When using WSFC for cluster operation in a Windows environment, this command performs automatic configuration of the maintenance mode of the physical disk resources to which the volume belongs with pre- and post-processing. For more information, refer to "15.1.8.1 When Using WSFC for Cluster Operation".
OPTIONS
Specifies the virtual server name of a connected SQL Server in the case of cluster operation. In case of operation without cluster, this option is not necessary.
Specifies a connection instance. Specify an instance name in the operand. If this option is not specified, connection is made to the default instance.
Specify replication management function group name.
In cases when backup has been performed while specifying this option, it is possible to confirm the backup history information with the swsrphistory_sql command.
Specify a device map file name that describes combinations of database volumes and destination backup volumes. For details on the device map file, refer to "10.4.1.7 Prepare Device Map File (When Not Creating a Replication Group)". Specify a device map file name using an absolute pathname.
For backup server type operation (i.e., server-to-server replication), this option specifies that communication processing with the backup server (i.e., a non-operation server) is not performed. When it is specified, volume status check processing and pre-processing and post-processing are not performed for the backup volume. This option is valid only during backup server type operation.
Specifies that the pre-processing and post-processing for a backup volume (i.e., the copy destination volume) are not performed.
Use this option only when AdvancedCopy Manager does not execute pre-processing and post-processing of the copy destination volume and unique pre-processing and post-processing scripts are inserted before and after the AdvancedCopy Manager command (respectively).
Specifies that the differential snapshot high-speed backup is executed.
This option cannot be specified during synchronous processing.
This option is valid only for copying within a box when the ETERNUS Disk storage system supports the QuickOPC function.
For the snapshot high-speed backup without specifying this option, ordinary snapshot processing (OPC without using the QuickOPC function) is started. This option must be always specified to perform a backup operation using differential snapshots.
Specify the file that lists all databases subject to backup (the database list file).
Specify the database list file as an absolute path or as a relative path from the current task folder.
In the case that this option has been specified, it is not possible to specify a database name as the operand.
For details on the database list file, refer to "10.4.1.8 Performing Database List File".
OPERANDS
Specifies database names. If the database name contains a space, enclose it with double quotes.
When specifying two or more database names, separate the names with/using a space or tab as a delimiter. No more than 128 database names can be specified.
EXIT STATUS
=0: Completed successfully
>0: Terminated abnormally
EXAMPLES
Backup the databases DB01, DB02, and DB03 of virtual server VSERVER in group grp1:
C:\>set SWSTGNODE=nodeAGT C:\>C:\Win32App\AdvancedCopyManager\bin\swsrpbackup_sql -Xserver VSERVER -Xgroup grp1 DB01 DB02 DB03 DB01 DB02 DB03 swsrpbackup_sql completed C:\>
Specify the database list file with the -Xdblist option and perform a backup of the databases DB01, DB02, and DB03 under the virtual server VSERVER within the group grp1 (in the case that the command is executed while specifying the -Xdblist option, the command completion message is listed on a different row for each database name).
C:\>set SWSTGNODE=nodeAGT C:\>C:\Win32App\AdvancedCopyManager\bin\swsrpbackup_sql -Xserver VSERVER -Xgroup grp1 -Xdblist G:\STGADM\dblist.dat DB01 DB02 DB03 swsrpbackup_sql completed C:\>
NOTES
You cannot perform backup in the following cases:
A specified database does not exist. (This includes the case where neither the virtual server nor the instance exists).
In the case of specifying two or more databases, all of the specified databases are not databases of the same instance (When the -Xinstance option is not used, the processing is performed on the default instance. When the -Xinstance option is used, the processing is performed on the specified named instance).
The specified device map file does not exist.
The description of the device map file on the target database volume has an error. (refer to "10.4.1.7 Prepare Device Map File (When Not Creating a Replication Group)")
The database volumes and backup volumes described in the device map file are not registered as original volumes and replica volumes, respectively.
Synchronous processing between the database volumes and the backup volumes described in the device map file is not in equivalency maintenance state.
After operation has begun, any of physical information (i.e., box identifier, OLU number, EXTENT start position, or EXTENT size) of a volume has been changed.
A database volume has multiple mount points.
When all the backup volumes are volumes on the database server, the -m option is specified.
For backup server type operation (server-to-server replication), the Managed Server on which the command is executed is not the operation server of the corresponding replication volumes.
For backup server type operation (i.e., server-to-server replication), communication with a destination server fails.
Too many (i.e., 129 or more) databases were specified.
When the replication destination volume cannot be locked
When the contents of the replication destination volume lock operation specification file are invalid
Perform drive letter release or dismount of copy destination volume before executing a command when the intended backup corresponds to either of the following conditions:
When a replication is performed between different OSs
When the sizes of the replication source volume and the replication destination volume differ
If neither drive letter release nor dismount are performed in the above-mentioned case, post-processing of the copy target volume at the time of backup produces as an error.
If this command is executed during the running of snapshot processing, stop the copy processing that is in progress and start the snapshot processing again.
This command can back up two or more databases at the same time by specifying the operand. When, for example, two or more databases exist on one partition, physical files of multiple databases exist together on different volumes, perform the backup of all the databases which exist on the volumes by using this function.
This command freezes all the databases specified by SQL Server until backup processing is completed. Thus, if the volumes where database files exist are independent for each database, back up each database two or more times to reduce the frozen time as much as possible.
Because the process of securing data consistency for database volumes when the backup is performed is done by SQL Server, the pre-processing and post-processing (i.e., volume lock and unlock) are not executed, as they would be in a typical file system.
If an error occurs while this command is processing a database consisting of two or more volumes with this command, processing is interrupted. When you perform synchronous type backup, restart any stopped synchronous processing by using the swsrpstartsync command.
Before replication is performed in snapshot-type replication, this command option prevents other processes from accessing the replication destination volume to protect the process that is accessing the volume. The command accomplishes this by either locking or dismounting the replication destination volume. In cases where the replication destination volume cannot be locked or dismounted, such as those described below, the command terminates with an error:
The mount point has a directory for mounting another volume.
The volume has a file that is being used. If the replication destination volume is being used by a server that is not the server where the command was entered, prevent the replication destination volume from being accessed by cancelling share settings or performing a dismount for the replication operation, using the Administrator's authority.
This command can be executed only while none of the following commands are running:
This command terminates abnormally if it cannot turn the maintenance mode of the physical disk resource ON.
NAME
swsrphistory_sql - SQL Server backup history information display/delete
SYNOPSIS
<program-directory>\bin\swsrphistory_sql disp [-Xserver serverName | -Xallserver] [-Xinstance instanceName | -Xallinstance] [-Xgroup groupName] [-Xreg] [-Xdblist dbListFile | dbName-1,,,dbName-i]
<program-directory>\bin\swsrphistory_sql delete [-Xserver serverName] [-Xinstance instanceName] (-Xgroup groupName | -z) (-Xdblist dbListFile | dbName-1,,,dbName-i)
DESCRIPTION
This command Display/Deletes SQL Server backup history information.
The following information is displayed.
Title | Explanation |
---|---|
Instance-Name | Instance name is displayed. |
Server-Name | In a case of cluster operation, virtual server name is displayed. |
Group-Name | Replication group name is displayed. |
DB-Name | Database name is displayed. |
Meta-Data-File | Display the meta data file path as an absolute path. |
DB-File | Display the file paths of the database files (primary data file (.mdf), secondary data file (.ndf), log files (.ldf)) as absolute paths. |
Original-Volume | Transaction volume name (replication source volume name) is displayed. |
Replica-Volume | Backup volume name (replication destination volume name) is displayed. |
Backup-Date | Time and date of backup finish is displayed. |
Execute this command with the server on which the SQL Server is installed.
OPTIONS
Specify the computer name or the virtual server name of the SQL Server of the SQL Server backup history information to be displayed / deleted.
If both this option and the -Xallserver option are omitted, the computer name is specified.
The SQL Server backup history information of all the computers or virtual servers of SQL Server is displayed.
If both this option and the -Xserver option are omitted, the computer name is specified.
Specify replication management function group name.
Specify the instance of the SQL Server backup history information to be displayed / deleted. Specify an instance name in the operand.
If both this option and the -Xallinstance option are omitted, the default instance is specified.
The SQL Server backup history information of all instances of SQL Server is displayed.
If both this option and the -Xinstance option are omitted, the default instance is specified.
The SQL Server backup history information of the group registered on the replication management log is displayed.
In the case that this option has been omitted, all the SQL Server backup history information is displayed.
Specify the file that lists all databases subject to backup (the database list file).
Specify the database list file as an absolute path or as a relative path from the current task folder.
In the case that this option has been specified, it is not possible to specify a database name as the operand.
For details on the database list file, refer to "10.4.1.8 Performing Database List File".
Delete all the SQL Server backup history information.
OPERANDS
Specifies a database name. If the database name contains a space, enclose it with double quotes.
When specifying two or more database names, separate the names with/using a space or tab as a delimiter. No more than 128 database names can be specified.
EXIT STATUS
=0: Completed successfully
>0: Terminated abnormally
EXAMPLES
Displays SQL Server backup history information.
C:\Win32app\AdvancedCopyManager\bin>swsrphistory_sql disp -Xgroup grp1 -Xdblist C:\tmp\dblist.txt Instance-Name Server-Name Group-Name DB-Name Meta-Data-File DB-File Original-Volume Replica-Volume Backup-Date MSSQLSERVER WIN-FJPDG31D87G grp1 db0 E:\sql_db\db0.swsrp-dmp E:\sql_db\db0.mdf g3d7p1@WIN2012R2-X64_JP g1d36p1@WS2012X64MK23CT 2013/09/04 13:51 MSSQLSERVER WIN-FJPDG31D87G grp1 db0 E:\sql_db\db0.swsrp-dmp F:\sql_log\db0.ldf g3d7p2@WIN2012R2-X64_JP g1d36p2@WS2012X64MK23CT 2013/09/04 13:51 MSSQLSERVER WIN-FJPDG31D87G grp1 db1 E:\sql_db\db1.swsrp-dmp E:\sql_db\db1.mdf g3d7p1@WIN2012R2-X64_JP g1d36p1@WS2012X64MK23CT 2013/09/04 13:51 MSSQLSERVER WIN-FJPDG31D87G grp1 db1 E:\sql_db\db1.swsrp-dmp F:\sql_log\db1.ldf g3d7p2@WIN2012R2-X64_JP g1d36p2@WS2012X64MK23CT 2013/09/04 13:51 C:\>
Deletes SQL Server backup history information.
C:\>C:\Win32App\AdvancedCopyManager\bin\swsrphistory_sql delete -Xgroup grp1 db0 db1 db0 db1 swsrphistory_sql completed C:\>
NOTES
The database from which backup history information is deleted cannot be restored by the Restore Wizard for SQL Server.
NAME
swsrprestore_sql - restores an SQL Server database
SYNOPSIS
<program-directory>\bin\swsrprestore_sql [-Xserver serverName] [-Xinstance instanceName] [-Xnolog] -Xmeta metaFileName dbName
DESCRIPTION
This command restores an SQL Server database. Execute this command after restoring database files using the swsrpmake command. This command recreates a database from restored database files. To perform recovery after this command is executed, apply logs using Management Studio or Transact-SQL.
OPTIONS
Specifies the virtual server name of a connected SQL Server in case of cluster operation. In case of operation without cluster, this option need not be specified.
Specifies a connection instance. Specify an instance name in the operand. If this option is omitted, connection is made to the default instance.
Specifies the restoration of a DB to a backup point, without applying logs. If this option is omitted, the DB is restored to a backup point but cannot be used until logs are applied to it. Apply logs using Management Studio or Transact-SQL.
Specifies a metadata file name, using an absolute pathname. A metadata file is stored as "db-name.swsrp-dmp" in the same folder as the primary data file. To confirm file identification numbers of database files, use the Transact-SQL "USE DB-Name EXEC SP_HELPFILE". After this command closes, the metadata file is deleted.
OPERANDS
Specifies a database name. If the database name contains a space, enclose it with double quotes.
EXIT STATUS
=0: Completed successfully
>0: Terminated abnormally
EXAMPLES
Restore a database "DB01" using its backup data. The file restore using swstrestore has been completed and a metadata file is "D:\SQLSVR\DB01.swsrp-dmp":
C:\>C:\Win32App\AdvancedCopyManager\bin\swsrprestore_sql -Xserver VSERVER -Xmeta D:\SQLSVR\DB01.swsrp-dmp DB01 DB01 swsrprestore_sql completed C:\>
NOTES
You cannot specify a target backup volume and perform backup if:
Neither the virtual server nor the instance exist
By choosing to apply logs or not, you can select one of the following two restoration methods:
Restore to a backup point (ie, only restoring backup data)
Restore to the latest point or to a specific point (ie, restoring backup data and then applying logs)