Production database point in time snapshots, roll-back
Windocks provides users with database clones from varied production point in time snapshots, allowing users to roll forward and backward on an production image timeline. This functionality is available for SQL Server and Oracle in the Windocks Enterprise Plus edition. Users get roll back and roll forward functionality.
SQL Server production point-in-time snapshots
Windocks incrementally refreshes SQL Server images with production changes using transaction log backups. As each set of transaction log backups is applied, Windocks automatically creates an instantaneous snapshot of the image. This results in a timeline of snapshots for past days / months which reflect production as of those times. Database clones can be instantly created from these snapshots.
Step 1: Setup configuration for creating snapshots.
Open the file windocks\config\node.conf and make changes so that the lines look like below.
# FULL_BACKUPS_ONLY="1"
CREATE_RESTORE_POINTS="1"
DATETIME_FORMAT_FOR_SNAPSHOT_NAMES="yyyy_MM_dd_HHmm"
Step 2: Restart the Windocks service
Step 3: Build an image that supports incremental refreshes from production.
See how to build incremental refresh images.
Or use the sample in windocks\samples\\incrementalRefreshWithTransactionLogBackups. Make changes to the dockerfile in this directory for your SQL version and backup path and then build the image with the Web App (Click Build on the top menu) or use the command line
cd windocks\samples\\incrementalRefreshWithTransactionLogBackups
docker build -t freshImage .
Step 4: Apply the first transaction log backup or set of backups.
Use the web app (Click Refresh on the top menu and provide the path to the backup) or use the command line:
docker exec freshImage path\to\trans1.trn
or if you want to apply multiple transaction log backups,
docker exec freshImage path\to\directory\containing\log\backups
Step 5: See the image snapshot
Use the web app (click on Images on the top menu, find freshImage and click on it. Scroll to the bottom and see the snapshot that was created). This snapshot represents the state of the database as of the time of the transaction log backup application.
Step 6: Apply more transaction log backups.
Repeat step 4 with the next set of transaction log backups and view the new snapshots as described in step 5. As you apply more transaction log backups, you will have a timeline of image snapshots that represent different production database states over time
Step 7: Create containers from these snapshots
Use the web app (click on Images on the top menu, find freshImage and click on it. Scroll to the bottom and see the snapshots). Put in a container name next to the snapshot name and click Deliver. Repeat for a couple of snapshots. See the containers in Containers and Clones (top menu) and see the different states of data in those containers.
You may also use the REST API for each of the above steps as described here.
Oracle point-in-time snapshots
Windocks incrementally refreshes Oracle images with production changes using a standby container. Oracle image builds use this standby as the source of data and the image build is instantaneous. Each image built from this standby is a snapshot of production and this results in a timeline of snapshots for past hours / days / months which reflect production as of those times. Database clones can be instantly created from these images.
Step 1: Setup configuration for creating snapshots
Open the file windocks\config\node.conf and make changes so that the lines look like below:
ORACLE_LINUX_SERVICE_IP_OR_DNS="18.237.65.109"
ORACLE_LINUX_SERVICE_PORT="80"
ORACLE_LINUX_SERVICE_HTTPS="0"
ORACLE_LINUX_SERVICE_TIMEOUT_SECONDS="3600"
Step 2: Restart the Windocks service
Step 3: Create the standby container
Copy the file windocks\samples\oracleLinux\createstandby.json to the Linux machine. Populate the file createstandby.json and run the curl command against the Windocks server as shown in that file.
Step 4: Setup the configuration for production snapshotting
Copy the file configstandby.json to /var/www/windocks, and populate the values in it. To get the standby IP, use docker inspect on the Linux machine
Step 5: Build an Oracle image that uses a standby as the source of data
See the sample in windocks\samples\oracleLinux. Make changes to the dockerfile in this directory and use the SETUPCLONING section for standby container. Then build the image with the Web App (Click Build on the top menu) or use the command line
cd windocks\samples\oracleLinux
docker build -t freshImage .
This image is the snapshot of the standby (and hence production) For automated periodic snapshotting, use the command line or REST API to periodically build an image from the standby. Oracle image builds from a standby container are instantaneous no matter how big the databases.
Step 6: Create containers from these snapshots
Use the web app (click on Images on the top menu, find freshImage and deliver a container from it).