sqlpus报错"ORA-01033: ORACLE initialization or shutdown in progress",且数据库状态是"ORA-01507: database not m
2011-11-22 10:22
676 查看
Oracle异常不能访问会话
今天在一个项目排除用户使用错误时,需要登录Oracle数据库进行查询和修改。但是,意外发现普通用户无法访问oracle instance。SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jul 12 10:30:54 2010 Copyright (c) 1982, 2005, Oracle. All rights reserved. ERROR: ORA-01033: ORACLE initialization or shutdown in progress Enter user-name:
不过,以
connect as sysdba方式可以使用
ORA-01033: ORACLE initialization or shutdown in progress
对系统状态进行检查:
STATUS DATABASE_STATUS ------------ ----------------- STARTED ACTIVE
select open_mode from v$database * ERROR at line 1: ORA-01507: database not mounted
以上看到instance已经启动,但是数据库没有mounted。
尝试mount数据库
alter database mount * ERROR at line 1: ORA-01102: cannot mount database in EXCLUSIVE mode
这个问题比较奇特,似乎是数据库状态不正常,处于维护状态(no mounted),所以普通用户无法使用。
不过,此 时,整个邮件系统使用尚正常,连接数据库的邮件系统能够正常收发邮件。(应用正常)
这个问题可能和我上次数据库故障 (无法使用sqlplus登录进行shutodown,不得已kill了oracle进程)有关。那次kill掉oracle进程后,也不能正常使用 sqlplus,被迫硬关机服务器。在那次故障处理时,数据库已经启动了,但是我再次使用
slqplus "/ as sysdba", 并再次
startup的报错情况有关。此时oracle对于后启动的命令没有正常显示mount,也不能分配资源。(Oracle数据库启动后,如果再尝试 startup
,会报错误 ORA-01102: cannot mount database in EXCLUSIVE mode)
解决方案参考
参考: http://www.orafaq.com/forum/t/40030/2/数 据库默认是以
EXCLUSIVE模式启动。然而,
ORA-01102错误是误导的并且可能由于 以下原因出现:
在
ORACLE_HOME/dbs目录中仍然存在
sgadef<sid>.dbf文件
Oracle进程(
pmon,
smon,
lgwr和
dbwr) 仍然存在
共享内存段(shared memory segments,SGA)和信号灯(semaphores)在数据库关闭以后仍然存在
存在一个
ORACLE_HOME/dbs/lk<sid>文件
这个
lk<sid>和
sgadef<sid>.dbf文件是用来锁住共享内存的。这意味着即使没有内存分配,Oracle仍然认为内存被锁住了。通过移除
sgadef和
lk文件,就移除了通知Oracle共享内存被使用的信息。这样数据库就可以启动了。
可能的解决方案
通过以下步骤确保数据库已经干 净地关闭了检查在
ORACLE_HOME/dbs目录中没有
sgadef<sid>.dbf文件
检查没有任何后题属于”oracle”用户的进程
------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x8abda088 0 oracle 640 1243611136 26 0x71655724 65538 oracle 640 1243611136 13 ------ Semaphore Arrays -------- key semid owner perms nsems 0xf0bfd328 196610 oracle 640 154 0x3aec371c 589835 oracle 640 154 ------ Message Queues -------- key msqid owner perms used-bytes messages
如果有属于oracle用户的共享段或信号,移除它
$ORACLE_HOME/dbs/lk<sid>文件
现在可以启动数据库了
实际解决过程操作记录
首先尝试关闭数据库ORA-01507: database not mounted ORACLE instance shut down.
但是,此时检查后台进程仍然存在oracle进程
oracle 3642 1 0 Jul09 ? 00:00:00 ora_pmon_umail oracle 3644 1 0 Jul09 ? 00:00:00 ora_psp0_umail oracle 3646 1 0 Jul09 ? 00:00:05 ora_mman_umail oracle 3655 1 0 Jul09 ? 00:00:30 ora_dbw0_umail oracle 3657 1 0 Jul09 ? 00:00:10 ora_lgwr_umail oracle 3659 1 0 Jul09 ? 00:00:00 ora_ckpt_umail oracle 3661 1 0 Jul09 ? 00:00:14 ora_smon_umail oracle 3663 1 0 Jul09 ? 00:00:00 ora_reco_umail oracle 3665 1 0 Jul09 ? 00:00:06 ora_cjq0_umail oracle 3667 1 0 Jul09 ? 00:00:24 ora_mmon_umail oracle 3669 1 0 Jul09 ? 00:00:00 ora_mmnl_umail oracle 3671 1 0 Jul09 ? 00:00:00 ora_d000_umail oracle 3673 1 0 Jul09 ? 00:00:00 ora_s000_umail oracle 3807 1 0 Jul09 ? 00:00:00 ora_qmnc_umail oracle 4058 1 0 Jul09 ? 00:00:05 ora_q000_umail oracle 4816 1 0 Jul09 ? 00:00:00 ora_q001_umail oracle 25615 1 0 13:05 ? 00:00:00 ora_j000_umail
但是这时候再尝试关闭数据库会报错,显示oracle不在运行。
ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist Linux Error: 2: No such file or directory
杀死Oracle后台进程
------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x8abda088 0 oracle 640 1243611136 0 ------ Semaphore Arrays -------- key semid owner perms nsems 0xf0bfd328 196610 oracle 640 154 ------ Message Queues -------- key msqid owner perms used-bytes messages
删除共享内存段
------ Shared Memory Segments -------- key shmid owner perms bytes nattch status ------ Semaphore Arrays -------- key semid owner perms nsems 0xf0bfd328 196610 oracle 640 154 ------ Message Queues -------- key msqid owner perms used-bytes messages
删除信号
------ Shared Memory Segments -------- key shmid owner perms bytes nattch status ------ Semaphore Arrays -------- key semid owner perms nsems ------ Message Queues -------- key msqid owner perms used-bytes messages
删除
lk<sid>
ORACLE instance started. Total System Global Area 1241513984 bytes Fixed Size 1219136 bytes Variable Size 134219200 bytes Database Buffers 1090519040 bytes Redo Buffers 15556608 bytes Database mounted. Database opened.
启动时检查数据库日志,确保没有意外报错
STATUS DATABASE_STATUS ------------ ----------------- OPEN ACTIVE
OPEN_MODE ---------- READ WRITE
这表明数据库状态已经恢复正常。
相关文章推荐
- Oracle登录失败,ORA-01033:ORACLE initialization or shutdown in progress && ORA-00313 无法打开日志组3(用于线程1)的成员……
- ORACLE数据库文件损坏,Error:ORA-01033:ORACLE initialization or shutdown in progress
- ORACLE数据库文件损坏,Error:ORA-01033:ORACLE initialization or shutdown in progress解决 .
- ORACLE数据库文件损坏,Error:ORA-01033:ORACLE initialization or shutdown in progress
- ora-01033:oracle initialization or shutdown in progress 解决方法
- 解决方案 ERROR: ORA-01033: ORACLE initialization or shutdown in progress
- ORA-01033: ORACLE initialization or shutdown in progress错误解决办法
- ORA-01033:ORACLE initialization or shutdown in progress
- ORA-01033: ORACLE initialization or shutdown in progress
- ora-01033:oracle initialization or shutdown in progress 解决方法
- ORA-01033: ORACLE initialization or shutdown in progress 解决办法
- ora-01033:oracle initialization or shutdown in progress 解决方法
- ora-01033:oracle initialization or shutdown in progress的一种解决办法
- ORA-01033: ORACLE initialization or shutdown in progress
- ORA-01033: ORACLE initialization or shutdown in progress
- ora-01033:oracle initialization or shutdown in progress;
- Oracle ORA-01033: ORACLE initialization or shutdown in progress 错误解决办法
- Oracle ORA-01033: ORACLE initialization or shutdown in progress 错误解决办法
- ORA-01033: ORACLE initialization or shutdown in progress 因误删表空间文件导致的解决方案
- ora-01033:oracle initializationg or shutdown in progress