20110811

重建重做日志

最近使用数据库出现"ORA-01219: 数据库未打开:
仅允许在固定表/视图中查询"的错误,查了下alert日志,提示如下错误:

Errors in file
c:\oracle\product\10.2.0\admin\orcl\bdump\orcl_lgwr_4968.trc:
ORA-00313: Message 313 not found; product=RDBMS; facility=ORA
; arguments: [1] [1]
ORA-00312: Message 312 not found; product=RDBMS; facility=ORA
; arguments: [1] [1]
[C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO01.LOG]
ORA-27041: Message 27041 not found; product=RDBMS; facility=ORA
OSD-04002: 无法打开文件
O/S-Error: (OS 2) 系统找不到指定的文件。

很明显,redo.log文件破环,重做redo.log即可。

sqlplus /nolog

SQL> connect sys/sys as sysdba;

SQL> recover database until cancel;
Media recovery complete.

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database
open

--重新设置日志文件

SQL> alter database open resetlogs;
Database altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup;
ORACLE instance started.

Total System Global Area 126950220 bytes
Fixed Size 453452 bytes
Variable Size 109051904 bytes
Database Buffers 16777216 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.

--打完收招
SQL>exit

重启服务。OK,大功告成。
http://hi.baidu.com/%B9%FD%BA%D3%D0%A1%D7%E4_%B0%B2%C8%AB/blog/item/c4c7121e84820c6ff724e47f.html
http://topic.csdn.net/t/20060105/17/4500245.html