Wednesday, July 18, 2018

Using flashback on oracle RAC database

Here are steps to enable flashback in sit:

To Enable flashback

check make sure archive log is enabled.

alter system set db_recovery_file_dest_size=50G scope=both sid='*';
alter system set DB_RECOVERY_FILE_DEST='+RECOC1' scope=both sid='*';
alter system set db_flashback_retention_target=10080 scope=both sid='*';

srvctl stop database -d
srvctl start instance -d -i -o nomount;

alter system set cluster_database=false scope=spfile;

srvctl stop database -d
srvctl start instance -d -i -o mount;

alter database flashback on;
alter system set cluster_database=true scope=spfile;

srvctl stop database -d
srvctl start database -d


To create restore point

To create a restore point(db snapshot)
sqlplus "/as sysdba"
create restore point ;

To restore the flashback

srvctl stop database -d
srvctl start instance -d -i -o mount

flashback database to restore point 1_07APR15;
alter database open resetlogs;


SET PAUSE ON
SET PAUSE 'Press Return to Continue'
SET PAGESIZE 60
SET LINESIZE 300
SET VERIFY OFF

COLUMN scn FOR 999,999,999,999,999
COLUMN Incar FOR 99
COLUMN name FOR A25
COLUMN storage_size FOR 999,999,999,999
COLUMN guarantee_flashback_database FOR A3

SELECT
      database_incarnation# as Incar,
      scn,
      name,
      time,
      storage_size,
      guarantee_flashback_database
FROM
      v$restore_point
/

No comments: