这是一个真实的案例,功能测试环境,AIX小型机突发故障宕机,数据库启动报错,功能的人找到了我,
让我来解决。
Connected to an idle instance.
SQL> startup
ORA-27041: unable to open file
查询该实例的数据文件,没有找到。
SQL> startup pfile='/opt/oracle/ora92/admin/vsfccbs/pfile/init.ora.4292009163955';
ORACLE instance started.
Total System Global Area 758089096 bytes
Fixed Size 742792 bytes
Variable Size 536870912 bytes
Database Buffers 218103808 bytes
Redo Buffers 2371584 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: '/dev/rccbs_system'(证明了我的猜想,表空间有使用裸设备而且不在现有可以使用的vg上面)
我发现该机器的2个vg:cbpvg、ccbsdbvg 不能使用了
oracle@cbp1:/opt/oracle>lspv
hdisk1 00c1ca2fa5a444db datavg active
hdisk23 00c1ca2f1a7add18 rootvg active
oracle@cbp1:/opt/oracle>
说明cbpvg、ccbsdbvg所使用的pv不在了,进行初步定位,发现是磁盘阵列没有被挂载上去。
找到试验室的管理员,要来一根好的光纤线,那接下来就接上去。
Oracle数据库接着出现这样的问题:
ORA-01147: SYSTEM tablespace file 1 is offline
ORA-01110: data file 1: '/dev/rccbs_system'
解决办法:
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
SQL> shutdown
ORA-01109: database not open
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.
ORA-01147: SYSTEM tablespace file 1 is offline
ORA-01110: data file 1: '/dev/rccbs_system' (糟糕,数据文件现在处于离线状态)
SQL> startup mount
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
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.
SQL> alter database datafile '/dev/rccbs_system' online;
Database altered.
SQL> startup
ORACLE instance started.
Total System Global Area 1610612736 bytes
Fixed Size 779080 bytes
Variable Size 535043256 bytes
Database Buffers 1073741824 bytes
Redo Buffers 1048576 bytes
Database mounted.
ORA-01113: file 1 needs media recovery (出现问题了,数据文件需要恢复。)
ORA-01110: data file 1: '/dev/rccbs_system'
解决方法:
SQL> RECOVER DATAFILE '/dev/rccbs_system '
Media recovery complete.
SQL> recover tablespace system;
Media recovery complete.
SQL> RECOVER DATABASE;
Media recovery complete.
SQL> ALTER DATABASE OPEN;
Database altered.
OK了 解决完毕。。。。
最后一句话,去除浮躁,认真学习,不断积累