2008/8/1
oracle10g的flashback database
需要启动flash recovery area,才能使用flashback database
在mount状态执行alter database flashback on;打开flashback database功能。
在mount状态执行flashback database to scn/timestamp语句闪回数据库。然后用resetlogs模式打开数据库。
SQL> create spfile from pfile;
File created.
SQL> startup
ORACLE instance started.
Total System Global Area 801112064 bytes
Fixed Size 1221972 bytes
Variable Size 432016044 bytes
Database Buffers 360710144 bytes
Redo Buffers 7163904 bytes
Database mounted.
Database opened.
SQL> alter system set DB_RECOVERY_FILE_DEST_SIZE=20G scope=spfile;
System altered.
SQL> alter system set DB_RECOVERY_FILE_DEST_SIZE=20G scope=both;
System altered.
SQL> alter system set db_recovery_file_dest=/u01/app/oracle/flash_recovery_area scope=both;
alter system set db_recovery_file_dest=/u01/app/oracle/flash_recovery_area scope=both
*
ERROR at line 1:
ORA-02065: illegal option for ALTER SYSTEM
SQL> alter system set db_recovery_file_dest='/u01/app/oracle/flash_recovery_area' scope=both;
System altered.
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 801112064 bytes
Fixed Size 1221972 bytes
Variable Size 432016044 bytes
Database Buffers 360710144 bytes
Redo Buffers 7163904 bytes
Database mounted.
SQL> alter database flashback on;
Database altered.
SQL>