Oracle shutdown immediate遭遇ORA-24324 ORA-24323 ORA-01089

简介: 一数据库服务器执行shutdown immediate时,遇到了下面ORA错误,如下所示: $ sqlplus / as sysdba SQL*Plus: Release 10.2.0.4.0 - Production on Fri Aug 5 10:56:24 2016 Copyright (c) 1982, 2007, Oracle.

一数据库服务器执行shutdown immediate时,遇到了下面ORA错误,如下所示:

 
  
  
 
  
  
 
  
  
 
  
  
 
  
  
 
  
  
 
  
  
 
  
  
 
  
  
 
  
  
 
  
  
 
  
  
 
   
 

 

检查告警日志,发现其一直停留在"Job queue slave processes stopped".退出sqlplus然后重新登录,重新执行shutdown immediate

 

$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Fri Aug 5 11:03:45 2016

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

Connected.

SQL> shutdown immediate;

ORA-24324: service handle not initialized

ORA-24323: value not allowed

ORA-01089: immediate shutdown in progress - no operations are permitted

SQL>

 

 

后面退出会话,然后登陆sqlplus,使用shutdown abort 才将数据库关闭。处理完成后,查了一下metal link官方文档,发现引起错误的原因为:

 

Background processes are hanging/not started correctly during the previous startup of this database.

Hence the semaphores and shared memory segments are not getting detached properly now during shutdown.

 

以后遇到这个问题,可以使用下面步骤处理:

 

1. Verify that there are no background processes owned by "oracle" , if there are kill them

$ ps -ef | grep ora_ | grep $ORACLE_SID

 

2. Remove shared memory and semaphores:

 

A) Check for shared memory and semaphores

$ ipcs -mt (if there is anything owned by oracle remove it)

$ ipcrm -m [ID] (to remove it)

 

B) Check and remove semaphores

$ ipcs -sbt (if there is anything owned by oracle remove it)

$ ipcrm -s [ID] (to remove it)

 

C) Remove sga and lk file

$ cd $ORACLE_HOME/dbs

$ rm sgadef<SID>.dbf (removing sga file)

$ORACLE_HOME/dbs/lk<sid> (removing lk... flies)

 

D) If database is down, try to bring up oracle one step at a time:

$ sqlplus /nolog

SQL> startup nomount pfile = ...[path]

SQL> alter database mount;

SQL> alter database open;\

 

Otherwise, exit current SQL*Plus session and verify the following environment variables are set.

echo $ORACLE_HOME

echo $ORACLE_SID (echo %ORACLE_SID% on Windows)

Then, Execute the following:

sqlplus / as sysdba

shutdown abort

exit

sqlplus / as sysdba

startup

 

如上官方资料所示, 两种解决方案。关于第一种方案,简单梳理如下:

 

1: 清理后台进程,一般找到相关进程后,使用kill命令杀掉。

2: 清理共享内存段

3: 清理信号集

注意,在RHEL 中, ipcs -sbt命令会报错"ipcs: invalid option -- b",这个是因为Linux上的ipcs命令,不支持UNIX上的-b,所以不能照本宣科,不要使用参数b. 具体参考官方文档ipcs man page describes invalid -b option in RHEL 5

4: 删除 sga and lk文件。

 

ipcs相关资料:

ipcs 命令往标准输出写入一些关于活动进程间通信设施的信息。如果没有指定任何标志,ipcs 命令用简短格式写入一些关于当前活动消息队列、共享内存段、信号量、远程队列和本地队列标题。

 

 

参考资料:

ORA-24324 During Startup or Shutdown (文档 ID 794293.1)

ORA-1089 During Shutdown Immediate (文档 ID 1014091.102)

相关文章
|
Oracle 关系型数据库 数据库
ORA-01033:ORACLE initialization or shutdown in progress解决方法
ORA-01033:ORACLE initialization or shutdown in progress解决方法
|
Oracle 关系型数据库 数据库
DBA_Oracle Startup / Shutdown启动和关闭过程详解(概念)
2014-08-07 Created By BaoXinjian 一、摘要 Oracle数据库的完整启动过程是分步骤完成的,包含以下3个步骤: 启动实例-->加载数据库-->打开数据库 因为Oracle数据库启动过程中不同的阶段可以对数据库进行不同的维护操作,对应我们不同的需求,所以就需不同的模式启动数据库。
984 0
|
Oracle 关系型数据库 数据库
Oracle deferrable、immediate 约束
oracle数据库中的所有约束默认情况下都是立即触发的,也就是说在语句运行结束后数据库会检查数据的一致性状态. 其中not deferrable 与initially immediate是一样的,与deferrable initially immediate则不同。
846 0