[20150128]关于flashback补充.txt
--昨天别人问restore point的信息保存在那里,我想一定在控制文件里面,这个很容易验证.
--而且一旦flashback 日志删除,无法定位restore point的名字.继续昨天的测试:
1.建立测试环境:
SYS@test> @ &r/ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- ----------------------------------------------------------------
x86_64/Linux 2.4.xx 10.2.0.4.0 Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
SYS@test> startup mount
ORACLE instance started.
Total System Global Area 473956352 bytes
Fixed Size 2084776 bytes
Variable Size 230686808 bytes
Database Buffers 230686720 bytes
Redo Buffers 10498048 bytes
Database mounted.
SYS@test> alter database flashback on;
Database altered.
SYS@test> show parameter control
NAME TYPE VALUE
------------------------------------ -------- -------------------------------------------------------------------------------------------------
control_file_record_keep_time integer 7
control_files string /mnt/ramdisk/test/control01.ctl, /mnt/ramdisk/test/control02.ctl, /mnt/ramdisk/test/control03.ctl
$ strings /mnt/ramdisk/test/control01.ctl | grep -i itpubitpub
SYS@test> create restore point itpubitpub GUARANTEE flashback database;
Restore point created.
SYS@test> select * from v$restore_point;
SCN DATABASE_INCARNATION# GUA STORAGE_SIZE TIME NAME
------------ --------------------- --- ------------ -------------------------------- --------------------
11996002239 8 YES 8192000 28-JAN-15 08.35.14.000000000 AM ITPUBITPUB
2.检测:
SYS@test> column RSPNAME format a20
SYS@test> select * from x$kccrsp;
ADDR INDX INST_ID RSPNAME RSPINCARN RSPSCN RSPTIME RSPLGSZ RSPFLAGS RSPFSCN
---------------- ------------ ------------ -------------------- ------------ ---------------- -------------------- -------- -------- ----------------
00007F3E7FD0A480 0 1 ITPUBITPUB 8 11996002239 01/28/2015 08:35:14 8192000 3 11996002240
$ strings -t d /mnt/ramdisk/test/control01.ctl | grep -i itpubitpub
5308439 3ITPUBITPUB
--至少说明控制文件保存了restore point的信息.
$ mv flashback flashback.org
SYS@test> select * from v$restore_point;
select * from v$restore_point
*
ERROR at line 1:
ORA-38701: Flashback database log 1 seq 1 thread 1: "/u01/app/oracle/flash_recovery_area/TEST/flashback/o1_mf_bdjcljln_.flb"
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
SYS@test> select * from x$kccrsp;
select * from x$kccrsp
*
ERROR at line 1:
ORA-38701: Flashback database log 1 seq 1 thread 1: "/u01/app/oracle/flash_recovery_area/TEST/flashback/o1_mf_bdjcljln_.flb"
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
--如果删除flashback 日志,确实无法通过内部x$kccrsp视图定位.但是如果这样执行:
SYS@test> select RSPNAME from x$kccrsp;
RSPNAME
--------------------
ITPUBITPUB
SYS@test> select name from v$restore_point;
NAME
--------------------
ITPUBITPUB
--取消STORAGE_SIZE字段,其它都可以显示.
SYS@test> select scn,DATABASE_INCARNATION#,GUARANTEE_FLASHBACK_DATABASE,time,NAME from v$restore_point ;
SCN DATABASE_INCARNATION# GUA TIME NAME
------------ --------------------- --- --------------------------------- --------------------
11996002239 8 YES 28-JAN-15 08.35.14.000000000 AM ITPUBITPUB
--剩下的问题就好解决了.
SYS@test> alter database flashback off;
Database altered.
SYS@test> alter database open ;
alter database open
*
ERROR at line 1:
ORA-38701: Flashback database log 1 seq 1 thread 1: "/u01/app/oracle/flash_recovery_area/TEST/flashback/o1_mf_bdjcljln_.flb"
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
--GUARANTEE RESTORE POINT 存在,flashback 日志不存在,无法打开.
SYS@test> drop restore point itpubitpub;
Restore point dropped.
SYS@test> alter database open ;
Database altered.
--OK,现在正常了.