ORACLE FLASHBACK DATABASE知识整理(五)

2014-11-24 15:03:36 · 作者: · 浏览: 4
1 IBM 500.55
2 HP 200.5
3 SONY 1200.5
4 ACER 55.6
5 MICROSOFT 108
13)重新启动并尝试打开数据库
[sql]
SQL> shutdown abort;
ORACLE instance shut down.
[sql]
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1272213504 bytes
Fixed Size 1336260 bytes
Variable Size 822086716 bytes
Database Buffers 436207616 bytes
Redo Buffers 12582912 bytes
Database mounted.
[sql]
SQL> alter database open resetlogs;
Database altered.
14) 打开后,指定表空间是OFFLINE的状态,符合闪回点的状态。
[sql]
SQL> select * from knight.keyboards;
select * from knight.keyboards
*
ERROR at line1:
ORA-00376: file7 cannot be read at this time
ORA-01110: datafile 7: '/ss/offline_space01.dbf'
15)使表空间online
[sql]
SQL> alter tablespace offline_space online;
Tablespace altered.
16) 没有新加入的数据
[sql]
SQL> select * from knight.keyboards;
ID COMPANY TYPE
------------------------------ --------------------
1 IBM 500.55
2 HP 200.5
3 SONY 1200.5
4 ACER 55.6
5 MICROSOFT 108
5.3 闪回点ONLINE,操作点OFFLINE
闪回失败,闪回后无论数据还是数据文件状态都是操作点的状态,并且使用了隐含参数,需要做全库备份。
1)确定当前时间
[sql]
SQL> select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;
TO_CHAR(SYSDATE,'YY
-------------------
2013-07-2720:56:32
2)确定当前SCN
[sql]
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
839748
3)查看表原始状态
[sql]
SQL> select * from knight.books;
ID NAME PRICE
------------------------------ ----------
1 LINUX 25.55
2 AIX 50.5
3 NETWORK 125.89
4 JAVA 88.99
5 JQUERY 102.98
4) 插入新数据,这些数据在闪回后应该不存在。
[sql]
SQL> insert into knight.books values(200,'WEBWORK',299.9);
1 row created.
5) 插入新数据,这些数据在闪回后应该不存在。
[sql]
SQL> insert into knight.books values(201,'PMP',56.99);
1 row created.
[sql]
SQL> commit;
Commit complete.
6) 表的新状态。
[sql]
SQL> select * from knight.books;
ID NAME PRICE
------------------------------ ----------
200 WEBWORK 299.9
201 PMP 56.99
1 LINUX 25.55
2 AIX 50.5
3 NETWORK 125.89
4 JAVA 88.99
5 JQUERY 102.98
7 rows selected.
7) 将表空间离线
[sql]
SQL> alter tablespace test_space offline;
Tablespace altered.
8)已经无法查询了
[sql]
SQL> select * from knight.books;
select * from knight.books
*
ERROR at line1:
ORA-00376: file5 cannot be read at this time
ORA-01110: datafile 5: '/ss/test_space01.dbf'
9)模拟断电
[sql]
SQL> shutdown abort;
ORACLE instance shut down.
10)启动至mount
[