Oracle控制文件损坏报错场景
众所周知的,因控制文件损坏或者丢失导致数据库无法启动,这里说的是损坏或丢失,因为ctl文件在丢失和损坏时,其给出的现象是不同,
从而更利于我们判断其到底是什么问题导致。下面我就几种场景进行模拟:
1、控制文件直接丢失而无法启动报错
在启动时报ORA-00205错误,而alert里在mount阶段会报出ORA-27037及ORA-00210错误,说明ctl文件已经丢失物理文件一个或多个
SQL> startup;
ORACLE instance started.
Total System Global Area 6.0663E+10 bytes
Fixed Size 2268032 bytes
Variable Size 5637145728 bytes
Database Buffers 5.4895E+10 bytes
Redo Buffers 128344064 bytes
ORA-00205: error in identifying control file, check alert log for more info
ALTER DATABASE MOUNT
ORA-00210: cannot open the specified control file=========》》
ORA-00202: control file: ‘/oradata/TRSENDB/controlfile/ctl_01.ctl’
ORA-27037: unable to obtain file status=========》》
Linux-x86_64 Error: 2: No such file or directory=====》》》这里明确说明了报错原因
Additional information: 3
ORA-205 signalled during: ALTER DATABASE MOUNT.
2、控制文件因头文件信息无效而启动报错,启动时报错ORA-00205错误,但alert日志里的信息是ORA-27048
[oracle@gpsdb controlfile]$ dbfsize ctl_01.ctl
Database file: ctl_01.ctl
Database file type: file system
Database file size: 610 16384 byte blocks======》》ctl文件的block size为16k
[oracle@gpsdb controlfile]$ dd if=/dev/zero of=ctl_01.ctl bs=16384 count=1======》》》损坏头文件
1+0 records in
1+0 records out
16384 bytes (16 kB) copied, 7.1e-05 seconds, 231 MB/s
[oracle@gpsdb controlfile]$ dbv file=