首页 > 数据库 > Oracle > ORACLE闪回查询配置和测试
测试环境Windows XP,单实例ORACLE数据库。
1. 配置ORACLE的FLash Recovery
2. 检查归档模式和闪回功能
3. 测试快速回复区大小和闪回保留时间的关系
最后附,命令行设置归档模式和闪回功能
C:Documents and SettingsAdministrator>sqlplus / as sysdba
SQL*Plus: Release 10.1.0.2.0 - Production on 星期四 2月 9 15:48:15 2012
Copyright (c) 1982, 2004, Oracle.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 -
Production
With the Partitioning, OLAP and Data Mining options
SQL> select name, log_mode, flashback_on from v$database;
NAME
--------- ------------ ---
ORCL
SQL> col flashback_on format a12
SQL> select name, log_mode, flashback_on from
v$database;
NAME
--------- ------------ ------------
ORCL
SQL> show parameter recovery
NAME
------------------------------------ -----------
------------------------------
db_recovery_file_dest
db_recovery_file_dest_size
recovery_parallelism
SQL> alter system set db_recovery_file_dest_size=1g
scope=both;
System altered.
SQL> alter system set
db_recovery_file_dest=E:oracleproduct10.1.0flash_db_recovery_area
scope=both;
alter system set
db_recovery_file_dest=E:oracleproduct10.1.0flash_db_recovery_area
scope=both
ERROR at line 1:
ORA-00922: missing or invalid option
SQL> alter system set
db_recovery_file_dest='E:oracleproduct10.1.0flash_recovery_area'
scope=both;
System altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area
Fixed
Size
Variable
Size
Database
Buffers
Redo
Buffers
Database mounted.
SQL> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-38706: Cannot turn on FLASHBACK DATABASE logging.
ORA-38707: Media recovery is not enabled.
SQL> alter system set
log_archive_dest_1='location=E:oracleproduct10.1.0flash_recovery_area'
scope=both;
System altered.
SQL> alter database archivelog;
Database altered.
SQL> alter database flashback;
alter database flashback
ERROR at line 1:
ORA-38722: ON or OFF expected.
SQL> alter database flashback on;
Database altered.
SQL> alter database open;
Database altered.
SQL>
NAME
--------- ------------ ------------
ORCL
SQL>
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7199290/viewspace-1115422/ ,如需转载,请注明出处,否则将追究法律责任。