Creating an Instant Clone for SQL Server Using the Command Line Interface

Use XML to create SQL Server instant clones. Run the operation from the command line, or automate configuration by combining operations in a script.

You can include the XML parameters in the xml file, or you can specify them on the command line when they frequently change. For more information on command line parameters and XML elements, see Command Line - Syntax.

Procedure

  1. On the SQL Server Agent host, run the qlogin command to log on to the CommServe computer.

  2. Download the CreateInstantClone_Template.xml file to the computer where you will run the command.

  3. Open the CreateInstantClone_Template.xml file, do the following:

    1. Locate the following section and edit it as per your setup:

      <device>|DB1|#12!DB1_rename|#12!DB1|#12! E:\RestoreLocation\DB1.mdf|#12!C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\DB1.mdf </device>
       <device>|DB1|#12!DB1_rename|#12!DB1_log|#12! E:\RestoreLocation\DB1_log.ldf|#12!C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\DB1_log.ldf </device>
      

      Where:

      • DB1 is the backed up database name.

      • DB1_Rename is the database name you want to provide for the restored database.

      • DB1 and DB1_log are the Logical Names of the backed up database.

      • E:\RestoreLocation is the destination path where you want to restore the database.

      • C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA is the source location of the backed up database.

    2. Add other specific parameters that you need, and then save the file.

  4. On the command line, go to Software_Installation_Directory/Base, and then run the following command.

    qoperation execute -af CreateInstantClone_Template.xml -instanceName 'Name of the instance' -appName 'SQL Server' -clientName 'Name of the client' -browseJobId 'Full backup job ID' -database 'Name of the destination database' -restoreSource 'Source database name' -overWrite 'Boolean value to overwrite database' -cloneResrvTimePeriod 'Expiry time' -commonMountPath 'Snap mount location'
  5. Run the qlogout command to log off the CommServe computer.

Page contents

×

Loading...