今天,接到贵阳同事申告,说机房意外断电后数据库起不来了,状况如下:
看到启动报错,第一反应是归档路径发生变更了,于是使用如下语句手工创建pfile文件,查看
CREATE pfile='c:\initorcl.ora' from spfile='D:\app\Administrator\product\11.2.0\dbhome_1\database\SPFILEMYDB.ORA';
打开initorcl.ora查看,果然不出所料: log_archive_dest_1 = "location=F:\backup\arch",经过查找,发现原先在F盘的f:\backup\arch变成了i:\backup\arch
processes = 1000
memory_target = 26240M
control_files = "D:\APP\ADMINISTRATOR\ORADATA\ORCL\CONTROL01.CTL"
control_files = "D:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\CONTROL02.CTL"
control_file_record_keep_time= 30
db_block_size = 8192
compatible = "11.2.0.0.0"
log_archive_dest_1 = "location=F:\backup\arch"
log_archive_format = "arch_%r_%t_%s.arc"
db_recovery_file_dest = "D:\app\Administrator\flash_recovery_area"
db_recovery_file_dest_size= 3912M
undo_tablespace = "UNDOTBS1"
remote_login_passwordfile= "EXCLUSIVE"
db_domain = ""
dispatchers = "(PROTOCOL=TCP) (SERVICE=orclXDB)"
session_cached_cursors = 3000
audit_file_dest = "D:\APP\ADMINISTRATOR\ADMIN\ORCL\ADUMP"
audit_trail = "DB"
db_name = "orcl"
open_cursors = 300
deferred_segment_creation= FALSE
_optimizer_use_feedback = FALSE
diagnostic_dest = "D:\APP\ADMINISTRATOR"
于是,将错就错将pfile的 log_archive_dest_1 的值改为 "location=I:\backup\arch",然后执行startup nomount pfile=c:\initorcl.ora,发现能够startup nomount了,但是alter database open报错:
SQL>alter database open;
Errors in file d:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_dbw0_3256.trc:
ORA-01157: cannot identify/lock data file 14 - see DBWR trace file
ORA-01110: data file 14: 'E:\BMI\TSP_DW_BILL_01.DBF'
ORA-27041: unable to open file
OSD-04002: 无法打开文件
O/S-Error: (OS 21) 设备未就绪。
再查看操作系统磁盘驱动盘符,发现系统里没有E、F盘,令人意外的是光驱竟然使用了E盘:
经与系统负责人沟通确认,决定重启服务器后,修改驱动盘符后,然后再启动数据库,修改后的磁盘驱动盘符
(当然,E、F盘的盘符必须对应Oracle数据库里参数文件、控制文件对应的归档路径、数据文件所在磁盘盘符):
系统盘符修正后,启动数据库正常:
C:\Users\Administrator>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期五 1月 6 10:45:46 2017
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select status from v$instance;
STATUS
------------
OPEN
SQL> archive log list;
数据库日志模式 存档模式
自动存档 启用
存档终点 F:\backup\arch
最早的联机日志序列 71586
下一个存档日志序列 71591
当前日志序列 71591
SQL>
看到启动报错,第一反应是归档路径发生变更了,于是使用如下语句手工创建pfile文件,查看
CREATE pfile='c:\initorcl.ora' from spfile='D:\app\Administrator\product\11.2.0\dbhome_1\database\SPFILEMYDB.ORA';
打开initorcl.ora查看,果然不出所料: log_archive_dest_1 = "location=F:\backup\arch",经过查找,发现原先在F盘的f:\backup\arch变成了i:\backup\arch
processes = 1000
memory_target = 26240M
control_files = "D:\APP\ADMINISTRATOR\ORADATA\ORCL\CONTROL01.CTL"
control_files = "D:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\CONTROL02.CTL"
control_file_record_keep_time= 30
db_block_size = 8192
compatible = "11.2.0.0.0"
log_archive_dest_1 = "location=F:\backup\arch"
log_archive_format = "arch_%r_%t_%s.arc"
db_recovery_file_dest = "D:\app\Administrator\flash_recovery_area"
db_recovery_file_dest_size= 3912M
undo_tablespace = "UNDOTBS1"
remote_login_passwordfile= "EXCLUSIVE"
db_domain = ""
dispatchers = "(PROTOCOL=TCP) (SERVICE=orclXDB)"
session_cached_cursors = 3000
audit_file_dest = "D:\APP\ADMINISTRATOR\ADMIN\ORCL\ADUMP"
audit_trail = "DB"
db_name = "orcl"
open_cursors = 300
deferred_segment_creation= FALSE
_optimizer_use_feedback = FALSE
diagnostic_dest = "D:\APP\ADMINISTRATOR"
于是,将错就错将pfile的 log_archive_dest_1 的值改为 "location=I:\backup\arch",然后执行startup nomount pfile=c:\initorcl.ora,发现能够startup nomount了,但是alter database open报错:
SQL>alter database open;
Errors in file d:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_dbw0_3256.trc:
ORA-01157: cannot identify/lock data file 14 - see DBWR trace file
ORA-01110: data file 14: 'E:\BMI\TSP_DW_BILL_01.DBF'
ORA-27041: unable to open file
OSD-04002: 无法打开文件
O/S-Error: (OS 21) 设备未就绪。
再查看操作系统磁盘驱动盘符,发现系统里没有E、F盘,令人意外的是光驱竟然使用了E盘:
经与系统负责人沟通确认,决定重启服务器后,修改驱动盘符后,然后再启动数据库,修改后的磁盘驱动盘符
(当然,E、F盘的盘符必须对应Oracle数据库里参数文件、控制文件对应的归档路径、数据文件所在磁盘盘符):
系统盘符修正后,启动数据库正常:
C:\Users\Administrator>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期五 1月 6 10:45:46 2017
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select status from v$instance;
STATUS
------------
OPEN
SQL> archive log list;
数据库日志模式 存档模式
自动存档 启用
存档终点 F:\backup\arch
最早的联机日志序列 71586
下一个存档日志序列 71591
当前日志序列 71591
SQL>