Weakness Of Flashback
it would fail as a result of controlfile recreate ,
drop tablespace ,
shrink datafile.
1)controlfile receate would disable flashback.
1@@@@prepare
@@@backup controlfile
RMAN> backup current controlfile format '/u01/app/oracle/flash_recovery_area/
ORCL/man_backup_controlfile/controlfile_2011_11_28.bkp';
@@@find the flashback time point.
SQL> select sysdate from dual;
SYSDATE
-------------------
2011-11-28 01:26:05
@@@remove controlfile
SQL> show parameter control
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
control_files string /u01/app/oracle/oradata/orcl/c
ontrol01.ctl, /u01/app/oracle/
oradata/orcl/control02.ctl, /u
01/app/oracle/oradata/orcl/con
trol03.ctl
[oracle@station3 orcl]$ rm -rf /u01/app/oracle/oradata/orcl/control*
[oracle@station3 autobackup]$ rm -rf /u01/app/oracle/flash_recovery_area
/ORCL/autobackup/*
@@@controlfile also work,when you shutdown with 'immediate' option.
SQL> shutdown immediate
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/orcl/control01.ctl'
ORA-27041: unable to open file
Linux Error: 2: No such file or directory
Additional information: 3
SQL> shutdown abort
ORACLE instance shut down.
2@@@@begin rescue
@@@
RMAN> restore controlfile from '/u01/app/oracle/flash_recovery_area/
ORCL/man_backup_controlfile/controlfile_2011_11_28.bkp';
RMAN> alter database mount;
RMAN> recover database;
RMAN> alter database open resetlogs;
database opened
3@@@@check result.
@@@
SQL> shutdown immediate
SQL> startup mount;
RMAN> flashback database to time "to_date('2011-11-28 01:26:05',
2> 'yyyy-mm-dd:hh24:mi:ss')";
starting media recovery
media recovery failed
RMAN-00571: =================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===
RMAN-00571: =================================================
RMAN-03002: failure of flashback command at 11/28/2011 01:43:21
ORA-38729: Not enough flashback database log data to do FLASHBACK.
@@@
@@@OLDEST_FLASHBACK_TIME > that time before.
SQL> select OLDEST_FLASHBACK_SCN ,OLDEST_FLASHBACK_TIME
from v$flashback_database_log;
OLDEST_FLASHBACK_SCN OLDEST_FLASHBACK_TI
-------------------- -------------------
757257 2011-11-28 01:38:32
2)shrink datafile would disable flashback.
1@@@@prepare
@@@modify the time format is convenient for flashback.
[oracle@station3 ~]$ vim .bash_profile
@@@add the line.
export NLS_DATE_FORMAT="yyyy-mm-dd hh24:mi:ss"
[oracle@station3 ~]$ . .bash_profile
SQL> select sysdate from dual;
SYSDATE
-------------------
2011-11-28 01:49:02
@@@check the enterprise manager=> tablespace => real used space.
[oracle@station3 orcl]$ du -sh /u01/app/oracle/oradata/orcl/example01.dbf
101M example01.dbf
@@@shrink datafile.the rowid changed.
SQL> alter database datafile '/u01/app/oracle/oradata/orcl/example01.dbf' resize 70M;
Database altered.
2@@@@begin
SQL> shutdown immediate;
SQL> startup mount;
[oracle@station3 orcl]$ rman target /
RMAN> flashback database to time "to_date
('2011-11-28 01:49:02','yyyy-mm-dd hh24:mi:ss')";
starting media recovery
media recovery failed
RMAN-00571: =======================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =========
RMAN-00571: =======================================================
RMAN-03002: failure of flashback command at 11/28/2011 01:57:53
ORA-38766: cannot flashback data file 5; file resized smaller
ORA-01110: data file 5: '/u01/app/oracle/oradata/orcl/example01.dbf'
SQL> alter database open;
3@@@@check
@@@through the OLDEST_FLASHBACK_TIME include that time before,
@@@you could not flashback database to that time.
SQL> select OLDEST_FLASHBACK_SCN,OLDEST_FLASHBACK_TIME
from v$flashback_database_log;
OLDEST_FLASHBACK_SCN OLDEST_FLASHBACK_TI
-------------------- -------------------
757257 2011-11-28 01:38:32
SQL> select sysdate from dual;
SYSDATE
-------------------
2011-11-28 02:01:56
3)drop tablespace would disable flashback
1@@@@prepare
@@@
SQL> create tablespace temp_permanent datafile
'/u01/app/oracle/oradata/orcl/t_permanent.dbf' size 100M;
Tablespace created.
SQL> select sysdate from dual ;
SYSDATE
-------------------
2011-11-28 02:36:17
SQL> drop tablespace temp_permanent;
Tablespace dropped.
@@@
RMAN> backup tablespace temp_permanent;
2@@@@begin
@@@famous error: "unnamed00007"
RMAN> flashback database to time "to_date
('2011-11-28 02:36:17','yyyy-mm-dd hh24:mi:ss')";
starting media recovery
media recovery failed
RMAN-00571: =======================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ==========
RMAN-00571: ======================================================
RMAN-03002: failure of flashback command at 11/28/2011 02:40:09
ORA-38795: warning: FLASHBACK succeeded but OPEN RESETLOGS would get error below
ORA-01245: offline file 7 will be lost if RESETLOGS is done
ORA-01111: name for data file 7 is unknown - rename to correct file
ORA-01110: data file 7: '/u01/app/oracle/product/10.2.0/db_1/dbs/UNNAMED00007'
@@@???(continue.......)
RMAN> restore tablespace temp_permanent
RMAN-00571: =======================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ==========
RMAN-00571: ======================================================
RMAN-03002: failure of restore command at 11/28/2011 02:47:16
RMAN-06085: must use SET NEWNAME command to restore
datafile /u01/app/oracle/product/10.2.0/db_1/dbs/UNNAMED00007
@@@
RMAN> flashback database to time "to_date
('2011-11-28 02:35:17','yyyy-mm-dd hh24:mi:ss')";
RMAN> alter database open resetlogs;
database opened
Weakness Of Flashback
原创emperor_majesty 博主文章分类:B_Recovery ©著作权
©著作权归作者所有:来自51CTO博客作者emperor_majesty的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:Logfile Overview
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
flashback
你可能发现表中的数据被不正确的修改了,你可以使用duo
flashback 闪回 数据 2d sql -
flashback query
&n
timestamp flashback 闪回查询