Skip to main content
Delphix

How to Provision a Virtual Database (VDB) Using Archive Logs Not Captured by Delphix (KBA1398)

 

 

Issue

Provisioning a VDB using external archive logs may be useful in the following situations:

  • LogSync is not enabled for a dSource, but user has a once-off requirement for point-in-time provisioning.
  • Need to perform point-in-time provisioning, but the archive logs for the dSource have been removed from the Delphix Engine due to configured Retention Policies.
  • Experienced a failure in dSource, and some archive logs leading up to the failure were not collected by the Delphix Engine.

In all of the above cases, the user will need to have access to the necessary archive logs to recover from the Snapshot in the Delphix Engine that is closest to (but not after) the point in time that the user would like to recover to.

This process is not appropriate if archive logs are missing from an existing dSource with LogSync enabled. In this situation, Delphix should raise a Fault. Knowledge Base article KBA1406 How to Resolve Error: "Cannot provision a database from a portion of TimeFlow" has more information on the causes and resolution of this fault.

This process is not officially supported by Delphix and any issues following the completion of the "Provision VDB" operation should be referred to your Database Administration team, or Oracle Support, as appropriate.

 

Resolution

To perform this recovery, the user must:

  • Provision the VDB without opening the database;
  • Complete recovery using the external archive logs; and then
  • Initiate a snapshot operation from Delphix

Provision the VDB without opening the database

In order to leave the database in a state where further archive logs can be applied, the user must configure the provisioning operation such that the Delphix Engine does not issue a RESETLOGS command:

Provisioning from the Delphix GUI

During the first step of the "Provision VDB" wizard, use the "Advanced" button to open the Advanced dialog.

Once the advanced options have expanded, deselect the "Open Database After Provision" option, as follows:

image2016-10-28 11-7-40.png

Provisioning from the CLI

If provisioning from the CLI or API, the openResetlogs property should be set to false.

With the exception of this step, provisioning can be completed as normal.

After provisioning a database without "Open Database After Provision" set, Delphix will not take an initial snapshot and may raise faults for the VDB. This is because the database is not open and available for monitoring. These faults can be ignored until the userhave finished recovery of your VDB.

Make archive logs available to the Target

The archive logs from the dSource need to be available on the target environment, how this is done is up to the user, some possibilities would be to mount them via NFS or copy the archive logs directly from the dSource to a directory on the target host. The archive logs must be readable by the Oracle user.

Once the archive logs are available on the target host, the user can catalog the archive logs with RMAN to assist in the recovery.

RMAN>catalog start with /path/to/archive/logs' noprompt;

Complete database recovery

Following the Provision operation, the VDB should be in a mounted state.

Complete recovery to the required point using standard Oracle recovery commands. For example, to complete recovery to the latest available point in time.

SQL> recover database using backup controlfile until cancel;

This will prompt the user to recover each archive log sequence. The user can step through these by pressing the Return/Enter key, specifying CANCEL once the user has reached the desired sequence.

Alternatively, the user can respond with AUTO to apply all available archive logs. If the user uses AUTO, it may be necessary to repeat the command and then select the CANCEL option to finalise recovery.

SQL> recover database using backup controlfile until cancel;
ORA-00279: change 8622196 generated at 10/22/2016 12:49:15 needed for thread 1
ORA-00289: suggestion : /mnt/provision/Vdb1/archive/1_2722_913820877.dbf
ORA-00280: change 8622196 for thread 1 is in sequence #2722

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

 

Once the user has recovered to the required point, the database can be opened:

SQL> alter database open resetlogs;

Take a Delphix Snapshot

To allow normal operation of the VDB from Delphix (e.g. to allow Disable, Enable, and Provision operations), a Snapshot must be taken once the database has been brought online.

The user can initiate this operation using the Snapshot icon on the VDB's card: image2016-10-28 11-25-9.png

At this point, the database should be available for use as normal.

Any Faults raised by Delphix for the VDB should clear within a few minutes.

 

Recovering through an Oracle upgrade

In some failure conditions, it may be necessary to recover a database using logs that span an upgrade of Oracle (e.g. 11g to 12c).

This requires some additional steps:

  • The initial VDB should be provisioned to a Target Instance which matches the version of the snapshot (e.g. an 11g snapshot should be provisioned to an 11g target), with the "Open Database After Provision" option deselected as shown above
  • An Oracle home for the upgraded version (e.g. 12c) should also be available on the same Target server
  • The VDB should be shutdown with a "shutdown immediate" command after provisioning
  • The parameter file and oratab for the VDB should be modified to suit the new Oracle home
  • Use the Oracle home of the new version to complete recovery
  • Once the user has completed recovery, use the "Upgrade Database" on the VDB's card so that it is identified with the correct Oracle version

Please note that if the database type has changed to 12c Multi-Tenant from an earlier version, it will not be possible to perform this recovery.

Additional Information

Please note that all steps following the VDB Provisioning operation involve Oracle Recovery and are not directly related to Delphix. Queries related to RMAN and Oracle recovery should be directed to Oracle support as appropriate.

External Links 

RMAN CATALOG Command (Oracle 11g documentation)

Maintaining RMAN Backups and Repository Records (Oracle 11g documentation)

Performing User-Managed Recovery: Advanced Scenarios (Oracle 11g documentation)