From earlier, the RESTFul URL for a virtual database refresh will look like:
http://<delphix_engine>/resources/json/delphix/database/MSSQL_DB_CONTAINER-39/refresh
where the MSSQL_DB_CONTAINER-39 represents the target virtualized database to refresh and we need to POST the JSON data to the URL for processing.
{
"type": "RefreshParameters",
"timeflowPointParameters": {
"type": "TimeflowPointSemantic",
"container": "MSSQL_DB_CONTAINER-38"
}
}
Timeflow parameters
The "timeflowPointParameters" key has 6 "type": "..." options which each have their own set of parameters. The type "TimeflowPointSemantic" uses the default LATEST_POINT within the source container. Now, for more on timeflowPointParameters.
http://<delphix_engine>/api/#TimeflowPointParameters
TimeflowPointParameters
Parameters indicating a TimeFlow point to use as input to database operations:
-
TypedObject
-
TimeflowPointParameters
Direct Known Subclasses:
-
TimeflowPointTimestamp
-
TimeflowPointSnapshot
-
TimeflowPointSemantic
-
TimeflowPointLocation
-
TimeflowPointBookmark
-
TimeflowPointBookmarkTag
TimeflowPointTimestamp
|
timeflow |
Reference to TimeFlow containing this point. |
|
timestamp |
The logical time corresponding to the TimeFlow location. |
TimeflowPointSnapshot
|
snapshot |
Reference to the snapshot. |
TimeflowPointSemantic
Semantic reference to a Timeflow point.
|
container |
Reference to the container. |
|
location |
A semantic description of a TimeFlow location. |
TimeflowPointLocation
TimeFlow point based on a database-specific identifier (SCN, LSN, etc).
|
location |
The TimeFlow location. |
|
timeflow |
Reference to TimeFlow containing this location. |
TimeflowPointBookmark
|
bookmark |
Reference to the bookmark. |
TimeflowPointBookmarkTag
|
container |
Reference to the container. |
|
tag |
The name of the tag. |
Timeflow API objects: timeflow, snapshot, timeflowRanges
The sample code provides information on the Timeflow, timeflowRanges and snapshot objects for the respective VDB.
Filename: flows.sh
$ ./flows.sh VBITT10Session API Login API Login
{
"type": "OKResult",
"status": "OK",
"result": "USER-2",
"job": null,
"action": null
}
Source: VBITT10
container reference: ORACLE_DB_CONTAINER-75
Timeflows API timeflow names:
DB_PROVISION@2016-09-27T13:15:18
DB_ROLLBACK@2016-09-28T00:33:54
DB_ROLLBACK@2016-09-28T00:38:33
DB_ROLLBACK@2016-09-28T00:41:44
Select Timeflow Name (copy-n-paste from the above list):
DB_ROLLBACK@2016-09-28T00:33:54timeflow reference: ORACLE_TIMEFLOW-97
TimeflowRanges for this Timeflow ...
$ ./vdb_rollback_timestamp.sh VBITT
Session and Login Successful ...
Database container reference: ORACLE_DB_CONTAINER-73
Timeflows API
Timeflow Names:
DB_REFRESH@2016-09-28T00:13:13
DB_PROVISION@2016-09-26T07:00:08
DB_ROLLBACK@2016-09-26T07:45:30
DB_REFRESH@2016-09-26T12:20:57
DB_ROLLBACK@2016-09-27T12:29:47
Snapshot per Timeflow ...
snapshots:
@2016-09-28T04:35:39.826Z
@2016-09-28T04:37:38.537Z
@2016-09-28T04:37:51.273Z
Select Snapshot Name (copy-n-paste from the above list):
@2016-09-28T04:37:38.537Z snapshot reference: ORACLE_SNAPSHOT-152
{
"type": "OracleSnapshot",
"reference": "ORACLE_SNAPSHOT-152",
"namespace": null,
"name": "@2016-09-28T04:37:38.537Z",
"consistency": "CRASH_CONSISTENT",
"missingNonLoggedData": false,
"container": "ORACLE_DB_CONTAINER-75",
"creationTime": "2016-09-28T04:37:38.537Z",
"firstChangePoint": {
"type": "OracleTimeflowPoint",
"location": "5476152",
"timestamp": null,
"timeflow": "ORACLE_TIMEFLOW-97"
},
"latestChangePoint": {
"type": "OracleTimeflowPoint",
"location": "5476157",
"timestamp": "2016-09-28T04:37:38.000Z",
"timeflow": "ORACLE_TIMEFLOW-97"
},
"retention": 0,
"timeflow": "ORACLE_TIMEFLOW-97",
"timezone": "US/Eastern, EDT-0400",
"version": "11.2.0.4.0",
"runtime": {
"type": "OracleSnapshotRuntime",
"provisionable": true,
"missingLogs": null
},
"temporary": false,
"fromPhysicalStandbyVdb": false,
"fractionTimeflows": null,
"redoLogSizeInBytes": 52428800
}
Done
The following scripts demonstrate REFRESH and RESET/ROLLBACK for the Timeflow types of timestamp, snapshot and scn/lsn.
Filename:vdb_refresh_timestamp.sh
Filename:vdb_refresh_snapshot.sh
Filename:vdb_refresh_scn.sh
Filename:vdb_rollback_timestamp.sh
Filename:vdb_rollback_snapshot.sh
Filename:vdb_rollback_scn.sh
Usage: ./vdb_[all_the_above_scripts].sh [source_vdb_name]
Sample Usage: Copy-and-Paste the timeflow name to the "Select timeflow Name:" prompt. Enter any timestamp between the startPoint and endPoint values using the format:
[yyyy] - [MM] - [dd]T[HH] : [mm] : [ss] . [SSS]Z
$ ./vdb_rollback_timestamp.sh VBITT
Session and Login Successful ...
Database container reference: ORACLE_DB_CONTAINER-73
Timeflows API
Timeflow Names:
DB_REFRESH@2016-09-28T00:13:13
DB_PROVISION@2016-09-26T07:00:08
DB_ROLLBACK@2016-09-26T07:45:30
DB_REFRESH@2016-09-26T12:20:57
DB_ROLLBACK@2016-09-27T12:29:47
Select Timeflow Name (copy-n-paste from above list):
DB_ROLLBACK@2016-09-26T07:45:30 Timeflow Reference: ORACLE_TIMEFLOW-89
TimeflowRanges for this timeflow ...
{
"type": "ListResult",
"status": "OK",
"result": [
{
"type": "TimeflowRange",
"startPoint": {
"type": "OracleTimeflowPoint",
"location": "5474012",
"timestamp": "2016-09-26T15:30:35.000Z",
"timeflow": "ORACLE_TIMEFLOW-89"
},
"endPoint": {
"type": "OracleTimeflowPoint",
"location": "5482482",
"timestamp": "2016-09-26T21:15:17.000Z",
"timeflow": "ORACLE_TIMEFLOW-89"
},
"provisionable": true
}
],
"job": null,
"action": null,
"total": 1,
"overflow": false
}
Timestamp Format "[yyyy][MM][dd]T[HH]:[mm]:[ss].[SSS]Z"
Enter Timestamp between Start and End Point values (exclude quotes): 2016-09-26T15:45:00.000Z
json>
{
"type": "OracleRollbackParameters",
"timeflowPointParameters": {
"type": "TimeflowPointTimestamp",
"timeflow": "ORACLE_TIMEFLOW-89",
"timestamp": "2016-09-26T15:45:00.000Z"
},
"username": ""
}
Job: JOB-515
Current status as of Wed Sep 28 00:49:39 EDT 2016 : RUNNING 0% Completed...
Current status as of Wed Sep 28 00:51:10 EDT 2016 : RUNNING 73% Completed
Current status as of Wed Sep 28 00:51:50 EDT 2016 : RUNNING 96% Completed
Job: JOB-515 COMPLETED 100% Completed ...
Done ...