How to enable the flashback database:

oracle_ace發表於2009-02-10
How to enable the flashback database:
--------------------------------------
[root@plinuxt19 ~]# su - oracle
[oracle@plinuxt19 ~]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.3.0 - Production on Tue Feb 3 10:49:09 2009

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

SQL> conn / as sysdba;
Connected.

SQL> select name,log_mode from v$database;

NAME      LOG_MODE
--------- ------------
IRMDB     NOARCHIVELOG

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

SQL> startup mount
ORACLE instance started.

Total System Global Area 1375731712 bytes
Fixed Size                  2072672 bytes
Variable Size             570429344 bytes
Database Buffers          788529152 bytes
Redo Buffers               14700544 bytes
Database mounted.

SQL> archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /app/oracle/product/10g/dbs/arch
Oldest online log sequence     40
Current log sequence           42

SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /app/oracle/product/10g/dbs/arch
Oldest online log sequence     40
Next log sequence to archive   42
Current log sequence           42

SQL> select flashback_on from v$database;

FLASHBACK_ON
------------------
NO

SQL> show parameter db_recovery_file_dest;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string
db_recovery_file_dest_size           big integer 0

SQL> alter system set db_recovery_file_dest='/app/oracle/product/flash_recovery_area' scope=spfile;

System altered.

SQL> alter system set db_recovery_file_dest_size=3G scope=spfile;

System altered.

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

Total System Global Area 1375731712 bytes
Fixed Size                  2072672 bytes
Variable Size             570429344 bytes
Database Buffers          788529152 bytes
Redo Buffers               14700544 bytes
Database mounted.
Database opened.

SQL> show parameter db_recovery_file_dest;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /app/oracle/product/flash_reco
                                                 very_area
db_recovery_file_dest_size           big integer 3G

SQL> show parameter db_flashback_retention_target;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_flashback_retention_target        integer     1440

SQL> alter system set db_flashback_retention_target=2880 scope=spfile;

System altered.

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

SQL> startup mount;
ORACLE instance started.

Total System Global Area 1375731712 bytes
Fixed Size                  2072672 bytes
Variable Size             570429344 bytes
Database Buffers          788529152 bytes
Redo Buffers               14700544 bytes
Database mounted.

SQL> show parameter db_flashback_retention_target;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_flashback_retention_target        integer     2880

SQL> alter database flashback on;

Database altered.

SQL> alter database open;

Database altered.

SQL> select flashback_on from v$database;

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

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12361284/viewspace-545717/,如需轉載,請註明出處,否則將追究法律責任。

相關文章