崩溃恢复的起点和终点
崩溃恢复的起点和终点准备三个会话:SESSION A:SESSION A>create tablespace test datafile '/tmp/test.dbf' size 1m reuse;表空间已创建。SESSION A> create table t(id number) tablespace test;表已创建。SESSION A> create or replace procedure p_instance_recovery_demo is2 i number;3 begin4 for i in 1..100 loop5 insert into t values (i);6 commit;7 dbms_lock.sleep(1);8 end loop;9 end p_instance_recovery_demo;10 /过程已创建。SESSION A>col member for a30;SESSION A>col member for a30;SESSION A>select group#,sequence#,archived,status,first_change# from v$log;GROUP# SEQUENCE# ARCHIVED STATUS FIRST_CHANGE#---------- ---------- --------- ------------------------------------------------ -------------1 34 YES INACTIVE 16574652 35 YES INACTIVE 16575343 36 NO CURRENT 1677594SESSION A>select * from v$logfile;GROUP# STATUS TYPE MEMBER IS_RECOVE---------- --------------------- --------------------- ------------------------------ ---------3 ONLINE /u01/app/oracle/oradata/myorcl NO/redo03.log2 ONLINE /u01/app/oracle/oradata/myorcl NO/redo02.log1 ONLINE /u01/app/oracle/oradata/myorcl NO/redo01.logSESSION A>alter system switch logfile;系统已更改。SESSION A>SESSION A>SESSION A>select group#,sequence#,archived,status,first_change# from v$log;GROUP# SEQUENCE# ARCHIVED STATUS FIRST_CHANGE#---------- ---------- --------- ------------------------------------------------ -------------1 37 NO CURRENT 16782242 35 YES INACTIVE 16575343 36 YES ACTIVE 1677594SESSION A>exec p_instance_recovery_demo;SESSION b:SESSION b>ID----------LOCATION--------------------------------------------------------------------------------15_1325_1335_13ID----------LOCATION--------------------------------------------------------------------------------45_1355_1365_13ID----------LOCATION--------------------------------------------------------------------------------75_1385_1395_13......后面还有很多数据注意让他显示在一个块上,基本上有个20条左右,就可以切换到session C了SESSION C:SESSION C>alter system checkpoint;系统已更改。SESSION C> shutdown abort;ORACLE 例程已经关闭。SESSION A:SESSION A>exec p_instance_recovery_demo;BEGIN p_instance_recovery_demo; END;*第 1 行出现错误:ORA-03113: 通信通道的文件结尾进程 ID:5536会话 ID: 191 序列号: 7然后新启一个会话:BBED> set file 5FILE#上一个:rac把数据文件创建在不共享的地方
下一个:Oracle数据库维护日常知识