1. Introduction
One of the features provided by Dbvisit Standby is the option to recover the standby database up until a specified SCN or TIMESTAMP.
This can be especially useful where you have a financial system with a standby database being used for reporting. Once the batch processing is complete on your primary database the batch process creates a text file on the standby server indicating the SCN or TIMESTAMP to which the standby should recover. This can then allow the DBA to recover the standby database automatically up until this specified SCN or TIMESTAMP.
The standby database can then be opened read-only and used for reporting. This is useful if you would like to view data at a specific point in time.
Table of Contents |
---|
2. Configuration
Two dynamically created files can be used to save specific SCN or timestamp.
Files full names are specified by the following two global variables:
- RECOVER_UNTIL_SCN_FILE
- RECOVER_UNTIL_TIME_FILE
The default location is under the DBVISIT_BASE/standby/log folder on the Standby Database server.
Note |
---|
From Dbvisit Standby Version 8.0.24 we can customise the location of the RECOVER_UNTIL_SCN_FILE and RECOVER_UNTIL_TIME_FILE in the DDC. If the file is present it checks for the parameter and recovers according to the SCN or TIMESTAMP set. If not it recovers using the default. This would eliminate the need for changing the parameter in the DDC every time. |
No Format |
---|
RECOVER_UNTIL_TIME_FILE = $DBVISIT_BASE/standby/log/recover_until_time.txt by default |
No Format |
---|
RECOVER_UNTIL_SCN_FILE = $DBVISIT_BASE/standby/log/recover_until_scn.txt by default |
Below is an example of using the until time option (Expected format is YYYY-MM-DD:HH24:MI: SS). In this example, we manually create a text file with a timestamp to which the standby should be recovered to.
Note |
---|
The standby will not recover past this time until this file has been removed or updated to a later time. |
Below is the contents of the recover_until_time.txt
file, as well as the output from a dbvisit, run on the standby server when this file is in place:
No Format |
---|
[oracle@dbv2 standby]$ pwd /usr/dbvisit/standby [oracle@dbv2 standby]$ cat log/recover_until_time.txt 20192020-0512-0902:1316:1000:00 [oracle@dbv2 standby]$ ./dbvctl -d DEV ============================================================= Dbvisit Standby Database Technology (910.0.00RC_127115_g4b00fb49g81628a5f) (pid 15222188) dbvctl started on dbv2: ThuWed MayDec 92 1316:1302:4111 20192020 ============================================================= >>> Applying Log file(s) from dbv1 to DEV on dbv2: Taking into account RECOVER_UNTIL_TIME=20192020-0512-0902:1316:1000:00 set in file /usr/dbvisit/standby/log/recover_until_time.txt thread 1 sequence 1417 (1_17_1013170568.arc)... done thread 1 sequence 18 (1_1418_10043726701013170568.arc)... done Last applied log(s): thread 1 sequence 1418 Next SCN required for recovery 11312541096524 generated at 20192020-0512-0902:1316:1000:1341 +1213:00. Next required log thread 1 sequence 1418 ============================================================= dbvctl ended on dbv2: ThuWed MayDec 92 1316:02:13:43 20192020 ============================================================= [oracle@dbv2 standby]$ rm log/recover_until_time.txt [oracle@dbv2 standby]$ ./dbvctl -d DEV ============================================================= Dbvisit Standby Database Technology (910.0.00RC_127115_g4b00fb49g81628a5f) (pid 15582291) dbvctl started on dbv2: ThuWed MayDec 92 1316:1405:5256 20192020 ============================================================= >>> Applying Log file(s) from dbv1 to DEV on dbv2: thread 1 sequence 18 (1_18_1013170568.arc)... done thread 1 sequence 1419 (1_1419_10043726701013170568.arc)... done Last applied log(s): thread 1 sequence 1419 Next SCN required for recovery 11316171096760 generated at 20192020-0512-0902:1316:1301:1459 +1213:00. Next required log thread 1 sequence 1520 ============================================================= dbvctl ended on dbv2: ThuWed MayDec 92 1316:1405:5457 20192020 ============================================================= |
The same process can be followed when using an SCN number.
Code Block |
---|
For eg: You can set the below [oracle@dbv2 ~]$ pwd /home/oracle [oracle@dbv2 ~]$ cat recoveruntilscn.txt 1129090 [oracle@dbv2 ~]$ and if you don't want to set the parameter you can just remove/move the file and the recovery will happen |