CLI cookbook: rolling forward a VDB
This topic describes how to roll forward a virtual database after it has been rewound, as described in Provisioning and Managing Virtual Databases.
Once a VDB has rewound to a specific TimeFlow point, the snapshots of its previous states are still available in Delphix Engine storage and are accessed via the command-line interface to restore those previous states. This is referred to as "rolling forward" a VDB.
Procedure
Use the
ls
command to find the VDB you want to roll forward. In this example, the TimeFlows and their associated containers are listed. The VDB calledPVDB
will be the one to roll forward.ACTIONSCRIPT3delphix timeflow> ls Objects NAME CONTAINER PARENTPOINT.TIMEFLOW PARENTPOINT.LOCATION PARENTPOINT.TIMESTAMP hrprod/default hrprod - - - erpprod/default erpprod - - - 'DB_PROVISION@2013-11-25T17:37:06' PVDB erpprod/default 657925 - 'DB_ROLLBACK@2013-11-25T18:24:16' PVDB 'DB_PROVISION@2013-11-25T17:37:06' 678552
Use the
Select
command to select the database.ACTIONSCRIPT3delphix database> select PVDB
Use the
rollback
command to roll forward the VDB.ACTIONSCRIPT3delphix database "PVDB"> rollback
Use the
ls
command to display options for selecting TimeFlow parameters.CODEdelphix database "PVDB" rollback *> ls Properties type: OracleRollbackParameters credential: (unset) timeflowPointParameters: type: TimeflowPointSemantic container: (required) location: LATEST_POINT username: (unset)
Because this VDB was rolled back, two TimeFlows now exist for it. To rollback the VDB and roll it forward, select the original TimeFlow, because the original snapshots are associated with that TimeFlow.
ACTIONSCRIPT3delphix database "PVDB" rollback *> set timeflowPointParameters.type=TimeflowPointLocation delphix database "PVDB" rollback *> set timeflowPointParameters.timeflow='DB_PROVISION@2013-11-25T17:37:06'
Use the
ls
command to view the parameter options for the TimeFlow you selected.CODEdelphix database "PVDB" rollback *> ls Properties type: OracleRollbackParameters credential: (unset) timeflowPointParameters: type: TimeflowPointLocation (*) location: LATEST_POINT timeflow: 'DB_PROVISION@2013-11-25T17:37:06' (*) username: (unset)
Set the TimeFlow location to rollback the VDB to a particular Oracle SCN.
CODEdelphix database "PVDB" rollback *> set timeflowPointParameters.location=678994
Use the
ls
command to review all the options you selected before executing the commit.CODEdelphix database "PVDB" rollback *> ls Properties type: OracleRollbackParameters credential: (unset) timeflowPointParameters: type: TimeflowPointLocation (*) location: 678994 (*) timeflow: 'DB_PROVISION@2013-11-25T17:37:06' (*) username: (unset)
Commit
the changes.ACTIONSCRIPT3delphix database "PVDB" rollback *> commit Dispatched job JOB-369 DB_ROLLBACK job started for "ERP/PVDB". Starting provision of the virtual database "PVDB". Creating new TimeFlow. Generating recovery scripts. Exporting storage. Validating user environment settings on target host. Mounting filesystems for the virtual database instance "1". Mounting read-only archive log filesystem for the virtual database instance "1". Running user-specified pre-provisioning script. Recovering Oracle database. Opening the virtual database "PVDB". Opening Oracle database. Oracle recovery was successful. Unmounting read-only archive log filesystem for the virtual database instance "1". Running user-specified post-provisioning script. The virtual database "PVDB" was successfully provisioned. Starting snapshot of virtual database. Processing database files of virtual database. Creating snapshot of virtual database. Finalizing snapshot of virtual database. Virtual database "PVDB" snapshot successful. DB_ROLLBACK job for "ERP/PVDB" completed successfully.