This CLI cookbook recipe describes how to Detach and Attach an SAP ASE dSource using the CLI, please note that you cannot detach a dSource from the GUI or the CLI however reattach is strictly through 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 Requirements for SAP ASE Source Hosts and Databases.

Procedure

Detach a dSource

1. Login to the CLI as delphix_admin or a user with Admin privileges.
2. Select the dSource.


delphix> database "dexample"


3. Run the detachSourcecommand, specifying the currently active source.  Note: This step can be skipped if the dSource has already been detached through the GUI.


delphix database "dexample"> detachSource
delphix database "dexample" detachSource *> set source=dexample
delphix database "dexample" detachSource *> commit

Attach a dSource

1. Log into the CLI as delphix_admin or a user with Admin privileges.

2. Run the attachSource command.


delphix database "dexample"> attachSource
delphix database "dexample" attachSource *> set attachData.config=dexample
delphix database "dexample" attachSource *> set attachData.dbCredentials.password=sybase 
delphix database "dexample" attachSource *> set attachData.dbUser=sa 
delphix database "dexample" attachSource *> set attachData.loadBackupPath=/tmp/backups 
delphix 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 *> ls 
Properties
 
    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.

Note: this command is only necessary if you are using a Remote Backup Server configuration from staging to 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