Scripting Guide Tenth Edition (February 2008) Part Number: T2558-96074
© Copyright 2008 Hewlett-Packard Development Company, L.P. Hewlett-Packard Company makes no warranty of any kind with regard to this material, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. Hewlett-Packard shall not be liable for errors contained herein or for incidental or consequential damages in connection with the furnishing, performance, or use of this material.
Table of Contents Chapter 1: Introduction ...........................................................................................................1-1 Intended audience .................................................................................................................... 1-1 Conventions used in this guide ............................................................................................... 1-1 Resources ...............................................................................
Working with Storage Mirroring snapshots ........................................................................7-15 Creating a snapshot schedule ............................................................................................................................................................ 7-15 Initiating a manual snapshot from the Text Client ........................................................................................................................
1 X Introduction Introduction Intended audience The intended audience for the HP StorageWorks Storage Mirroring® Scripting Guide is network administrators familiar with Storage Mirroring features and functions and a working experience and knowledge of scripting. This guide does not explain Storage Mirroring features and functions, only the scripting aspects of Storage Mirroring. For details on the features and functions, see the Storage Mirroring User’s Guide.
Storage Mirroring documentation—The complete set of Storage Mirroring documentation includes the manuals listed below. Each manual is available in the \Storage Mirroring\docs directory on the product CD and in the root of the installation directory you selected during the installation. The manuals are in Adobe® Acrobat® PDF format. If needed, you can install the free Adobe Acrobat Reader® by downloading the latest version from the Adobe web site at www.adobe.com.
1-3
2 X Clients and Scripts Clients and Scripts Storage Mirroring has its own scripting language that can be used in the Storage Mirroring Text Client, the Storage Mirroring Command Line Client, or in script files. Each of these methods use the same set of commands. The Text Client The Text Client is a full-screen, text-based client that can be run from a command prompt. The interface uses Storage Mirroring commands entered one line at a time.
Interactive Entry C:\Program Files\StorageWorks\Storage Mirroring> dtcl -i Command: login alpha administrator ******* domain_name User access level set to DT_FULL_ACCESS Command: File Entry—Create a file with all of the Storage Mirroring commands you want to run. At the directory prompt where Storage Mirroring is installed, type DTCL –f filename where filename is the name of the file containing the Storage Mirroring commands. For example, you might use the following dtcl.
Storage Mirroring scripts You can create script files to execute series and combinations of Storage Mirroring commands to meet specific needs. When working with scripts, keep in mind the following. When creating Storage Mirroring scripts, each commented line must start and end with the pound (or number) sign (#). Storage Mirroring scripts must use ANSI coding. Do not use Unicode or other formats. Variables can be used in commands to replace items that vary such as machine or domain names.
Logging on and off of Storage Mirroring To ensure protection of your data, Storage Mirroring uses native operating system security and requires a valid system username and password. If you do not have a valid system username and password for a selected machine, you will not be able to configure Storage Mirroring for that machine. As you enter DTCL commands, Storage Mirroring automatically attempts to log on to the source or target machine. You can verify your access by the resulting message.
Getting Help in the Text Clients A listing of the Storage Mirroring DTCL commands and their syntax is available in the Storage Mirroring Text Client and Command Line Client by typing the help command. Command HELP Description Displays the Storage Mirroring DTCL commands and their syntax Syntax HELP Notes Press any key to scroll through the list of commands. Press q to exit the help function.
3 X Getting Started Getting Started Not all connection types can be established using the Storage Mirroring scripting language. Review the following lists to see which connection types you can create using the Storage Mirroring Text Client, Command Line Client, or through scripts.
4 X Protecting Specific Data Protecting Specific Data NOTE: As noted in the Scripting Guide Introduction on page 1-1, this guide does not explain Storage Mirroring features and functions, only the scripting aspects of Storage Mirroring. For details on the different features and functions, see the Storage Mirroring User’s Guide. Creating a replication set Before you can establish a connection, you must create a replication set. 1. 2. Use the repset create command to create a new replication set.
3. Define a replication set rule by using the repset rule add command. Command REPSET RULE ADD Description Adds a rule to a replication set. A rule is the specification of a path including volume, directories, wild cards, and/or file names.
Establishing the connection After you have created a replication set, you can establish a connection by connecting the replication set to a target. 1. 2. If you do not know which replication set you will be connecting to the target machine, the repset list command will display the available replication sets for that source.
Examples Notes connect DataFiles to beta map exact connect UserData to beta map base d:\UserData\ connect UserFiles to beta map exact orphans, compression 2 The default settings for this command are mirror, replicate, nomonitor, and noorphans. The options (no)mirror, (no)replicate, (no)monitor, (no)orphans, and compression can be used in any combination and in any order. The first option does not require a comma, but the second and remaining options do require a comma before the option.
5 X Simulating a Connection Simulating a Connection NOTE: As noted in the Scripting Guide Introduction on page 1-1, this guide does not explain Storage Mirroring features and functions, only the scripting aspects of Storage Mirroring. For details on the different features and functions, see the Storage Mirroring User’s Guide. Creating a replication set Before you can establish a connection, you must create a replication set. 1. 2. Use the repset create command to create a new replication set.
3. Define a replication set rule by using the repset rule add command. Command REPSET RULE ADD Description Adds a rule to a replication set. A rule is the specification of a path including volume, directories, wild cards, and/or file names.
Establishing the connection After you have created a replication set, you can simulate a connection by connecting the replication set to the TDU. 1. 2. If you do not know which replication set you will be connecting to the target machine, the repset list command will display the available replication sets for that source.
6 X Managing Replication Sets Managing Replication Sets NOTE: As noted in the Scripting Guide Introduction on page 1-1, this guide does not explain Storage Mirroring features and functions, only the scripting aspects of Storage Mirroring. For details on the different features and functions, see the Storage Mirroring User’s Guide. Using the Storage Mirroring commands, you can perform the following functions to manage your replication sets.
3. 4. View the replication set’s rules by using the repset display command. Command REPSET DISPLAY Description Displays the replication set rules Syntax REPSET DISPLAY [repset] Options repset—Name of the replication set Examples repset display DataFiles Notes If you do not specify a replication set name, the current replication set will be used. Replication set names that contain non-alphanumeric characters must be enclosed in quotation marks.
5. Add a new rule by using the repset rule add command. Command REPSET RULE ADD Description Adds a rule to a replication set. A rule is the specification of a path including volume, directories, wild cards, and/or file names.
Deleting a replication set 1. 2. 3. View the replication sets associated with the active source machine by using the repset list command. Command REPSET LIST Description Lists all replication set names for the currently selected source Syntax REPSET LIST Delete the replication set by using the repset delete command.
Calculating replication set size Use the repset calculate command to manually calculate the size of a replication set. Command REPSET CALCULATE Description Calculates the size of a replication set Syntax REPSET CALCULATE [repset] Options repset—Name of the replication set Examples repset calculate DataFiles Notes If a replication set name is not specified, the active replication set will be used. The results of the calculation are logged to the Storage Mirroring log file.
7 X Managing Connections Managing Connections NOTE: As noted in the Scripting Guide Introduction on page 1-1, this guide does not explain Storage Mirroring features and functions, only the scripting aspects of Storage Mirroring. For details on the different features and functions, see the Storage Mirroring User’s Guide. Using the Storage Mirroring commands, you can perform the following functions to manage your connections.
Monitoring connections The Storage Mirroring Text Client window displays a minimal number of statistical and informational data on screen. Additionally, ou can use the Storage Mirroring status command to display statistical and informational data. Identify the connection ID by locating the number in the left column of the Text Client window and use the status command to display the information.
Controlling mirroring You can stop, start, pause, or resume a mirror.
Mirror Pause Command MIRROR PAUSE Description Pauses a mirror that is in progress Syntax MIRROR PAUSE Options con_id—Connection ID assigned to the source/target connection *—Specifies all connection IDs. mirror pause 1 mirror pause * Examples Mirror Resume Command MIRROR RESUME Description Resumes a paused mirror Syntax MIRROR RESUME Options con_id—Connection ID assigned to the source/target connection *—Specifies all connection IDs.
Configuring customized mirror scripts 1. 2. To determine any current mirroring scripts, use the account list command.
Notes 3. 4. The default settings for this command are nodelay and nointeract. The file name you specify for your script should be the primary executable of the command being run. If you are using a command shell to execute a script, put the command shell execturable as the script file name and pass another script name in as an argument. Multiple arguments need to be enclosed in quotation marks and separated by a space.
Notes 5. The default setting for this command is nointeract. The file name you specify for your script should be the primary executable of the command being run. If you are using a command shell to execute a script, put the command shell execturable as the script file name and pass another script name in as an argument. Multiple arguments need to be enclosed in quotation marks and separated by a space.
Starting replication Start replication by using the replication start command.
Inserting tasks during replication Task command processing is a Storage Mirroring feature that allows you to insert and run tasks at various points during the replication of data. Because the tasks are user-defined, you can achieve a wide variety of goals with this feature. For example, you might insert a task to create a snapshot or run a backup on the target after a certain segment of data from the source has been applied on the target.
Options job_name—Unique job name assigned to this task. This will be the identifier you see in the log target—Name of the target, an IP address on the target, or a virtual IP address. Depending on the files. network route Storage Mirroring uses to access the target, you may need to specify the fully qualified domain name. The target is required even if you are only queuing a task to be executed on the source.
Configuring compression 1. 2. To determine the current compression setting, use the compression list command. By default, compression is disabled. Command COMPRESSION LIST Description Identifies the compression level set and if compression is enabled Syntax COMPRESSION LIST To set the level of compression, use the compression set command.
Configuring and removing orphan files 1. To configure orphan removal or deletion during mirror, verification, and restoration processes, use the orphans enable command. Command ORPHANS ENABLE Description Enables orphan file removal during subsequent mirror or verification processes. Syntax ORPHANS ENABLE con_id Options con_id—Connection ID assigned to the source/target connection Examples orphans enable 1 2.
5. If you want to stop removing orphan files after it has been started, use the orphans stop command. Command ORPHANS STOP Description Stops the process to remove orphan files on the target Syntax ORPHANS STOP con_id Options con_id—Connection ID assigned to the source/target connection Examples orphans stop 1 Verifying your data With Storage Mirroring commands, verification can only be initiatied after a connection is established. 1. Log on to the source using the login command.
3. Initiate the verification process by using the verify command. Command VERIFY Description Verifies the integrity of the data between the source and target machines.
Working with Storage Mirroring snapshots You can use Storage Mirroring commands to create a snapshot schedule, initiate a manual snapshot, apply a snapshot on the target, or delete a snapshot from the target. Creating a snapshot schedule Use the snapshot schedule commands to establish scheduled snapshots. 1. To establish and initiate a snapshot schedule, use the snapshot schedule every command.
3. 4. You can disable a snapshot schedule, without losing the schedule configuration, by using the snapshot schedule disable command.
Applying a snapshot on the target Apply a snapshot to the target by using the snapshot revert command.
2. Delete snapshots on the target by using the snapshot delete command.
Disconnecting a connection Use the disconnect command to disconnect the source/target connection. Command DISCONNECT Description Disconnects a specified source/target connection for the currently selected source.
8 X Managing Data Transmission Managing Data Transmission NOTE: As noted in the Scripting Guide Introduction on page 1-1, this guide does not explain Storage Mirroring features and functions, only the scripting aspects of Storage Mirroring. For details on the different features and functions, see the Storage Mirroring User’s Guide. Using the Storage Mirroring commands, you can perform the following functions to manage your connections.
3. 4. To pause the transmission process, use the transmission pause command. Command TRANSMISSION PAUSE Description Pauses the transmission pause Syntax TRANSMISSION PAUSE Options target—Name of the target, an IP address on the target, or a virtual IP address. Depending on the network route Storage Mirroring uses to access the target, you may need to specify the fully qualified domain name.
Controlling a target manually 1. 2. Pause the execution of operations on the target by using the pausetarget command on a target that you are logged in to. Verify that (Paused) is displayed after the target name on the Text Client screen.
Scheduling transmission criteria You can clear an existing schedule, disable or enable the use of a schedule, and set start, stop, and window criteria. 1. 2. To clear all existing transmission options, use the schedule clear command.
3. You can specify a start time, a repeat interval, and queue usage criteria.
5. You can specify a transmission window. Command SCHEDULE WINDOW Description Sets criteria to only allow transmissions during a certain period of time Syntax SCHEDULE WINDOW TO Options target—Name of the target, an IP address on the target, or a virtual IP address Depending on the network route Storage Mirroring uses to access the target, you may need to specify the fully qualified domain name. hh:mm—Time in hour:minute format using the 24-hour clock.
Setting bandwidth limitations You can set a fixed bandwidth limit or a bandwidth schedule. 1. 2. With a fixed bandwidth limit, data will be transmitted at all times according to the user-specified bandwidth configuration. If you want to set a fixed bandwidth limit, use the limit bandwidth command.
Notes This command transmits in bursts, not bytes per seconds. The time identifies how long to wait before transmitting again. For example, if 5 seconds are specified and it only takes 2 seconds to send the specified bytes, Storage Mirroring will wait an additional 3 seconds before transmitting again. Options that contain non-alphanumeric characters must be enclosed in quotation marks. 3. Repeat the limit bandwidth schedule add command to create a comprehensive bandwidth schedule.
6. 7. 8. To clear the schedule use the limit bandwidth schedule clear command. Command LIMIT BANDWIDTH SCHEDULE CLEAR Description Clears a bandwidth schedule Syntax LIMIT BANDWIDTH SCHEDULE CLEAR Options target—Name of the target, an IP address on the target, or a virtual IP address. Depending on the network route Storage Mirroring uses to access the target, you may need to specify the fully qualified domain name.
9 X Failover Failover NOTE: As noted in the Scripting Guide Introduction on page 1-1, this guide does not explain Storage Mirroring features and functions, only the scripting aspects of Storage Mirroring. For details on the different features and functions, see the Storage Mirroring User’s Guide. Using the Storage Mirroring commands, you can perform the following functions to manage failover.
3. 4. 5. Establish a monitor to use with the remaining monitor commands by using the monitor create command. Command MONITOR CREATE Description Establishes a source as a failover monitor. This is the machine that will be monitored by a target in case it should experience a failure. Syntax MONITOR CREATE
Options IP_address—The IP address which should be moved during failover target_NIC—The integer value of the target NIC obtained from the niclist command NONE—Does not actively monitor the source machine. You will be responsible for identifying when a failure has occurred and initiating failover manually.
Syntax MONITOR OPTION [MOVENAME | NOMOVENAME] [, MOVEADDRESSES | NOMOVEADDRESSES] [, MOVESHARES | NOMOVESHARES] [, ADD | REPLACE] [, USESHAREFILE | NOUSESHAREFILE][, FAILONE | FAILALL] [, FODELAY | NOFODELAY] [, FBDELAY | NOFBDELAY] [, APPLY | DISCARD | REVERT] [, INTERVENTION | NOINTERVENTION] [, FOHOSTNAME | NOFOHOSTNAME] [, FBHOSTNAME | NOFBHOSTNAME] [monitor] Options MOVENAME—Moves the server name during failover NOMOVENAME—Does not move the server name during failover MOVEADDRESSES—Moves
8. 9. If you specified to failover or failback the hostname in the monitor option command. You will need to specify a user and the associated password that has update privileges within Active Directory using the monitor account add command. This allows SPNs to be created and deleted during failover and failback.
10. Remove any scripts by using the monitor script remove command.
12. Start failover monitoring by using the monitor start command. Command MONITOR START Description Initiates failover monitoring Syntax MONITOR START [ON ] Options monitor—Name of the source machine designated as the monitor target—Name of the target, an IP address on the target, or a virtual IP address Examples monitor start alpha on beta Notes Options name that contain non-alphanumeric characters must be enclosed in quotation marks. 13.
2. 3. Command TARGET Description Identifies a machine as the active target machine Syntax TARGET Options target—Name of the target, an IP address on the target, or a virtual IP address Examples target beta Notes You must be logged into a machine using the login command before using the target command. Target names that contain non-alphanumeric characters must be enclosed in quotation marks. If necessary, review the failover settings by using the monitor display command.
4. To delete the monitor, use the monitor delete command. Command MONITOR DELETE Description Deletes the specified failover monitor and all of its parameters Syntax MONITOR DELETE Options monitor—Name of the source machine designated as the monitor Examples monitor delete alpha Notes In order to successfully delete a monitor, the monitor must not be running on the server. Use the monitor stop command to ensure the monitor is not running.
10 X Restoration Restoration NOTE: 1. As noted in the Scripting Guide Introduction on page 1-1, this guide does not explain Storage Mirroring features and functions, only the scripting aspects of Storage Mirroring. For details on the different features and functions, see the Storage Mirroring User’s Guide. Login to your target by using the login command.
3. Restore Storage Mirroring data from target to the source by using the restore command.
11 X Failback Failback NOTE: As noted in the Scripting Guide Introduction on page 1-1, this guide does not explain Storage Mirroring features and functions, only the scripting aspects of Storage Mirroring. For details on the different features and functions, see the Storage Mirroring User’s Guide. 1. If you are performing failback before restoring, verify that your source machine is not connected to the network and that the issue(s) that caused the failure is resolved.
4. Initiate failback by using the failback command. If you specified a pre-failback script in your failover configuration, that script will be executed at this time.
12 X Server Settings Server Settings While only a subset of the server settings are available through the Management Console, all of the Storage Mirroring server settings are accessible through the text clients. You can retrieve the value of a setting or you can update the value of a setting. Retrieving setting values—To retrieve the current value of a setting, use the Storage Mirroring get command. This command will return the value of the specified setting from the specified server.
Storage Mirroring Server Settings Server Setting ActivationCode Description 16- or 24-character Storage Mirroring activation code Values: Unique value for each customer Default: N/A GUI Setting: Server Properties, Licensing tab, Activation Code AdapterFlags Specifies the adapter to use when establishing a connection. This option should not be changed.
Server Setting AutoRemirror Description Specifies whether to remirror when a source is brought online after an auto-disconnect Values: 0 Do not remirror 1 Perform a file differences checksum mirror 2 Perform a full mirror 3 Perform a file differences mirror Default: 1 GUI Setting: Server Properties, Setup tab, Source Module Startup Options, Perform Remirror After Auto-Reconnect AutoRemirrorRetry Specifies how often, in seconds, the source should check for connections that have been reconnected but still
Server Setting ChecksumAll Description Setting to allow for the difference checksum option on mirror, verify, or restore to ignore the date, time, and size of the file and perform a checksum calculation on all files Values: 0 Checksum using date, time, size comparison 1 Checksum all files regardless of the date, time, or file size Default: 0 GUI Setting: Server Properties, Source tab, Mirroring or Verify, Block Checksum All Files on a Difference Mirror Cleaner Specifies if a clean mirror will delete fil
Server Setting DefaultProtocol Description The default protocol Values: 1 IP protocol Default: 1 GUI Setting: Server Properties, Network tab, Interface, Default Protocol TCP/IP is the only protocol currently supported.
Server Setting EmailExcludeIds Description Identifies the Windows Event Viewer messages that are excluded from e-mail notification. Values: Comma or semicolon separated list of Event Viewer IDs. You can indicate ranges within the list. Default: None GUI Setting: Server Properties, E-mail Notification tab, Exclude these Event IDs You must disable and re-enable e-mail notification for a change to take effect.
Server Setting EmailSmtpLogin Description Specifies if SMTP server authentication for e-mail notification is enabled or disabled Values: 0 SMTP authentation is disabled 1 SMTP authenticaion is enabled Default: 0 GUI Setting: Server Properties, E-mail Notification tab, Log on to SMTP Server Your SMTP server must support the LOGIN authentication method to use this feature.
Server Setting EnableSnapshots Description Specifies whether Storage Mirroring snapshot functionality is enabled Values: 0 Storage Mirroring snapshot functionality is disabled 1 Storage Mirroring snapshot functionality is enabled Default: 1 GUI Setting: None This setting only affects Storage Mirroring snapshot functionality. If this setting is disabled, other snapshot software such as Microsoft Volume Shadow Copy will be unaffected.
Server Setting FileQueueSize Description When a mirror is started, one thread reads from the disk and builds the file queue. Another set of threads reads files off of the queue and sends them to the target. This setting is the maximum size of the queue in entries. If you had 100 files to be mirrored and this was set to 16 (the default value), the first thread would fill the queue to a maximum of 16 entries.
Server Setting HPQueueRatio Description Ratio of replication packets to one mirror packet Values: 0 - 65535 Default: 5 A HPQueueRatio of 5 indicates 5 replication packets to 1 mirror packet. GUI Setting: Server Properties, Source tab, Queue Ratio, Replication Packets to 1 Mirror Packet If you change this value, the source service must be stopped and restarted to implement the change.
Server Setting IntermediateQueue Limit Description Amount of memory, in KB, that may be allocated to the intermediate queue by the system memory manager when MemoryAllocatorMode is set to mixed mode (2). Values: 512-4194304 Default: 65536 GUI Setting: None The Storage Mirroring service must be restarted in order for this change to take effect.
Server Setting LogFile Description The name of the Storage Mirroring messages/alerts log file Values: any valid file name Default: DTLog GUI Setting: None LogMessageLevel Specifies the types of messages logged to the.dtl files Values: 0 No messages will be logged 1 Only alert messages will be logged 2 Alert and release messages will be logged 3 Alert, release, and debug messages will be logged Default: 2 GUI Setting: None LoopbackID This entry is no longer used.
Server Setting MaxRetry Description A generic, application wide setting specifying the number of retry attempts for processes such as creating sockets, starting the service, and so on Values: any integer Default: 5 GUI Setting: None MaxWriteChunkSize Maximum merged op size (in bytes) used during replication Values: 1 - 131072 Default: 65536 GUI Setting: None MCHelpPath The path and file name to the Management Console online help file Default: C:\Program Files\StorageWorks\Storage Mirroring\online help\
Server Setting MirrorOverwrite Description Determines if the mirror process overwrites existing files Values: 0 never overwrite 1 always overwrite 2 overwrite if older Default: 1 GUI Setting: None MirrorPrompting This entry is no longer used.
Server Setting NetPort Description Port connection for TCP communications Values: 1025 - 65535 Default: 1100 GUI Setting: Server Properties, Network tab, Interface, Service Listen Port If you change this value, the source service must be stopped and restarted to implement the change.
Server Setting PostFailoverScript Args Description Arguments to be used with the target post-failover script Values: Any valid argument Default: GUI Setting: Failover Control Center, Monitor Settings, Scripts, Target, Post-Failover, Arguments PreFailbackScript Location on the target where the target pre-failback script is located Values: Any valid path Default: GUI Setting: Failover Control Center, Monitor Settings, Scripts, Target, Pre-Failback PreFailbackScriptArgs Arguments to be used w
Server Setting PriorityClass Description The priority level at which the Storage Mirroring service runs. Values: 3 Default: 3 GUI Setting: None The Storage Mirroring service runs at normal priority by default, which is adequate in most cases. However, there are some high-load situations where Storage Mirroring needs a higher priority in order to move data through its queues and transmit the data to the target. One specific example is with bulk inserts to a SQL Server database.
Server Setting QJournalSpaceMax Description The maximum amount of disk space, in MB, in the specified QJournalDir that can be used for Storage Mirroring queuing. When this limit is reached, Storage Mirroring will automatically begin the auto-disconnect process.
Server Setting Description RemoveOrphansTime Specifies the amount of time that must be expired before an orphan file is removed Values: 1 - 131072 minutes Default: 60 minutes GUI Setting: Connection/Restoration Manager, Orphans tab, Remove Orphans not modified within the following time period RemoveSharesOn Disconnect Specifies if shares are removed on the target machine when a Storage Mirroring replication set is disconnected from a target or a source machine is manually shutdown by the administrator.
Server Setting ScheduleFile Description Name of the database file that contains transmission scheduling information Values: any valid file name Default: Schedule.sts GUI Setting: Server Properties, Database tab, Database Files, Schedule If you change the name of the database file, the source service must be stopped and restarted to start logging to the new database file.
Server Setting ShutdownTimeout Description The amount of time, in seconds, for the service to wait prior to completing the shutdown so that Storage Mirroring can persist data on the target in an attempt to avoid a remirror when the target comes back online Values: any valid number of seconds where 0 (zero) indicates waiting indefinitely and any other number indicates the number of seconds Default: 0 GUI Setting: Server Properties, Setup tab, Server Shutdown Timeout This setting only controls the service s
Server Setting StatsFileName Description Default file for logging statistics Values: any valid file name Default: statistic.
Server Setting TempDir Description Temporary directory used when replicating Windows 200x encrypted files. GUI Setting: C:\Program Files\StorageWorks\Storage Mirroring\Temp TGBlockOnConnect Blocks the target path for all connections, regardless of the source, so that the data cannot be modified Values: 0 Target paths are not blocked 1 Target paths are blocked Default: 0 GUI Setting: None Do not modify this setting without assistance from Technical Support.
Server Setting TGMirrorCapacity High Description Maximum percentage of system memory that can contain mirror data before the target signals the source to pause the sending of mirror operations. Values: 2-75 Default: 20 GUI Setting: Server Properties, Target tab, Files, Target Mirror Capacity High Percentage TGMirrorCapacity Low Minimum percentage of system memory that can contain mirror data before the target signals the source to resume the sending of mirror operations.
Server Setting TGWriteFailure BeforeNotification Description Specifies the number of times an operation will be retried on the target before a notification is sent to the source to update the Target Status field of the Management Console. Values: 0-1024 Default: 10 GUI Setting: None If you change the setting to 0, the notification will be disabled. Changing this option will only affect how the status is changed on the Target Status field of the Management Console.
Server Setting VerifyLogLimit Description Maximum size of the DTVerify.log file in bytes Values: limited by available hard drive space, up to 4 GB Default: 1048576 GUI Setting: Server Properties, Logging tab, Verification, Maximum Length VerifyLogName Name of the verification log file Values: any valid file name Default: DTVerify.
13 X Storage Mirroring Commands Storage Mirroring Commands The Storage Mirroring commands are listed in alphabetical order on the following pages. Each command includes the following: Command name Description of the command Exact syntax for using the command Options, if any Examples, if necessary Notes, if any For details on the conventions used for the command syntax, see Conventions used in this guide on page 1-1.
Compression Enable Command COMPRESSION ENABLE Description Enables compression Syntax COMPRESSION ENABLE Options con_id—Connection ID assigned to the source/target connection Examples compression enable 1 Compression List Command COMPRESSION LIST Description Identifies the compression level set and if compression is enabled Syntax COMPRESSION LIST Compression Set Command COMPRESSION SET Description Sets the compression level Syntax COMPRESSION SET Options
ConID Command CONID Description Allows you to to assign the value of a connection ID to a variable or list the target and replication set for all connection IDs for a source Syntax Options Examples =CONID TO CONID LIST [source] variable—Name of the variable that you want to use to store the connection ID repset—Replication set that was used to establish the connection target—Name of the target, an IP address on the target, or a virtual IP address sou
Connect Command CONNECT Description Establishes a connection between a replication set and a target machine Syntax CONNECT TO MAP EXACT | MAP BASE | MAP TO [,...
Connect TDU Command CONNECT TDU Description Establishes a simulation connection between a replication set and the Throughput Diagnostics Utility. This connection imitate a normal connection without transmitting any data across the network.
Email Disable Command EMAIL DISABLE Description Disables e-mail notification Syntax EMAIL DISABLE Notes You must have an active source specified for any e-mail command to work properly. Email Enable Command EMAIL ENABLE Description Enables e-mail notification Syntax EMAIL ENABLE Notes You must have an active source specified for any e-mail command to work properly.
Email Get Email Config Command EMAIL GET EMAILCONFIG Description Displays e-mail notification configuration information Syntax EMAIL GET EMAILCONFIG Notes You must have an active source specified for any e-mail command to work properly.
Email Set Filter Include Command EMAIL SETFILTERINCLUDE Description Specifies which Event Viewer messages are sent via e-mail Syntax EMAIL SETFILTERINCLUDE [INFO, WARNING, ERROR] [EXCLUDEIDS ""] Options INFO—Information messages will be sent via e-mail WARNING—Warning messages will be sent via e-mail ERROR—Error messages will be sent via e-mail EXCLUDEIDS ID1,ID2-ID4,...—A comma separated list of IDs or ID ranges.
Email Test Command EMAIL TEST Description Sends a test message to demonstrate e-mail notification Syntax EMAIL TEST [SENDTO ] [ TEXT ] Options email_address—Specifies the e-mail address(es) to send the test message to if you do not want to use the e-mail addresses configured with the EMAIL ADD command. This is a comma separated list of addresses. The entire list should be enclosed in quotation marks.
Failback Command FAILBACK Description Initiates the failback process for the specified monitor machine Syntax FAILBACK [ON ] [REMONITOR|NOREMONITOR] Options monitor—Name of the source machine designated as the monitor target—Name of the target, an IP address on the target, or a virtual IP address REMONITOR—Automatically continues monitoring the source machine after failback NOREMONITOR—Automatically discontinues monitoring the source machine after failback.
Get Command GET Description Requests the value of a Storage Mirroring program setting from the specified server Syntax GET [machine] Options setting—See the table Storage Mirroring Server Settings on page 12-2 for a complete list of the Storage Mirroring program settings machine—Name of the machine get netport get VerifyLogName get DefaultAddress If you do not specify a machine name, the value from the current source will be returned.
Get Local Command GETLOCAL Description Requests the value of a Storage Mirroring program setting from the local machine Syntax GETLOCAL
Limit Bandwidth Disable Command LIMIT BANDWIDTH DISABLE Description Disables a bandwidth schedule without losing the schedule settings Syntax LIMIT BANDWIDTH DISABLE ON Options target—Name of the target, an IP address on the target, or a virtual IP address. Depending on the network route Storage Mirroring uses to access the target, you may need to specify the fully qualified domain name.
Limit Bandwidth Schedule Clear Command LIMIT BANDWIDTH SCHEDULE CLEAR Description Clears a bandwidth schedule Syntax LIMIT BANDWIDTH SCHEDULE CLEAR Options target—Name of the target, an IP address on the target, or a virtual IP address. Depending on the network route Storage Mirroring uses to access the target, you may need to specify the fully qualified domain name.
Limit Bandwidth Schedule Remove Command LIMIT BANDWIDTH SCHEDULE REMOVE Description Removes a scheduled bandwidth event Syntax LIMIT BANDWIDTH SCHEDULE REMOVE
Load System State Command LOAD SYSTEMSTATE Description Loads the Storage Mirroring system state module Syntax LOAD SYSTEMSTATE Options machine—Name of the machine Examples load systemstate beta Notes Machine names that contain non-alphanumeric characters should be enclosed in quotation marks.
Mirror Pause Command MIRROR PAUSE Description Pauses a mirror that is in progress Syntax MIRROR PAUSE Options con_id—Connection ID assigned to the source/target connection *—Specifies all connection IDs. mirror pause 1 mirror pause * Examples Mirror Resume Command MIRROR RESUME Description Resumes a paused mirror Syntax MIRROR RESUME Options con_id—Connection ID assigned to the source/target connection *—Specifies all connection IDs.
Mirror Start Command MIRROR START Description Initiates the mirror process Syntax MIRROR START [CLEAN | DIFFERENT [,NEWER] ,CHECKSUM | NOCHECKSUM] [ORPHANS |NOORPHANS] [CALCULATE | NOCALCULATE] [CLEARRESTOREREQUIRED] Options Examples Notes con_id—Connection ID assigned to the source/target connection CLEAN—Deletes all files in the specified target path prior to mirroring DIFFERENT—Mirrors only those files that are different based on the file date, time, and/or size NEWER—Mirr
Monitor Account Add Command MONITOR ACCOUNT ADD Description Identifies a user account with update permissions within Active Directory Syntax MONITOR ACCOUNT ADD [monitor] Options username—Name of the user in the format domain\user or user@domain password—Password associated with the user name monitor—Name of the source machine designated as the monitor Examples monitor account add administrator ***** alpha Notes The monitor account add command is not available
Monitor Create Command MONITOR CREATE Description Establishes a source as a failover monitor. This is the machine that will be monitored by a target in case it should experience a failure. Syntax MONITOR CREATE
Monitor Get Command MONITOR GET Description Displays the machines that are currently being monitored by the specified target machine Syntax MONITOR GET Options target—Name of the target, an IP address on the target, or a virtual IP address Examples monitor get beta Notes Monitor names that contain non-alphanumeric characters must be enclosed in quotation marks.
Monitor Move Command MONITOR MOVE Description Designates the IP address that will be failed over to the specified target NIC Syntax MONITOR MOVE TO NIC USE NONE | NETWORK INTERVAL TIMEOUT | SERVICE INTERVAL TIMEOUT | [monitor] Options IP_address—The IP address which should be moved during failover target_NIC—The integer value of the target NIC obtained from the niclist command NONE—Does not actively monitor the s
Monitor Option Command MONITOR OPTION Description Configures the settings to determine how failover will be performed Syntax MONITOR OPTION [MOVENAME | NOMOVENAME] [, MOVEADDRESSES | NOMOVEADDRESSES] [, MOVESHARES | NOMOVESHARES] [, ADD | REPLACE] [, USESHAREFILE | NOUSESHAREFILE][, FAILONE | FAILALL] [, FODELAY | NOFODELAY] [, FBDELAY | NOFBDELAY] [, APPLY | DISCARD | REVERT] [, INTERVENTION | NOINTERVENTION] [, FOHOSTNAME | NOFOHOSTNAME] [, FBHOSTNAME | NOFBHOSTNAME] [monitor] Options MOVENAME—
Examples Notes monitor option alpha monitor option nomoveshares, nousesharefile, failone, nointervention The default settings are movename, moveaddress, moveshares, add, usesharefile, failall, fodelay, fbdelay, apply, intervention, nofohostname, and nofbhostname. The options can be used in any combination and in any order. The first option does not require a comma, but the second and remaining options do require a comma before the option.
Notes If you do not specify a monitor, the current source designated as the monitor will be used. If you have not identified a monitor, you will receive an error message stating that a monitor has not been selected. Options that contain non-alphanumeric characters must be enclosed in quotation marks.
Monitor Stop Command MONITOR STOP Description Stops monitoring the source machine for a failure Syntax MONITOR STOP [ON ] Options monitor—Name of the source machine designated as the monitor target—Name of the target, an IP address on the target, or a virtual IP address Examples monitor stop alpha on beta Notes Option names that contain non-alphanumeric characters must be enclosed in quotation marks.
Orphans Enable Command ORPHANS ENABLE Description Enables orphan file removal during subsequent mirror or verification processes. Syntax ORPHANS ENABLE con_id Options con_id—Connection ID assigned to the source/target connection Examples orphans enable 1 Orphans Disable Command ORPHANS DISABLE Description Disables orphan file removal during subsequent mirror or verification processes.
Orphans Stop Command ORPHANS STOP Description Stops the process to remove orphan files on the target Syntax ORPHANS STOP con_id Options con_id—Connection ID assigned to the source/target connection Examples orphans stop 1 Pause Target Command PAUSETARGET Description Allows you to pause the execution of Storage Mirroring operations on the target Syntax PAUSETARGET [FROM
Queue Task Command QUEUETASK Description Queues tasks inline with replication data. Syntax QUEUETASK TO ONQUEUE = [args] | ONTRANSMIT = [args] | ONRECEIVE = [args] | ONEXECUTE = [args] [TIMEOUT = ] [INTERACT | NOINTERACT] Options job_name—Unique job name assigned to this task. This will be the identifier you see in the log target—Name of the target, an IP address on the target, or a virtual IP address. Depending on the files.
Notes The default setting for this command is nointeract. Any combination of one or more execution points can be used with the same queuetask command. All script processing messages, including errors, can be viewed in the Storage Mirroring logs and the Windows Event Viewer. Onqueue will still execute as soon as the task is placed on the queue even if transmission is stopped (manually stopped or paused, unmet scheduled transmission criteria, etc.).
Replication Stop Command REPLICATION STOP Description Stops the replication process Syntax REPLICATION STOP Options conid—Connection ID assigned to the source/target connection *—Specifies all connection IDs replication stop 1 replication stop * Examples Repset Calculate Command REPSET CALCULATE Description Calculates the size of a replication set Syntax REPSET CALCULATE [repset] Options repset—Name of the replication set Examples repset calculate DataFiles Not
Repset Delete Command REPSET DELETE Description Deletes the specified replication set Syntax REPSET DELETE Options repset—Name of the replication set Examples repset delete DataFiles Notes Replication set names that contain non-alphanumeric characters must be enclosed in quotation marks.
Repset Rule Add Command REPSET RULE ADD Description Adds a rule to a replication set. A rule is the specification of a path including volume, directories, wild cards, and/or file names.
Repset Use Command REPSET USE Description Specifies a replication set as the active replication set Syntax REPSET USE Options repset—Name of the replication set Examples repset use DataFiles Notes Replication set names that contain non-alphanumeric characters must be enclosed in quotation marks.
Notes The default settings for this command are overwrite, overwritenewer, usetargetdb, restoredbtoo, and noorphans. The options can be used in any combination and in any order. The first option does not require a comma, but the second and remaining options do require a comma before the option. The source command is required before each use of the restore command.
Schedule Disable Command SCHEDULE DISABLE Description Disables the transmission schedule without clearing the schedule data Syntax SCHEDULE DISABLE Options target—Name of the target, an IP address on the target, or a virtual IP address Depending on the network route Storage Mirroring uses to access the target, you may need to specify the fully qualified domain name.
Schedule End Command SCHEDULE END Description Sets criteria to end the transmission of data from the source to the target Syntax SCHEDULE END [ DURATION = ][ BYTES = ] Options target—Name of the target, an IP address on the target, or a virtual IP address Depending on the network route Storage Mirroring uses to access the target, you may need to specify the fully qualified domain name.
Schedule Window Command SCHEDULE WINDOW Description Sets criteria to only allow transmissions during a certain period of time Syntax SCHEDULE WINDOW TO Options target—Name of the target, an IP address on the target, or a virtual IP address Depending on the network route Storage Mirroring uses to access the target, you may need to specify the fully qualified domain name. hh:mm—Time in hour:minute format using the 24-hour clock.
Script Add Command SCRIPT ADD Description Specifies the scripts that should be run at a particular point-in-time during a process Syntax SCRIPT ADD [source] = [ARGS=arguments] [DELAY|NODELAY] [INTERACT|NOINTERACT] Options con_id—Connection ID assigned to the source/target connection source—Name of the source target—Name of the target, an IP address on the target, or a virtual IP address type—Any of the following script types MIRRORSTART—Process the
Script List Command SCRIPT LIST Description Displays a list of mirroring scripts Syntax SCRIPT LIST [source] [ON target] Options conid—Connection ID assigned to the source/target connection source—Name of the source machine target—Name of the target, an IP address on the target, or a virtual IP address Examples script list 1 alpha on beta Notes Machine names that contain non-alphanumeric characters must be enclosed in qutoation marks.
Script Test Command SCRIPT TEST Description Tests a mirroring script Syntax SCRIPT TEST [arguments] [INTERACT|NOINTERACT] Options machine—Name of the machine where you want to execute the script as a test path—Specify the full path and file name (including the file extension) to the mirroring script. Do not include arguments with the path, only the path and file name. Enclose the path in quotation marks.
Set Command SET Description Modifies the value of a Storage Mirroring program setting for the specified server Syntax SET
Shutdown Command SHUTDOWN Description Stops the Storage Mirroring service Syntax SHUTDOWN Options machine—Name of the machine Examples shutdown alpha Notes Machine names that contain non-alphanumeric characters must be enclosed in quotation marks.
Snapshot Delete Command SNAPSHOT DELETE Description Deletes the specified snapshot(s) from the target Syntax SNAPSHOT DELETE [ON ] Options con_id—Connection ID assigned to the source/target connection snapshot_list_number—The snapshot number retrieved from the SNAPSHOT LIST command ALL—Deletes all snapshots OLD—Deletes only the oldest snapshot GOOD—If specified, deletes only good snapshot.
Snapshot Revert Command SNAPSHOT REVERT Description Revert the target to the last good automatic snapshot Syntax SNAPSHOT REVERT [ON ] Options con_id—Connection ID assigned to the source/target connection target—Name of the target, an IP address on the target, or a virtual IP address Examples snapshot revert 1 Notes Target names that contain non-alphanumeric characters must be enclosed in quotation marks.
Snapshot Schedule Enable Command SNAPSHOT SCHEDULE ENABLE Description Enables a disabled snapshot schedule Syntax SNAPSHOT SCHEDULE ENABLE [ON ] Options con_id—Connection ID assigned to the source/target connection target—Name of the target, an IP address on the target, or a virtual IP address Examples snapshot schedule 1 enable Notes Target names that contain non-alphanumeric characters must be enclosed in qutoation marks.
StatsLog Start Command STATSLOG START Description Starts the DTStats statistics logging utility. Syntax STATSLOG START [TO ] [EVERY ] [MAXSIZE ] Options machine—Name of the machine filename—Any valid path and filename to which the statistical information will be logged minutes—The number of minutes to write to the log file kilobytes—The maximum file size in kilobytes Examples statslog start alpha to "dtstat.
Status Command STATUS Description Requests connection and statistical information Syntax STATUS BLOCK [ON ] | CONNECT | MIRROR | REPLICATE | TRANSMIT | TARGET Options Examples BLOCK—Displays whether replication set path on the specified target is being blocked target—Name of the target, an IP address on the target, or a virtual IP address CONNECT—Displays connection information for the connection ID specified MIRROR—Displays mirror
Test Connections Command TESTCONNECTIONS Description Sends a test command to determine if Storage Mirroring is running. If there are active connections, the replication set(s), IP address(es), and connection ID(s) will be included in the testcon log file. Syntax TESTCONNECTIONS [ filename [OVERWRITE]] Options machine—The name of the machine filename—The name of the log file. The file extension .dts is appended to any file name supplied.
Transmission Resume Command TRANSMISSION RESUME Description Resumes a paused transmission Syntax TRANSMISSION RESUME Options target—Name of the target, an IP address on the target, or a virtual IP address. Depending on the network route Storage Mirroring uses to access the target, you may need to specify the fully qualified domain name. Examples transmission resume beta Notes Target names that contain non-alphanumeric characters must be enclosed in quotation marks.
Unblock All Command UNBLOCK ALL Description Unblocks the replication set target paths that were previously blocked. Any process can now update data in the replication set target path.
Unload System State Command UNLOAD SYSTEMSTATE Description Unloads the Storage Mirroring system state module Syntax UNLOAD SYSTEMSTATE Options machine—Name of the machine Examples unload systemstate beta Notes Machine names that contain non-alphanumeric characters should be enclosed in quotation marks. Verify Command VERIFY Description Verifies the integrity of the data between the source and target machines.
Version Command VERSION Description Displays the Storage Mirroring version currently installed Syntax VERSION [MACHINE] Options MACHINE—Name of the machine Examples version alpha Notes If no machine name is specified, the version of the active source will be displayed. If there is no active source, no version information will be displayed. Machine names that contain non-alpanumeric characters must be enclosed in quotation marks.
Wait on Restore Command WAITONRESTORE Description This command is used in scripts to force the script to stop executing until the connection has finished restoring. Syntax WAITONRESTORE Options rest_id—Restoration ID assigned to the source/target connection Examples waitonrestore 1 Notes This command requires using the source command immediately before the waitonrestore command.
14 X Scripting Examples Scripting Examples This chapter contains sample Storage Mirroring scripts. Most of the sample scripts must be modified. They cannot be used as-is. Modify them to fit your environment. If you need basic assistance with script modifications, contact Technical Support. Assistance with advanced scripting will be referred to Professional Services. NOTE: See Storage Mirroring scripts on page 2-3 for information on using Storage Mirroring scripts.
Using variables to create and connect a replication set and run verification The following script uses variables to identify the source, target, and replication set. These variables are then used in the Storage Mirroring commands. The $connectionID variable will contain the connection ID for the connection established. This variable can then be used to establish a verification schedule.
Using variables to pause a target The following script uses variables to identify the target and credentials to login to that target. These variables are then used in the Storage Mirroring commands to pause the target. $TheTarget = "beta"; $TheUser = "admin"; $ThePassword = "password"; $TheDomain = "domain.
Creating a backup or snapshot of the target by inserting a task command during replication The following script stops the services on the source, pauses the script to allow the source time to write the remaining application data to disk, inserts a Storage Mirroring task command into the Storage Mirroring replication process, and then restarts the services. REM net net net net Stop the services on the source so that data changes are stopped.
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.
Index A O audience 1-1 orphan files 7-12 B Q bandwidth limitations 8-7 batch files 2-3 queuing 7-18 R C replication starting 7-8 tasks 7-9 replication set creating 4-1, 5-1 deleting 6-4 modifying 6-1 size 6-5 resources 1-2 restoration 10-1 Command Line Client 2-2 commands 13-1 comments 2-3 compression 7-11 connection automatic reconnections 7-18 choosing connection type 3-1 creating 4-3 disconnecting 7-19 monitoring 7-2 simulating 5-3 types 3-1 conventions 1-1 S failback 11-1 failover configuri