Undoing an Accidental Virtual Database (VDB) Refresh (KBA1013)
Troubleshooting an Accidental Virtual Database Refresh
An accidental refresh of one or more virtual databases (VDBs) from a source database has removed important data. The option to undo a refresh is available via both the Delphix Engine User Interface and CLI.
Undoing a Refresh using the GUI
- Select the VDB card
- Select the back of the VDB card,
- Undo the refresh using the "backward pointing arrow" on the back of the VDB card. This is the fourth icon in from the bottom right-hand corner. Clicking on this icon will undo the last VDB refresh.
Undoing a Refresh using the CLI
-
Log into the Delphix Engine.
ssh delphix_admin@delphix_engine
-
List Timeflows for the database to which you want to rollback.
de > ls de > Timeflow de Timeflow > ls
-
Switch to the VDB you want to rollback.
de Timeflow > cd /database de database > ls de database > select "vdb_example"
-
Use the
switchTimeflow
operation.de database 'vdb_example' > switchTimeflow de database 'vdb_example' switchTimeflow *> set Timeflow=<different Timeflow> de database 'vdb_example' switchTimeflow *> commit
A Timeflow is a branch of changes from the original source data that the VDB was provisioned from. This branch is the placeholder or container for Snapshots that have been created (by policy or manually). Each time a VDB is refreshed or provisioned, a new Timeflow is created.
The problem of ambiguity occurs when a Snapshot fails immediately following a refresh operation. The result is an inability to "undo" because there is no mapping to the previous Timeflow.
Example
The following example attempts to undo a refresh of the VDB "myVDB" has failed.
Troubleshooting error: "The selected database "myVDB" does not have a valid previous Timeflow."
Workaround: Consider using swittchTimeflow to manually choose a Timeflow for the database.
Steps leading to failure:
de> database de database> de database> select myVDB de database 'myVDB'> de database 'myVDB'> undo de database 'myVDB' undo *> commit Error: The selected database "myVDB" does not have a valid previous Timeflow. Action: Consider using switchTimeflow to manually choose a Timeflow for the database. de database 'myVDB' undo *> discard
Resolution
Check if there is a Timeflow available to which you can rollback. This will be something other than the container listed as "DB_PROVISION". The timestamp of the DB_REFRESH container represents the point in time when the Timeflow was created, not the end point in time for the last Snapshot in that Timeflow which will be more recent:
de > cd /Timeflow de Timeflow> list database='myVDB' NAME CONTAINER PARENTPOINT.Timeflow PARENTPOINT.LOCATION PARENTPOINT.TIMESTAMP 'DB_REFRESH@2016-02-01T03:00:41' myVDB default 2622919 - 'DB_REFRESH@2016-08-28T13:00:32' myVDB default 2622919 - 'DB_PROVISION@2016-08-28T17:34:36' myVDB default 2622730 -
Once the target Timeflow is established, switch to that Timeflow.
de> database de database> de database> select myVDB de database 'myVDB'> switchTimeflow de database 'myVDB' switchTimeflow *> ls Properties type: SwitchTimeflowParameters Timeflow: (required) de database 'myVDB' switchTimeflow *> set Timeflow='DB_PROVISION@2016-08-28T15:34:36' de database 'myVDB' switchTimeflow *> commit Dispatched job JOB-29 DB_SWITCH_Timeflow job started for "Untitled/myVDB". Starting disable of virtual database. Unexporting storage. Virtual database successfully disabled. Enabling dataset "myVDB". Exporting storage containers from the Delphix Engine. Mounting datasets. Starting virtual database. Virtual database "myVDB" was successfully started. Dataset "myVDB" enabled. DB_SWITCH_Timeflow job for "Untitled/myVDB" completed successfully.