CLI cookbook: detaching and attaching an Oracle dSource
This topic describes how to attach a dSource to a different data source.
Prerequisites
Before detaching an Oracle dSource, you must capture the following RMAN configuration:
-
Level or SCN based backups
-
Data load channel settings: number of channels and files per channel
The above RMAN configuration will be removed once the dSource is unlinked.
A dSource can only be attached to a new data source once it has been unlinked.
When attaching an Oracle 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
-
Same resetlogs SCN
-
Same resetlogs time
-
Same redo stream, where a log must exist with
-
Same sequence
-
Same thread
-
Same end SCN
-
For Oracle dSources, this procedure can be used to initially link from a standby server that is faster or less disruptive, unlink the dSource, and then attach it to the production server for subsequent incremental SnapSync operations. When you perform the attach operation, you will need the source config name of an unlinked database.
Procedure
-
Select dSource.
Copydelphix> database "dexample"
-
Run the
detachSource
command, specifying the currently active source. This step can be skipped if the dSource has already been detached through the GUI.Copydelphix database "dexample"> detachSource
delphix database "dexample" detachSource *> set source=name-of-old-src-DB-server
delphix database "dexample" detachSource *> commit -
Run the
attachSource
command.Copydelphix database "dexample"> attachSource
-
Set the config to point to an unlinked source. The following is an example to attach to an Oracle data source:
Use <TAB> to complete variable names and known values.Copydelphix database "dexample" attachSource *> set attachData.type=OracleAttachData
delphix database "dexample" attachSource *> set attachData.config=name-of-dSource-as-shown-in-environment
delphix database "dexample" attachSource *> set attachData.environmentUser=myuser
delphix database "dexample" attachSource *> set attachData.oracleFallbackUser=orauser
delphix database "dexample" attachSource *> edit attachData.oracleFallbackCredentials
delphix database "dexample" attachSource *> set attachData.force=true
delphix database "dexample" attachSource *> set set type=PasswordCredential
delphix database "dexample" attachSource *> set password=orauserpwd -
The attachData.config listing can be observed in the administration GUI, under Manage (pull-down at the top) --> Environments --> choose your dSource --> select Databases (upper right).
The dSources shown on the new source DB server may acquire odd names eg. "P02:UNKNOWN:vwxyz". These are a side-effect of having multiple instances of the same container name (possible in DR); Delphix needs to disambiguate. If these do show, they indicate containers in the new environment. Successfully attaching to these and deleting the old environment will re-establish the original names.
Copydelphix database "dexample" attachSource *> commit