今天看见群里讨论flashback,我在虚机上尝试了一下。
先做了如下操作:
之后在操作系统上删除/u01/app/oracle/oradata/gg1/flash01.dbf这个新增的文件
然后开始闪回
在告警日志中发现如下信息:
可见flashback,自动的帮助我们restore了datafile,真是意想不到啊。
先做了如下操作:
点击(此处)折叠或打开
- SQL> create restore point p1;
- Restore point created.
- SQL> create tablespace flash datafile \'/u01/app/oracle/oradata/gg1/flash01.dbf\' size 8m;
- Tablespace created.
- SQL> grant connect,resource to flash identified by flash;
- Grant succeeded.
- SQL> create table flash.emp as select * from scott.emp;
- Table created.
- SQL> create restore point p2;
- Restore point created.
- SQL> truncate table flash.emp;
- Table truncated.
- SQL> create restore point p3;
- Restore point created.
然后开始闪回
点击(此处)折叠或打开
- SQL> shutdown immediate
- Database closed.
- Database dismounted.
- ORACLE instance shut down.
- SQL> startup mount
- ORACLE instance started.
- Total System Global Area 661209088 bytes
- Fixed Size 1338560 bytes
- Variable Size 423625536 bytes
- Database Buffers 230686720 bytes
- Redo Buffers 5558272 bytes
- Database mounted.
- SQL>
- SQL> flashback database to restore point p3;
- Flashback complete.
点击(此处)折叠或打开
- Mon Mar 09 21:41:08 2015
- flashback database to restore point p3
- Mon Mar 09 21:41:08 2015
- Errors in file /u01/app/oracle/diag/rdbms/gg1/gg1/trace/gg1_dbw0_7668.trc:
- ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
- ORA-01110: data file 7: \'/u01/app/oracle/oradata/gg1/flash01.dbf\'
- ORA-27037: unable to obtain file status
- Linux Error: 2: No such file or directory
- Additional information: 3
- Flashback Restore Start
- Deleted file /u01/app/oracle/oradata/gg1/flash01.dbf
- Flashback: deleted datafile #7 in tablespace #7 from control file.
- Flashback: dropped tablespace #7: \'FLASH\' from the control file.
- Flashback Restore Complete
- Flashback Media Recovery Start
- Serial Media Recovery started
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30202921/viewspace-1684288/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/30202921/viewspace-1684288/
本文详细介绍了在虚拟机环境下利用Flashback技术进行数据库文件恢复的操作流程,包括创建恢复点、创建闪回表空间、授权闪回用户、创建闪回表以及在删除相关文件后通过闪回命令恢复数据文件。文章最后分析了闪回过程中出现的错误日志,并解释了Flashback技术如何自动帮助恢复数据文件。
476

被折叠的 条评论
为什么被折叠?



