CLI cookbook: detaching and attaching a SAP ASE dSource
This CLI cookbook recipe describes how to Detach and Attach an SAP ASE dSource using the CLI.
Prerequisites
A dSource can only be attached to a new data source once it has been unlinked.
When attaching an SAP ASE dSource to a new data source, the new data source must be the same logical database satisfying the following constraints:
Same dbid
Same dbname
Same creation time
You must also make sure that you follow the normal prerequisites for an SAP ASE data source found in SAP ASE Support and Requirements.
Procedure
Detach a dSource
Login to the CLI as admin or a user with Admin privileges.
Select dSource.
CODEdelphix> database "dexample"
Run the
detachSourcecommand
, specifying the currently active source. Note: 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
Attach a dSource
Login to the CLI as admin or a user with Admin privileges.
Run the
attachSource
command.CODEdelphix database "dexample"> attachSourcedelphix database "dexample" attachSource *> set attachData.config=dexampledelphix database "dexample" attachSource *> set attachData.dbCredentials.password=sybasedelphix database "dexample" attachSource *> set attachData.dbUser=sadelphix database "dexample" attachSource *> set attachData.loadBackupPath=/tmp/backupsdelphix database "dexample" attachSource *> set attachData.sourceHostUser="source_host_environment/sybase"delphix database "dexample" attachSource *> set attachData.stagingHostUser="staging_host_environment/sybase"delphix database "dexample" attachSource *> set attachData.stagingRepository="staging_ASE_servername_example"delphix database "dexample" attachSource *> lsProperties type: ASEAttachSourceParameters attachData: type: ASEAttachData config: dexample (*) dbCredentials: type: PasswordCredential password: ******** (*) dbUser: sa (*) dumpCredentials: (unset) externalFilePath: (unset) loadBackupPath: /tmp/backups (*) loadLocation: (unset) mountBase: (unset) operations: (unset) sourceHostUser: source_ASE_servername_example/sybase (*) stagingHostUser: staging_ASE_servername_example/sybase (*) stagingPostScript: (unset) stagingPreScript: (unset) stagingRepository: staging_ASE_servername_example (*) validatedSyncMode: ENABLED delphix database "dexample" attachSource *> commit ASE_DB_CONTAINER-3 Dispatched job JOB-25 DB_ATTACH_SOURCE job started for "Untitled/dexample". DB_ATTACH_SOURCE job for "Untitled/dexample" completed successfully.
This command is only necessary if you are using a Remote Backup Server configuration from staging to the source, instead of an NFS mounted shared directory for backups and transaction log dumps:
delphix database "dexample" attachSource *> set attachData.loadLocation.backupServerName=source_backupserver_name_example