Monday, October 17, 2016

Oracle Flashback Database 11gR2

Oracle Flashback Database is a technology used to rewind database to past state, by undoing all of the changes made to database without restoring database. In this article, I am going to share how to enable it and how perform flashback database in dataguard environment, 11gr2.

1. Summary Step of How to Enable Flashback Database

  • Primary
    • Shutdown database
    • Startup in mount mode
    • Enable archive log if it disable
    • Enable flashback
    • Open database
  • Physical Standby
    • Cancel Recovery Process
    • Shutdown database
    • Startup in mount mode
    • Enable archive log if it disable
    • Enable flashback
    • Open database
    • Start Recovery Process


2. Detail Step of How to Enable Flashback Database

2.1 Enable Flashback Database on Primary DB

a. Check database whether it was enable or not

SQL> 
select instance_name, status from v$instance;
INSTANCE_NAME    STATUS
---------------- ------------
DC               OPEN
SQL> 
select NAME,FLASHBACK_ON from v$database;
NAME      FLASHBACK_ON
--------- ------------------
DC        NO

b. Set FRA location and size

SQL>
ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='+RECO' SCOPE=SPFILE;
ALTER SYSTEM SET db_recovery_file_dest_size=3G SCOPE=SPFILE;

c. Enable flashback

SQL> 
shut immediate
startup mount;
alter database archivelog;
alter database flashback on;
alter database open;

d. Flashback Retention

SQL> ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=4320; # 3 days, in minute


2.2 Enable Flashback Database on Standby DB:

a. Check database whether it was enable or not

SQL> 
select instance_name, status from v$instance;
INSTANCE_NAME    STATUS
---------------- ------------
DC               OPEN
SQL> 
select NAME,FLASHBACK_ON from v$database;
NAME      FLASHBACK_ON
--------- ------------------
DC        NO


b. Set FRA location and size
SQL>
ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='+RECO' SCOPE=SPFILE;
ALTER SYSTEM SET db_recovery_file_dest_size=3G SCOPE=SPFILE;

c. Enable flashback
SQL> 
alter database recover managed standby database cancel;
shut immediate
startup mount;
alter database flashback on;
alter database open;
alter database recover managed standby database using current logfile disconnect from session;

d. Flashback Retention

SQL> ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=4320; # 3 days, in minute

3. Verify Flashback on Both Primary and Standby after Enable it

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            +RECO
Oldest online log sequence     5
Next log sequence to archive   7
Current log sequence           7

SQL> show parameter LOG_ARCHIVE_DEST_1

NAME                                 TYPE        VALUE
------------------------------------ ----------- -----------------
log_archive_dest_1                   string      LOCATION=+RECO

SQL> 
select NAME,FLASHBACK_ON from v$database;

NAME      FLASHBACK_ON
--------- ------------------
DC        YES

SQL> 
show parameter DB_FLASHBACK_RETENTION_TARGET

NAME                                 TYPE        VALUE
------------------------------------ ----------- -----------------
db_flashback_retention_target        integer     4320
SQL>

SQL> 
show parameter db_recovery_file_dest

NAME                                 TYPE        VALUE
------------------------------------ ----------- -----------------
db_recovery_file_dest                string      +RECO
db_recovery_file_dest_size           big integer 3G
SQL>


4. Test Case
a. Case 1: Perform Flashback Database ToTime on Both Primary and Standby
i. Primary

SQL> select flashback_on from v$database;

FLASHBACK_ON
------------------
YES

#Create test table:

SQL> Create table test(id nvarchar2(1000));
SQL> 
insert into test values(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'));
commit;
alter system switch logfile;
insert into test values(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'));
commit;
alter system switch logfile;
insert into test values(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'));
commit;
alter system switch logfile;
insert into test values(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'));
commit;
alter system switch logfile;
insert into test values(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'));
commit;
alter system switch logfile;
insert into test values(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'));
commit;
alter system switch logfile;
insert into test values(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'));
commit;
alter system switch logfile;
insert into test values(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'));
commit;
alter system switch logfile;
insert into test values(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'));
commit;
alter system switch logfile;
insert into test values(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'));
commit;
alter system switch logfile;

#Select From (Primary):

SQL> select * from test;

ID
-------------------
25-06-2014 11:43:38
25-06-2014 11:43:39
25-06-2014 11:43:39
25-06-2014 11:43:44
25-06-2014 11:43:45
25-06-2014 11:43:48
25-06-2014 11:43:51
25-06-2014 11:43:54
25-06-2014 11:43:57
25-06-2014 11:44:00

10 rows selected.

SQL>

#Select From (Standby):

SQL> select * from test;

ID
-------------------
25-06-2014 11:43:38
25-06-2014 11:43:39
25-06-2014 11:43:39
25-06-2014 11:43:44
25-06-2014 11:43:45
25-06-2014 11:43:48
25-06-2014 11:43:51
25-06-2014 11:43:54
25-06-2014 11:43:57
25-06-2014 11:44:00

10 rows selected.

SQL>

#Perform flashback database with RMAN

RMAN> shutdown immediate

using target database control file instead of recovery catalog
database closed
database dismounted
Oracle instance shut down

RMAN> startup mount;

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area    1235959808 bytes

Fixed Size                     2227904 bytes
Variable Size                939524416 bytes
Database Buffers             285212672 bytes
Redo Buffers                   8994816 bytes

RMAN> FLASHBACK DATABASE TO TIME "TO_DATE('25-06-2014 11:43:48','DD-MM-YYYY HH24:MI:SS')";

Starting flashback at 25-JUN-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=24 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=26 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=28 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=29 device type=DISK


starting media recovery

archived log for thread 1 with sequence 19 is already on disk as file +RECO/db/archivelog/2014_06_25/thread_1_seq_19.565.851118079
archived log for thread 1 with sequence 20 is already on disk as file +RECO/db/archivelog/2014_06_25/thread_1_seq_20.566.851118081
archived log for thread 1 with sequence 21 is already on disk as file +RECO/db/archivelog/2014_06_25/thread_1_seq_21.567.851118219
archived log for thread 1 with sequence 22 is already on disk as file +RECO/db/archivelog/2014_06_25/thread_1_seq_22.568.851118221
archived log for thread 1 with sequence 23 is already on disk as file +RECO/db/archivelog/2014_06_25/thread_1_seq_23.569.851118225
archived log for thread 1 with sequence 24 is already on disk as file +RECO/db/archivelog/2014_06_25/thread_1_seq_24.570.851118225
archived log for thread 1 with sequence 25 is already on disk as file +RECO/db/archivelog/2014_06_25/thread_1_seq_25.571.851118229
media recovery complete, elapsed time: 00:00:08
Finished flashback at 25-JUN-14

RMAN> alter database open resetlogs;

database opened

RMAN> alter database open resetlogs;

database opened

RMAN> exit

sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Wed Jun 25 12:05:40 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> select * from test;

ID
-------------------
25-06-2014 11:43:38
25-06-2014 11:43:39
25-06-2014 11:43:39
25-06-2014 11:43:44
25-06-2014 11:43:45
25-06-2014 11:43:48

6 rows selected.

#Note: At standby alert log will show message as below after primary finish open db with resetlogs. This mean that recovery process will stop by itself.

2014-06-25 11:53:35.598000 +07:00
MRP0: Background Media Recovery process shutdown (DGDB)

ii. Standby


SQL> alter database recover managed standby database cancel;
alter database recover managed standby database cancel
*
ERROR at line 1:
ORA-16136: Managed Standby Recovery not active

SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> 
rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Wed Jun 25 12:02:19 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database (not started)

RMAN> startup mount;

Oracle instance started
database mounted

Total System Global Area     835104768 bytes

Fixed Size                     2232960 bytes
Variable Size                301993344 bytes
Database Buffers             528482304 bytes
Redo Buffers                   2396160 bytes

RMAN> 
RMAN> 

RMAN> FLASHBACK DATABASE TO TIME "TO_DATE('25-06-2014 11:43:48','DD-MM-YYYY HH24:MI:SS')";

Starting flashback at 25-JUN-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=88 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=89 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=90 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=91 device type=DISK


starting media recovery

archived log for thread 1 with sequence 19 is already on disk as file +RECO/dgdb/archivelog/2014_06_25/thread_1_seq_19.582.851118075
archived log for thread 1 with sequence 20 is already on disk as file +RECO/dgdb/archivelog/2014_06_25/thread_1_seq_20.581.851118079
archived log for thread 1 with sequence 21 is already on disk as file +RECO/dgdb/archivelog/2014_06_25/thread_1_seq_21.358.851118217
archived log for thread 1 with sequence 22 is already on disk as file +RECO/dgdb/archivelog/2014_06_25/thread_1_seq_22.480.851118221
archived log for thread 1 with sequence 23 is already on disk as file +RECO/dgdb/archivelog/2014_06_25/thread_1_seq_23.271.851118221
archived log for thread 1 with sequence 24 is already on disk as file +RECO/dgdb/archivelog/2014_06_25/thread_1_seq_24.478.851118223
archived log for thread 1 with sequence 25 is already on disk as file +RECO/dgdb/archivelog/2014_06_25/thread_1_seq_25.419.851118225
media recovery complete, elapsed time: 00:00:14
Finished flashback at 25-JUN-14

RMAN> 
RMAN> 

RMAN> alter database open;

database opened

RMAN> exit


Recovery Manager complete.
[oracle@ol6211gr2dr ~]$ 
[oracle@ol6211gr2dr ~]$ 
[oracle@ol6211gr2dr ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Wed Jun 25 12:04:42 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> @start_recover

Database altered.

SQL> ;
  1* alter database recover managed standby database using current logfile disconnect from session
SQL> 

SQL> select * from test;

ID
--------------------
25-06-2014 11:43:38
25-06-2014 11:43:39
25-06-2014 11:43:39
25-06-2014 11:43:44
25-06-2014 11:43:45
25-06-2014 11:43:48

6 rows selected.

b. Case 2: Perform Flashback Database on Both Primary and Standby
By Using Guaranteed Restore Points
i. Create Guaranteed Restore Points  on Standby

SQL> select flashback_on from v$database;

FLASHBACK_ON
------------------
YES
SQL> CREATE RESTORE POINT before_flashback2 GUARANTEE FLASHBACK DATABASE;
SQL> SELECT NAME, SCN, TIME, DATABASE_INCARNATION#,
GUARANTEE_FLASHBACK_DATABASE,STORAGE_SIZE
FROM V$RESTORE_POINT;

NAME
--------------------------------------------------------------------------------
       SCN
----------
TIME
---------------------------------------------------------------------------
DATABASE_INCARNATION# GUA STORAGE_SIZE
--------------------- --- ------------
BEFORE_FLASHBACK2
   1073762
25-JUN-14 05.28.03.000000000 PM
                    4 YES     52428800


SQL>

ii. Create Guaranteed Restore Points  on Primary

SQL> CREATE RESTORE POINT before_flashback2 GUARANTEE FLASHBACK DATABASE;

Restore point created.

SQL> SELECT NAME, SCN, TIME, DATABASE_INCARNATION#,
  2  GUARANTEE_FLASHBACK_DATABASE,STORAGE_SIZE
  3  FROM V$RESTORE_POINT;

NAME
--------------------------------------------------------------------------------
       SCN
----------
TIME
---------------------------------------------------------------------------
DATABASE_INCARNATION# GUA STORAGE_SIZE
--------------------- --- ------------
BEFORE_FLASHBACK2
   1073790
25-JUN-14 05.28.29.000000000 PM
                    4 YES     52428800


SQL> 
insert into test values('BEFORE_FLASHBACK2');
commit;
alter system switch logfile;
insert into test values(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'));
commit;
alter system switch logfile;
insert into test values(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'));
commit;
alter system switch logfile;
insert into test values(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'));
commit;
alter system switch logfile;
insert into test values(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'));
commit;
alter system switch logfile;
insert into test values(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'));
commit;
alter system switch logfile;
insert into test values(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'));
commit;
alter system switch logfile;
insert into test values(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'));
commit;
alter system switch logfile;
insert into test values(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'));
commit;
alter system switch logfile;
insert into test values(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'));
commit;
alter system switch logfile;
insert into test values(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'));
commit;
alter system switch logfile;



Primary:
SQL> select * from test;

ID
--------------------------------------------------------------------------------
25-06-2014 11:43:38
25-06-2014 11:43:39
25-06-2014 11:43:39
25-06-2014 11:43:44
25-06-2014 11:43:45
25-06-2014 11:43:48
25-06-2014 12:59:34
25-06-2014 12:59:34
25-06-2014 12:59:35
25-06-2014 12:59:37
25-06-2014 12:59:38

ID
--------------------------------------------------------------------------------
25-06-2014 12:59:41
25-06-2014 12:59:44
25-06-2014 12:59:47
25-06-2014 12:59:50
25-06-2014 12:59:53
after flash
after flash 1
BEFORE_FLASHBACK2
25-06-2014 17:31:06
25-06-2014 17:31:07
25-06-2014 17:31:11

ID
--------------------------------------------------------------------------------
25-06-2014 17:31:14
25-06-2014 17:31:17
25-06-2014 17:31:20
25-06-2014 17:31:23
25-06-2014 17:31:26
25-06-2014 17:31:29
25-06-2014 17:31:32

29 rows selected.

SQL>

iii. Check data on Standby
SQL>
SQL> select * from test;

ID
--------------------------------------------------------------------------------
25-06-2014 11:43:38
25-06-2014 11:43:39
25-06-2014 11:43:39
25-06-2014 11:43:44
25-06-2014 11:43:45
25-06-2014 11:43:48
25-06-2014 12:59:34
25-06-2014 12:59:34
25-06-2014 12:59:35
25-06-2014 12:59:37
25-06-2014 12:59:38

ID
--------------------------------------------------------------------------------
25-06-2014 12:59:41
25-06-2014 12:59:44
25-06-2014 12:59:47
25-06-2014 12:59:50
25-06-2014 12:59:53
after flash
after flash 1
BEFORE_FLASHBACK2
25-06-2014 17:31:06
25-06-2014 17:31:07
25-06-2014 17:31:11

ID
--------------------------------------------------------------------------------
25-06-2014 17:31:14
25-06-2014 17:31:17
25-06-2014 17:31:20
25-06-2014 17:31:23
25-06-2014 17:31:26
25-06-2014 17:31:29
25-06-2014 17:31:32

29 rows selected.

SQL>

iv. Flashback on Primary

SQL>
rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Wed Jun 25 17:35:02 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: DB (DBID=1614976585)

RMAN> shutdown immediate

using target database control file instead of recovery catalog
database closed
database dismounted
Oracle instance shut down

RMAN> startup mount;

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area    1235959808 bytes

Fixed Size                     2227904 bytes
Variable Size               1023410496 bytes
Database Buffers             201326592 bytes
Redo Buffers                   8994816 bytes

RMAN> FLASHBACK DATABASE TO RESTORE POINT 'BEFORE_FLASHBACK2';

Starting flashback at 25-JUN-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=24 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=27 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=28 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=29 device type=DISK


starting media recovery

archived log for thread 1 with sequence 3 is already on disk as file +RECO/db/archivelog/2014_06_25/thread_1_seq_3.329.851136987
archived log for thread 1 with sequence 4 is already on disk as file +RECO/db/archivelog/2014_06_25/thread_1_seq_4.328.851137423
archived log for thread 1 with sequence 5 is already on disk as file +RECO/db/archivelog/2014_06_25/thread_1_seq_5.327.851137433
archived log for thread 1 with sequence 6 is already on disk as file +RECO/db/archivelog/2014_06_25/thread_1_seq_6.326.851137937
archived log for thread 1 with sequence 7 is already on disk as file +RECO/db/archivelog/2014_06_25/thread_1_seq_7.323.851138079
archived log for thread 1 with sequence 8 is already on disk as file +RECO/db/archivelog/2014_06_25/thread_1_seq_8.320.851138087
archived log for thread 1 with sequence 9 is already on disk as file +RECO/db/archivelog/2014_06_25/thread_1_seq_9.319.851138539
archived log for thread 1 with sequence 10 is already on disk as file +RECO/db/archivelog/2014_06_25/thread_1_seq_10.322.851139067
media recovery complete, elapsed time: 00:00:12
Finished flashback at 25-JUN-14

RMAN> alter database open resetlogs;

database opened

RMAN> 
sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Wed Jun 25 17:37:05 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> select * from test;

ID
--------------------------------------------------------------------------------
25-06-2014 11:43:38
25-06-2014 11:43:39
25-06-2014 11:43:39
25-06-2014 11:43:44
25-06-2014 11:43:45
25-06-2014 11:43:48
25-06-2014 12:59:34
25-06-2014 12:59:34
25-06-2014 12:59:35
25-06-2014 12:59:37
25-06-2014 12:59:38

ID
--------------------------------------------------------------------------------
25-06-2014 12:59:41
25-06-2014 12:59:44
25-06-2014 12:59:47
25-06-2014 12:59:50
25-06-2014 12:59:53
after flash
after flash 1

18 rows selected.

SQL>

v. Flashback on Standby

SQL>
rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Wed Jun 25 17:37:51 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: DB (DBID=1614976585)

RMAN> shutdown immediate

using target database control file instead of recovery catalog
database closed
database dismounted
Oracle instance shut down

RMAN> startup mount;

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area     835104768 bytes

Fixed Size                     2232960 bytes
Variable Size                301993344 bytes
Database Buffers             528482304 bytes
Redo Buffers                   2396160 bytes

RMAN> FLASHBACK DATABASE TO RESTORE POINT 'BEFORE_FLASHBACK2';

Starting flashback at 25-JUN-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=91 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=92 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=95 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=96 device type=DISK


starting media recovery

archived log for thread 1 with sequence 5 is already on disk as file +RECO/dgdb/archivelog/2014_06_25/thread_1_seq_5.472.851137423
archived log for thread 1 with sequence 6 is already on disk as file +RECO/dgdb/archivelog/2014_06_25/thread_1_seq_6.470.851137929
archived log for thread 1 with sequence 7 is already on disk as file +RECO/dgdb/archivelog/2014_06_25/thread_1_seq_7.477.851138069
archived log for thread 1 with sequence 8 is already on disk as file +RECO/dgdb/archivelog/2014_06_25/thread_1_seq_8.452.851138077
archived log for thread 1 with sequence 9 is already on disk as file +RECO/dgdb/archivelog/2014_06_25/thread_1_seq_9.469.851138529
archived log for thread 1 with sequence 10 is already on disk as file +RECO/dgdb/archivelog/2014_06_25/thread_1_seq_10.474.851139057
media recovery complete, elapsed time: 00:00:08
Finished flashback at 25-JUN-14

RMAN> 

sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Wed Jun 25 17:39:17 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> @start_recover;

Database altered.

SQL> ;
  1* alter database recover managed standby database using current logfile disconnect from session
SQL> 
SQL> select * from test;

ID
--------------------------------------------------------------------------------
25-06-2014 11:43:38
25-06-2014 11:43:39
25-06-2014 11:43:39
25-06-2014 11:43:44
25-06-2014 11:43:45
25-06-2014 11:43:48
25-06-2014 12:59:34
25-06-2014 12:59:34
25-06-2014 12:59:35
25-06-2014 12:59:37
25-06-2014 12:59:38

ID
--------------------------------------------------------------------------------
25-06-2014 12:59:41
25-06-2014 12:59:44
25-06-2014 12:59:47
25-06-2014 12:59:50
25-06-2014 12:59:53
after flash
after flash 1

18 ows selected.


5. Maintenance
a. Sizing FRA

SQL> ALTER SYSTEM SET db_recovery_file_dest_size=2G SCOPE=SPFILE;

b. Flashback Retention

SQL> ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=4320; # 3 days, in minute
SQL> ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=15; # 15 minute

c. Check FRA usage

SQL>
SELECT Sum(PERCENT_SPACE_USED) FROM V$FLASH_RECOVERY_AREA_USAGE;
SELECT * FROM V$FLASH_RECOVERY_AREA_USAGE;
SELECT * FROM V$RECOVERY_FILE_DEST;


d. Estimating Disk Space Requirements for Flashback Database Logs(After Enable Flashback)

SQL> 
SELECT ESTIMATED_FLASHBACK_SIZE FROM V$FLASHBACK_DATABASE_LOG;



Good Luck !!!





Followers