Skip to main content
Skip table of contents

CLI cookbook: detaching and attaching a SQL server dSource

This topic describes how to detach and attach a SQL server dSource. When attaching a SQL Server dSource to a new data source, the new data source must be in the same database satisfying the following constraints:

  • pptRepository needs to be set to the name of the SQL instance on the staging server. The unlink operation removes the database from the SQL instance on the staging server and unmounts the iscsi luns, reattaching the dSource via the CLI will remount the iscsi luns and puts the database back.

Prerequisites

A dSource can only be attached to a new data source once it has been unlinked.

Procedure

  1. Select dSource.

    CODE
    delphix> database "dexample"
  2. Run the detachSourcecommand, specifying the current active source. This step can be skipped if the dSource has already been detached. through the GUI.  

    CODE
    delphix database "dexample"> detachSource
    delphix database "dexample" detachSource *> set source=dexample
    delphix database "dexample" detachSource *> commit
  3. Run the attachSource command.

    CODE
    delphix database "dexample"> attachSource
  4. Set the following for SQL Server: You can also type help pptRepository to see what is wanted You can also set pptRepository=<then press tab> to list all values.

    CODE
    delphix database "dexample" attachSource *> edit attachData
    delphix database "dexample" attachSource attachData *> set type=MSSqlAttachData
    delphix database "dexample" attachSource attachData *> set config=SQLSERVER/dexample
    delphix database "dexample" attachSource attachData *> set sharedBackupLocations="<\\SERVER1\Backups>"
    delphix database "dexample" attachSource attachData *> set pptRepository=SQL2008R2
    delphix database "dexample" attachSource attachData *> set mssqlUser.type=MSSqlDomainUser
    delphix database "dexample" attachSource attachData *> set mssqlUser.user=ad\dbuser
    delphix database "dexample" attachSource attachData *> set mssqlUser.password.password=dbuserpwd
    delphix database "dexample" attachSource attachData *> edit ingestionStrategy
    delphix database "dexample" attachSource attachData ingestionStrategy *>set type=ExternalBackupIngestionStrategy
    delphix database "dexample" attachSource attachData ingestionStrategy *>set validatedSyncMode=TRANSACTION_LOG
    delphix database "dexample" attachSource attachData ingestionStrategy *> back
    delphix database "dexample" attachSource attachData *> edit operations.preSync
    delphix database "dexample" attachSource attachData  operations.preSync *> back
    delphix database "dexample" attachSource attachData*> edit operations.postSync
    delphix database "dexample" attachSource attachData operations.postSync *> back
  5. Commit the operation.

    CODE
    delphix database "dexample" attachSource *> commit



JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.