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.
In the GUI
1. Select the VDB card
2. Select the back of the VDB card,
3. 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.
In the CLI:
Log into the Delphix Engine
List Timeflows for the database that you want to rollback to
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"
de database 'vdb_example' > switchTimeflow de database 'vdb_example' switchTimeflow *> set Timeflow=<different Timeflow> de database 'vdb_example' switchTimeflow *> commit
Note that the undo option will remain greyed out when there isn't a valid previous Timeflow available or ambiguity relating to which Timeflow to rollback to.
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.
This 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.
In the following example an attempt to undo a refresh of the VDB "myVDB" has failed:
Error: The selected database "myVDB" does not have a valid previous Timeflow. Action: Consider using switchTimeflow 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
Check if there is a Timeflow available to rollback to. 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. Note there is no limitation on switching Timeflows. It is possible to change to a different Timeflow following the initial Timeflow switch.
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.