Saturday 4 July 2015

Turning Flashback ON possible when the database is open(starting from 11gR2)

Starting from 11gR2 oracle allows us to  enable the  flashback even the database is in open mode.
But this was not possible in earlier versions, till 11gR1 we can enable the flashback only when the database is in mount mode.


Simulated the situation below with the detailed steps :

11gR2 :

$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Mon Jul 18 04:56:02 2011

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

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

SQL> select flashback_on, log_mode, open_mode from v$database;

FLASHBACK_ON       LOG_MODE OPEN_MODE
------------------ ------------ --------------------
NO         ARCHIVELOG   READ WRITE

SQL> alter database flashback on;

Database altered.

SQL> select flashback_on, log_mode, open_mode from v$database;

FLASHBACK_ON       LOG_MODE OPEN_MODE
------------------ ------------ --------------------
YES        ARCHIVELOG   READ WRITE

SQL> alter database flashback off;

Database altered.

SQL> select flashback_on, log_mode, open_mode from v$database;

FLASHBACK_ON       LOG_MODE OPEN_MODE
------------------ ------------ --------------------
NO         ARCHIVELOG   READ WRITE





11gR1


$ sqlplus / as sysdba

SQL*Plus: Release 11.1.0.6.0 - Production on Mon Jul 18 05:15:52 2011

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

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

SQL> select flashback_on, log_mode, open_mode from v$database;

FLASHBACK_ON       LOG_MODE OPEN_MODE
------------------ ------------ ----------
NO         ARCHIVELOG   READ WRITE

SQL> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-38759: Database must be mounted by only one instance and not open.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area  217157632 bytes
Fixed Size          2142976 bytes
Variable Size         159386880 bytes
Database Buffers       50331648 bytes
Redo Buffers            5296128 bytes
Database mounted.
SQL> select flashback_on, log_mode, open_mode from v$database;

FLASHBACK_ON       LOG_MODE OPEN_MODE
------------------ ------------ ----------
NO         ARCHIVELOG   MOUNTED

SQL> alter database flashback on;

Database altered.

SQL> select flashback_on, log_mode, open_mode from v$database;

FLASHBACK_ON       LOG_MODE OPEN_MODE
------------------ ------------ ----------
YES        ARCHIVELOG   MOUNTED

SQL> alter database open;

Database altered.

SQL> select flashback_on, log_mode, open_mode from v$database;

FLASHBACK_ON       LOG_MODE OPEN_MODE
------------------ ------------ ----------
YES        ARCHIVELOG   READ WRITE

SQL> alter database flashback off;

Database altered.

SQL> select flashback_on, log_mode, open_mode from v$database;

FLASHBACK_ON       LOG_MODE OPEN_MODE
------------------ ------------ ----------
NO         ARCHIVELOG   READ WRITE

No comments:

Post a Comment