Skip to main content

How to Provision a virtual Primary and Standby pair from an Oracle dSource

Delphix currently does not support direct provisioning of an Oracle Virtual Primary and Standby database pair. However, there are straightforward steps you can do to achieve that easily. Below outlines an example of how you can take an already linked dSource and quickly provision a virtual Primary and Standby database pair.

Essentially, you can use the same idea to create more than one standby database to mimic your complete production database Data Guard configuration. Some customers find this useful for the purpose of testing various Data Guard features such as switchover or failover; others have existing applications that run on their Data Guard configuration and this capability will allow them to test their application against real production data in a virtualize Data Guard configuration environment. 


  1. Discover source environment

  2. Discover target environment 

  3. Link dSource from Source Environment


  1. Provision a virtual database (VDB) into Target Environment (this will be known as the "primary VDB")

    1. dbuniquename=primary

    2. sid=primary

    3. databasename=hr

  2. Provision a VDB **from primary VDB**, to the Target Environment,

     **UNCHECK GUI Provision VDB page, ‘Open Database After Provision’ checkbox**, with:

    1. dbuniquename=standby

    2. sid=standby

    3. databasename=hr

  3. Login to Target

    1. Set ORACLE_SID=primary, sqlplus / as sysdba,

    2. check init parameter REMOTE_LOGIN_PASSWORDFILE is ‘EXCLUSIVE’

  4. Create password file on ‘primary’ 

    1. orapwd file=$ORACLE_HOME/dbs/orapwprimary entries=10 

    2. enter password for SYS when prompted.

  5. Copy primary password file to standby 

    1. cp $ORACLE_HOME/dbs/orapwprimary $ORACLE_HOME/dbs/orapwstandby


Continue steps below in the order as shown, alternating between ‘primary’ and ‘standby’ database as needed.



On ‘primary’ (export ORACLE_SID=’primary’)

On ‘standby’  (export ORACLE_SID=’standby’)




SQL> show parameter control_files;

Write down controlfile name: /mnt/provision/standby/datafile/datafile/dbdhcp3/oradata/dbdhcp3/control01.ctl


SQL> select group#,bytes from v$log;


Get online log file # of group (groupNumber), as well as size of online log (logfileSize)



SQL> shutdown abort;



SQL> alter database create standby controlfile as '/mnt/provision/standby/datafile/datafile/dbdhcp3/oradata/dbdhcp3/control01.ctl’ reuse;


Create standby controlfile from primary VDB, overwrite standby VDB controlfile using ‘REUSE’



SQL> startup mount




SQL> alter system set db_file_name_convert='/mnt/provision/primary','/mnt/privision/standby' scope=spfile;

SQL>  alter system set log_file_name_convert='/mnt/provision/primary','/mnt/privision/standby' scope=spfile;

SQL> shutdown abort;

SQL> startup mount;


Rename db and log file



SQL> alter database add standby logfile size <logfileSize>;

Create standby redo logfile, using values from step 2 above, repeat <groupNumber+1> # of times to create <groupNumber+1> standby redo logfiles


SQL> alter system set log_archive_config='DG_CONFIG=(primary,standby)' scope=both;

SQL> alter system set log_archive_config='DG_CONFIG=(primary,standby)' scope=both;

Set log_archive_config parameter


SQL> alter system set log_archive_dest_2='service="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(", LGWR ASYNC NOAFFIRM reopen=60 db_unique_name="standby" ' scope=both;


Set up Data Guard log transport from primary to standby


SQL> alter system set log_archive_dest_state_2='ENABLE’;



SQL> select dest_id, error,status, db_unique_name from v$archive_dest_status where dest_id=2;


Check for error in DG log transport. If it status=VALID, you are good to go. If not, check the error message.


SQL> alter system archive log current;

SQL>recover managed standby database disconnect using current logfile;

Make sure standby can recover logs from primary. Tail standby alert log to find out it is recovering. Switch log out of primary if standby is not recovering.



SQL> recover managed standby database cancel;

SQL> alter database open read only;

SQL> recover managed standby database disconnect using current logfile;

Optional (if want to run Active Data Guard)



  1. If ALTER DATABASE OPEN READ ONLY in step 13 results in alert log message on standby, saying “FAL[client]: Error fetching gap sequence, no FAL server specified”, you can kick out logs from primary by ‘ALTER SYSTEM ARCHIVE LOG CURRENT’. You can also set up init ora parameter FAL_SERVER on standby as - alter system set fal_server='(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(’;

  2. The standby VDB is not known to Delphix as a standby database, but rather a database that Delphix will not OPEN with a backup control file. What this means is, after your virtual Primary and virtual Standby are running properly, you can use the GUI to start/stop/enable/disable the Standby VDB. However, Delphix will only start the standby VDB to MOUNT state. You will need to follow up to either OPEN READ ONLY and start MANAGED RECOVERY yourself, or just start MANAGED RECOVERY, depending on what you want to run on your standby database.

  3. Right after you restart your standby VDB using Delphix, it may take a short while for the standby database to register with the listener. Before that happens, the log transport from primary shipping logs to the standby may see errors. These should clear up after a short time.