三思笔记
因为稍微遇到点问题,所以记一下
因为oracle运行过程中自动锁定联机重做日志,所以手动删除联机重做日志,下面记录,丢失非当前联机重做日志文件的恢复方法
1,查看联机重做日志的状态
[oracle@cindy ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Sun Aug 31 23:55:30 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select group#,thread#,sequence#,members,archived,status from v$log;
GROUP# THREAD# SEQUENCE# MEMBERS ARC STATUS
---------- ---------- ---------- ---------- --- ----------------
1 1 1 1 NO CURRENT
2 1 0 1 YES UNUSED
3 1 0 1 YES UNUSED
SQL> select group#,member from v$logfile;
GROUP#
----------
MEMBER
--------------------------------------------------------------------------------
3
/u02/oradata/ora11g/redo03.log
2
/u02/oradata/ora11g/redo02.log
1
/u02/oradata/ora11g/redo01.log
可见group# 为3的是非当前
2,shutdown immediate,然后手动删除redo03
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
[oracle@cindy ~]$ cd /u02/oradata/ora11g
[oracle@cindy ora11g]$ ls
cindy01.dbf control01.ctl example01.dbf redo01.log redo02.log redo03.log sysaux01.dbf system01.dbf temp01.dbf undotbs01.dbf users01.dbf
[oracle@cindy ora11g]$ rm redo03.log
3,启动数据库,报错
SQL> startup
ORACLE instance started.
Total System Global Area 417546240 bytes
Fixed Size 2228944 bytes
Variable Size 322964784 bytes
Database Buffers 88080384 bytes
Redo Buffers 4272128 bytes
Database mounted.
ORA-03113: end-of-file on communication channel
Process ID: 4134
Session ID: 1 Serial number: 5
此时报错信息与书上不同,恕我是个菜鸟,也百度了,解决办法很多,但是未找到我想要的,最后在朋友的提醒下,是启动方式不对,恢复的时候不要用startup
故
4,shutdown abort
SQL> shutdown abort;
ORACLE instance shut down.
5,启动到mount状态
SQL> startup mount;
ORACLE instance started.
Total System Global Area 417546240 bytes
Fixed Size 2228944 bytes
Variable Size 322964784 bytes
Database Buffers 88080384 bytes
Redo Buffers 4272128 bytes
Database mounted.
6,重建该组重做日志
SQL> alter database clear logfile group 3;
Database altered.
7,打开数据库
SQL> alter database open;
Database altered.