The document describes how to create a guaranteed restore point in an Oracle database using SQL or RMAN. It shows how to create a guaranteed restore point, flashback the database to the restore point if needed, and then drop the restore point. Creating a guaranteed restore point allows rolling back the database to a known state without the restore point being deleted due to space constraints.
1. Rabobank Nederland
B&E IS Oracle ECO/Koppelingen
Create Guaranteed Restore Point
Versie,Datum ,07 March 2013
Project
Coöperatieve Centrale Raiffeisen Boerenleenbank B.A.
Ingeschreven bij de KvK onder nummer 3004.6259
3. Inhoudsopgave
1. Create Guaranteed Restore Point Using Sql 1
2. Flashback Database using Sql 2
3. Rman To Create Guaranteed Restore Point 3
3.1 Flashback Database Using Rman 4
R
4. 1. Create Guaranteed Restore Point using sql
A guaranteed restore point will never go out of the flashback area and
does not use the parameter db_flashback _retention_target.
It will never be deleted even if there is space pressure in the flashback area.
You must manually delete the guaranteed restore point to reclaim space in the
flashback area.
To create a guaranteed restore point, you must have the
SYSDBA system privileges.
We create a guaranteed restore point only if it is requested in the change.
If so we do this off course before we start the change
Connect to the database as sysdba
SQL> conn / as sysdba
Now we create the restore poimt.
SQL>create restore point C000365807 guarantee flashback database;
Restore point created.
Check to see if the restore pint is created.
SQL>select NAME,GUARANTEE_FLASHBACK_DATABASE,SCN from v$restore_point;
NAME GUARANTEE SCN
---------- --------- ------------------------
C000365807 YES 21093820677
Now you ready to do you change.
R Create Guaranteed Restore Point, 1
5. 2. Flashback Database Using Sql
If you need to rollback the change you can now use the restore point to flashback the database
as it was before the change.
You must shutdown the database and start 1 instance in the mount fase.
Shutdown the database.
SQL> !srvctl stop database -d ODBA6_01
Start 1 instance in the mount fase.
SQL> !srvctl start instance -d ODBA6_01 -i ODBA61 -o mount
Now you are ready to flashback the database.
SQL> flashback database to restore point C000365807;
Flashback complete.
We have to open the database with the resetlogs option.
SQL> alter database open resetlogs;
Now you can start the other instance’s
SQL !srvctl start instance -d ODBA6_01 -i ODBA62
SQL!srvctl status database -d odba6_01
Instance ODBA61 is running on node oesv0044
Instance ODBA62 is running on node oesv0045
Now we have to drop the restore point as this is a guaranteed restore point
you must delete or otherwise it will exist forever.
SQL> drop restore point C000365807;
Restore point dropped.
R Create Guaranteed Restore Point, 2
6. 3. Rman To Create Guaranteed Restore Point.
You can also use rman for the whole process if you want.
RMAN> connect target /
connected to target database: ODBA6 (DBID=459400142)
RMAN> create restore point C000365807guarantee flashback database;
using target database control file instead of recovery catalog
RMAN> list restore point all;
SCN RSP Time Type Time Name
---------------- ------------------- ---------- ------------------- ----------
21093823902 GUARANTEED 06-03-2013:14:37:46 C000365807
3.1. Flashback Database Using Rman
If you need to rollback the change you can now use the restore point to flashback the database
as it was before the change.
You must shutdown the database and start 1 instance in the mount fase.
Shutdown the database
$ srvctl stop database -d ODBA6_01
Start 1 instance
$srvctl start instance -d ODBA6_01 -i ODBA61 -o mount
Now we going to Rman to flashback the database.
RMAN> connect target /
RMAN> flashback database to restore point C000365807;
Starting flashback at 04-MAR-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=11instance=ODBA61 device type=DISK
starting media recovery
media recovery complete, elapsed time: 00:00:04
Finished flashback at 04-MAR-13
RMAN> alter database open resetlogs;
database opened
R Create Guaranteed Restore Point, 3
7. RMAN> drop restore point C000365807;
Now you can start the other instance’s
SQL !srvctl start instance -d ODBA6_01 -i ODBA62
SQL!srvctl status database -d odba6_01
Instance ODBA61 is running on node oesv0044
Instance ODBA62 is running on node oesv0045
R Create Guaranteed Restore Point, 4