有同事找到我,本地测试数据库无法连接,根据问题描述,初步判断是 oracle服务并未注册到监听上,想来是一个比较简单的问题,alter system register就可以搞定。
接手后,查看监听内容,lsnrctl status 一切正常,今天的内容重点不在这里,就具体不展示截图了。
sqlplus / as sysdba select open_mode from v$database; --mount 库未打开
第一重:alter database open
ORA-00320: cannot read file header from log 2 of thread 1
ORA-00312: online log 2 thread 1: '/u01/oracle/oradata/orcl/redo02.log'
ORA-27091: unable to queue I/O
ORA-27069: attempt to do I/O beyond the range of the file
根据MOS上的表述: Alter Database Open Fails with ORA-00321,ORA-00312 and ORA-27069 (文档 ID 465914.1)
The redo log file size at OS level has become 0 bytes due to Hardware problem.
Perform the following Steps to Confirm the same.
Go to unix prompt :-
ls -lrt <location of the redo logfile reported in the error>
for example :-
ls -lrt /u01/oradata/corrupt/redo_2b.log
-rw-r----- 1 oracle dba 0 Oct 21 23:51 redo_02b.log
Execute Select * from v$log at mount stage to check the actual size of the redo log file.
大致意思是 由于硬件的问题,物理上 redo log 变成了0 字节,根据我的观察,/u01/oracle/oradata/redo*.log 尤其是报错中的current redo02.log 是变成0了
根据MOS上的建议,如果报错中的redo 是current,那必须走 “不完全恢复”,MOS内容不再赘述。
第二重错误 不完全恢复
由于该数据库没有开启归档,没有任何RMAN备份。采用 隐含参数+介质恢复的办法。
SQL> create pfile='/u01/oracle/1.txt' from spfile;
文件已创建。
#############添加隐含参数##################
*._allow_resetlogs_corruption=TRUE
*._allow_error_simulation=TRUE
##########################################
SQL> shutdown immediate
ORA-01109: 数据库未打开
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup pfile ='d:\1.txt';
ORACLE 例程已经启动。
Total System Global Area 1581916160 bytes
Fixed Size 1336060 bytes
Variable Size 964693252 bytes
Database Buffers 603979776 bytes
Redo Buffers 11907072 bytes
数据库装载完毕。
ORA-01589: 要打开数据库则必须使用 RESETLOGS 或 NORESETLOGS 选项
SQL> alter database open resetlogs;
报错又来了:
Errors in file /u01/oracle/admin/orcl/udump/orcl_ora_26600.trc:
ORA-00704: bootstrap process failure
ORA-00704: bootstrap process failure
ORA-00600: internal error code, arguments: [4000], [8], [], [], [], [], [], []
Mon Oct 15 11:16:13 2018
Error 704 happened during db open, shutting down database
USER: terminating instance due to error 704
Instance terminated by USER, pid = 26600
查了很多资料,发现这是逻辑打开数据库中必不可缺的一环,不能轻易跳过,只能通过BBED 修复header来完成(此前,我从