删除online日志测试及ORA(3)

在CLEAR操作后,OS会创建相应的日志组成员文件,然后数据库就可以正常读取了,此时并不需要通过restore和recover对数据库进行恢复和还原即可
 
测试2:正常关库后,删除在线日志文件
 
ZLM@ora10g> select group#,thread#,status,archived from v$log;

GROUP#    THREAD# STATUS      ARC
---------- ---------- ---------------- ---
 1    1 CURRENT      NO
 2    1 INACTIVE      YES
 3    1 UNUSED      YES

ZLM@ora10g> insert into t1 select * from dba_objects where rownum<11;

10 rows created.

ZLM@ora10g> select count(*) from t1;

COUNT(*)
----------
20

ZLM@ora10g> alter system archive log current;

System altered.

ZLM@ora10g> select group#,thread#,status,archived from v$log;

GROUP#    THREAD# STATUS      ARC
---------- ---------- ---------------- ---
 1    1 ACTIVE      YES
 2    1 INACTIVE      YES
 3    1 CURRENT      NO

--正常关闭数据库
ZLM@ora10g> shutdown immediate
ORA-01031: insufficient privileges
ZLM@ora10g> conn / as sysdba
Connected.
SYS@ora10g> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@ora10g> 
 
--OS上删除current的在线日志文件redo03.log
[oracle@ora10g ~]$ cd /u01/app/oracle/oradata/ora10g
[oracle@ora10g ora10g]$ ls -l
total 1461348
-rw-r----- 1 oracle oinstall  7520256 Jun 24 11:03 control01.ctl
-rw-r----- 1 oracle oinstall  7520256 Jun 24 11:03 control02.ctl
-rw-r----- 1 oracle oinstall  7520256 Jun 24 11:03 control03.ctl
-rw-r----- 1 oracle oinstall 104865792 Jun 24 11:03 example01.dbf
-rw-r----- 1 oracle oinstall    172032 Nov 29  2014 indx01.dbf
-rw-r----- 1 oracle oinstall  52429312 Jun 24 11:02 redo01.log
-rw-r----- 1 oracle oinstall  52429312 Jun 24 10:49 redo02.log
-rw-r----- 1 oracle oinstall  52429312 Jun 24 11:03 redo03.log
-rw-r----- 1 oracle oinstall 283123712 Jun 24 11:03 sysaux01.dbf
-rw-r----- 1 oracle oinstall 587210752 Jun 24 11:03 system01.dbf
-rw-r----- 1 oracle oinstall  52436992 Jun 23 16:17 temp01.dbf
-rw-r----- 1 oracle oinstall 173023232 Jun 24 11:03 undotbs01.dbf
-rw-r----- 1 oracle oinstall  41951232 Jun 24 11:03 users01.dbf
-rw-r----- 1 oracle oinstall 100671488 Jun 24 11:03 zlm01.dbf
[oracle@ora10g ora10g]$ rm -f redo03.log
[oracle@ora10g ora10g]$ ls -l redo*
-rw-r----- 1 oracle oinstall 52429312 Jun 24 11:02 redo01.log
-rw-r----- 1 oracle oinstall 52429312 Jun 24 10:49 redo02.log
[oracle@ora10g ora10g]$ 
 
--启动数据库
SYS@ora10g> startup
ORACLE instance started.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/6d9cdedd800e70452f82f714bd7e9586.html