Yes, we can unlink and relink again a dsource to move it from a primary to a standby, from a standby to a primary or from a standby to a standby. Process is very simple:
In this example I am going to unlink and relink a database called orcl:
We can unlink from GUI but we must relink from CLI.
To unlink we just click on the icon on the lower right corner and after that we will see the dsource this way:
Now that the source is unlinked let’s link it again.
You have to connect to the DE using a user with delphix_admin rights to do this.
Here are the commands to relink this again:
Diegos-MBP:~ dloureda$ ssh delphix_admin@172.16.180.167
Password:
Last login: Tue Oct 13 18:27:27 2015 from 172.16.180.1
LandsharkEngine> database
LandsharkEngine database> select orcl
LandsharkEngine database 'orcl'> attachSource
LandsharkEngine database 'orcl' attachSource *> set source.name=orcl
LandsharkEngine database 'orcl' attachSource *> set source.config=orcl
LandsharkEngine database 'orcl' attachSource *> set environmentUser=LINUXSOURCE/delphix
LandsharkEngine database 'orcl' attachSource *> set dbUser=delphixdb
LandsharkEngine database 'orcl' attachSource *> set dbCredentials.password=delphixdb
LandsharkEngine database 'orcl' attachSource *> edit source.operations.preSync
LandsharkEngine database 'orcl' attachSource source.operations.preSync *> back
LandsharkEngine database 'orcl' attachSource *> edit source.operations.postSync
LandsharkEngine database 'orcl' attachSource source.operations.postSync *> back
LandsharkEngine database 'orcl' attachSource *> commit
ORACLE_DB_CONTAINER-1
Dispatched job JOB-706
DB_ATTACH_SOURCE job started for "Sources/orcl".
Obtaining information from source database "Sources/orcl".
Creating new TimeFlow for dSource "Sources/orcl".
The dSource "orcl" was successfully linked from source database "Sources/orcl".
DB_ATTACH_SOURCE job for "Sources/orcl" completed successfully.
LandsharkEngine database 'orcl'>
This is what we did:
- Connect to the DE
- Select database name that we want to reattach
- execute the attach command (attachSource)
- set name and config name (normally the same)
- set environment user. Here is where we tell Delphix in which host and what is the user name it will be using from now on
- set os and db users to be used
- Even though they may be blank, like in this case, we need to set up the presync and postsync operations
- Commit changes
Hope this helps
Diego