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
Select dSource.
CODEdelphix> database "dexample"
Run the detachSourcecommand, specifying the current active source. This step can be skipped if the dSource has already been detached. through the GUI.
CODEdelphix database "dexample"> detachSourcedelphix database "dexample" detachSource *> set source=dexampledelphix database "dexample" detachSource *> commit
Run the
attachSource
command.CODEdelphix database "dexample"> attachSource
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.
CODEdelphix database "dexample" attachSource *> edit attachDatadelphix database "dexample" attachSource attachData *> set type=MSSqlAttachDatadelphix database "dexample" attachSource attachData *> set config=SQLSERVER/dexampledelphix database "dexample" attachSource attachData *> set sharedBackupLocations="<\\SERVER1\Backups>"delphix database "dexample" attachSource attachData *> set pptRepository=SQL2008R2delphix database "dexample" attachSource attachData *> set mssqlUser.type=MSSqlDomainUserdelphix database "dexample" attachSource attachData *> set mssqlUser.user=ad\dbuserdelphix database "dexample" attachSource attachData *> set mssqlUser.password.password=dbuserpwddelphix database "dexample" attachSource attachData *> edit ingestionStrategydelphix database "dexample" attachSource attachData ingestionStrategy *>set type=ExternalBackupIngestionStrategydelphix database "dexample" attachSource attachData ingestionStrategy *>set validatedSyncMode=TRANSACTION_LOGdelphix database "dexample" attachSource attachData ingestionStrategy *> backdelphix database "dexample" attachSource attachData *> edit operations.preSyncdelphix database "dexample" attachSource attachData operations.preSync *> backdelphix database "dexample" attachSource attachData*> edit operations.postSyncdelphix database "dexample" attachSource attachData operations.postSync *> back
Commit the operation.
CODEdelphix database "dexample" attachSource *> commit