FLASHBACK RECOVERY AREA (二)

FLASHBACK RECOVERY AREA (一)

前面讨论了flashback recovery area的概念,现在实验怎样在数据库中启用FLASHBACK RECOVERY AREA

[@more@]1)、检查数据库是否在archive模式:
SQL> startup mount;
ORACLE instance started.

Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 96471284 bytes
Database Buffers 67108864 bytes
Redo Buffers 2973696 bytes
Database mounted.
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oradata/RAC/archive/
Oldest online log sequence 33
Next log sequence to archive 34
Current log sequence 34
如果数据库没有运行在archive模式,首先启用数据库的归档模式 alter database archivelog;
2)、设置db_recovery_file_dest_size和db_recovery_file_dest参数
alter system set db_recovery_file_dest_size=2G scope=BOTH;
alter system set db_recovery_file_dest='/oradata/RAC' scope=BOTH;

SQL> alter system set db_recovery_file_dest_size=2G scope=BOTH;

System altered.

SQL> alter system set db_recovery_file_dest='/oradata' SCOPE=BOTH;

System altered.

SQL> show parameter db_recovery

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /oradata
db_recovery_file_dest_size big integer 2G

3)、执行alter database flashback on;启用flashback数据库

SQL> alter database flashback on;

Database altered.

SQL> alter database open;

Database altered.

查询database视图确认数据库是否启用flashback功能.
SQL> select flashback_on from v$database;

FLASHBACK_ON
------------------
YES
也可以通过alert日志观察到:
[oracle@rac1 bdump]$ tail -100 alert_rac1.log
MMNL started with pid=16, OS id=15798
Fri Sep 7 11:27:20 2007
Reconfiguration started (old inc 0, new inc 2)
List of nodes:
0
Global Resource Directory frozen
* allocate domain 0, invalid = TRUE
Communication channels reestablished
Master broadcasted resource hash value bitmaps
Non-local Process blocks cleaned out
Fri Sep 7 11:27:20 2007
LMS 0: 0 GCS shadows cancelled, 0 closed
Set master node info
Submitted all remote-enqueue requests
Dwn-cvts replayed, VALBLKs dubious
All grantable enqueues granted
Post SMON to start 1st pass IR
Fri Sep 7 11:27:20 2007
LMS 0: 0 GCS shadows traversed, 0 replayed
Fri Sep 7 11:27:20 2007
Submitted all GCS remote-cache requests
Post SMON to start 1st pass IR
Fix write in gcs resources
Reconfiguration complete
LCK0 started with pid=19, OS id=15821
Fri Sep 7 11:27:22 2007
ALTER DATABASE MOUNT
Fri Sep 7 11:27:22 2007
This instance was first to mount
Setting recovery target incarnation to 2
Fri Sep 7 11:27:26 2007
Successful mount of redo thread 1, with mount id 2220657114
Fri Sep 7 11:27:26 2007
Database mounted in Shared Mode (CLUSTER_DATABASE=TRUE)
Completed: ALTER DATABASE MOUNT
Fri Sep 7 11:30:26 2007
ALTER SYSTEM SET db_recovery_file_dest_size='2G' SCOPE=BOTH;
Fri Sep 7 11:31:18 2007
WARNING: db_recovery_file_dest is same as db_create_file_dest
Fri Sep 7 11:31:18 2007
ALTER SYSTEM SET db_recovery_file_dest='/oradata' SCOPE=BOTH;
Fri Sep 7 11:32:39 2007
alter database flashback on
Fri Sep 7 11:32:39 2007
db_recovery_file_dest_size of 2048 MB is 40.98% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
Allocated 3981204 bytes in shared pool for flashback generation buffer
Starting background process RVWR
RVWR started with pid=24, OS id=22925
Fri Sep 7 11:32:40 2007
Flashback Database Enabled
Turn database flashback on at SCN 2142614
Completed: alter database flashback on
Fri Sep 7 11:32:57 2007
alter database open
......
......
......
SMON: enabling tx recovery
Fri Sep 7 11:33:04 2007
Database Characterset is ZHS16GBK
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC
QMNC started with pid=28, OS id=23457
Fri Sep 7 11:33:23 2007
Completed: alter database open
如果要在RAC环境启用FLASHBACK RECOVERY AREA,将其中一个节点mount,shutdown其他节点,在mount的节点上进行上面的操作。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/129805/viewspace-968327/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/129805/viewspace-968327/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值