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"> detachSource delphix database "dexample" detachSource *> set source=dexample delphix 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 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
Commit the operation.
CODEdelphix database "dexample" attachSource *> commit