Flashback database
已用时间: 00: 00: 00.43
22:31:38 scott@LEE>select * from test_two;
ID
----------
1
2
已用时间: 00: 00: 00.01
22:31:41 scott@LEE>trucate table test_two;
SP2-0734: 未知的命令开头 "trucate ta..." - 忽略了剩余的行。
22:35:06 scott@LEE>truncate table test_two;
表被截断。
已用时间: 00: 00: 00.01
22:35:16 scott@LEE>select *from test_two;
未选定行
已用时间: 00: 00: 00.01
22:35:22 scott@LEE>flashback database to timestamp
22:36:07 2 to_timestamp('2008-06-12 22:31:38','yyyy-mm-dd hh24:mi:ss');
flashback database to timestamp
*
第 1 行出现错误:
ORA-01031: 权限不足
已用时间: 00: 00: 00.37
22:37:14 scott@LEE>disconn
从 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options 断开
22:37:30 scott@LEE>conn scott/tiger as sysdba
已连接。
22:37:41 sys@LEE>flashback database to timestamp
22:37:44 2 to_timestamp('2008-06-12 22:31:38','yyyy-mm-dd hh24:mi:ss');
flashback database to timestamp
*
第 1 行出现错误:
ORA-38757: 要闪回数据库, 数据库必须已装载但不能打开。
已用时间: 00: 00: 00.04
22:37:45 sys@LEE>shutdown immediate
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
22:38:44 sys@LEE>startup mount
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE 例程已经启动。
Total System Global Area 440401920 bytes
Fixed Size 1249440 bytes
Variable Size 142610272 bytes
Database Buffers 289406976 bytes
Redo Buffers 7135232 bytes
数据库装载完毕。
22:38:58 sys@LEE>flashback database to timestamp
22:39:01 2 to_timestamp('2008-06-12 22:31:38','yyyy-mm-dd hh24:mi:ss');
闪回完成。
已用时间: 00: 00: 14.09
22:39:17 sys@LEE>alter database open resetlogs;
数据库已更改。
已用时间: 00: 00: 58.17
22:40:55 sys@LEE>select *from test_two;
select *from test_two
*
第 1 行出现错误:
ORA-00942: 表或视图不存在
已用时间: 00: 00: 00.01
22:41:08 sys@LEE>select *from scott.test_two;
ID
----------
1
2
已用时间: 00: 00: 00.04
22:41:59 sys@LEE>
Flashback database ------------回闪之后打开只读来检查
C:\Documents and Settings\Administrator>sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on 星期五 6月 13 10:06:11 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
10:06:11 idle>conn a/a as sysdba
已连接。
10:07:14 sys@LEE>desc scott.test_two;
名称 是否为空? 类型
----------------------------------------------------------------------------------- -------- ------
--------------------------------------------------
ID NUMBER
(38)
10:07:54 sys@LEE>select *from scott.test_two;
ID
----------
1
2
已用时间: 00: 00: 00.01
10:08:07 sys@LEE>insert into scott.test_two values(31);
已创建 1 行。
已用时间: 00: 00: 00.04
10:08:34 sys@LEE>insert into scott.test_two values(32);
已创建 1 行。
已用时间: 00: 00: 00.00
10:08:39 sys@LEE>insert into scott.test_two values(33);
已创建 1 行。
已用时间: 00: 00: 00.00
10:08:42 sys@LEE>commit;
提交完成。
已用时间: 00: 00: 00.03
10:08:45 sys@LEE>select *from scott.test_two;
ID
----------
1
2
31
32
33
已用时间: 00: 00: 00.00
10:08:55 sys@LEE>select current_Scn from v$database;
CURRENT_SCN
-----------
41254019
已用时间: 00: 00: 00.17
10:09:31 sys@LEE>shutdown immediate
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
10:10:15 sys@LEE>startup mount
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE 例程已经启动。
Total System Global Area 440401920 bytes
Fixed Size 1249440 bytes
Variable Size 150998880 bytes
Database Buffers 281018368 bytes
Redo Buffers 7135232 bytes
数据库装载完毕。
10:10:33 sys@LEE>flashback database to scn 41254019;
闪回完成。
已用时间: 00: 00: 11.34
10:11:20 sys@LEE>alter database open read only; //打开只读模式,进行检查
数据库已更改。
已用时间: 00: 00: 05.73
10:11:42 sys@LEE>conn scott/tiger
已连接。
10:11:53 scott@LEE>select *from test_two;
ID
----------
1
2
31
32
33
已用时间: 00: 00: 00.14
10:12:01 scott@LEE>conn a/a as sysdba
已连接。
10:12:21 sys@LEE>shutdown immediate
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
10:13:07 sys@LEE>startup mount
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE 例程已经启动。
Total System Global Area 440401920 bytes
Fixed Size 1249440 bytes
Variable Size 150998880 bytes
Database Buffers 281018368 bytes
Redo Buffers 7135232 bytes
数据库装载完毕。
10:13:21 sys@LEE>alter database open resetlogs;
数据库已更改。
已用时间: 00: 00: 33.70
10:14:06 sys@LEE>select * from scott.test_two;
ID
----------
1
2
31
32
33
已用时间: 00: 00: 00.20
10:14:46 sys@LEE>
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11134734/viewspace-344616/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/11134734/viewspace-344616/