Undoing an Accidental Virtual Database (VDB) Refresh (KBA1013)
KBA
KBA#How to Reverse an Accidental Virtual Database Refresh
An accidental refresh of one or more virtual databases (VDBs) from a source database has removed essential data. The option to undo a refresh is available through the Continuous Data Engine User Interface and CLI.
Undoing a Refresh using the GUI
Method 1 - The 'Undo Refresh or Rewind' Option
- In the GUI, navigate to the three dots top right of the VDB.
- Select Undo Refresh or Rewind.
- Then click Undo.
- Delphix will Undo the Refresh back to the previous time flow.
Method 2 - Rewinding the VDB to a previous snapshot
- Select the VDB from Manage > Datasets.
- Undo the refresh by clicking on a previous snapshot in the timeflow, you will see two left-pointing arrows, that is the rewind symbol.
Clicking on the two << rewind arrows will bring up the following confirmation modal. Click Rewind to confirm.
- You can see the rollback job in progress notification in the upper-right Actions pane.
- When the rollback completes, you will see the rewind buttons are no longer active, meaning the rollback is complete.
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.