Oracle数据库shutdown immediate被hang住的几个原因
实验操作环境:
操作系统:Red Hat Enterprise Linux ES release 4 (Nahant Update 6)
数据库 : Oracle Database 10g Release 10.2.0.4.0 – Production 32bit
今晚使用shutdown immediate(其实是执行stop_oracle.sh脚本关闭数据库,如下所示)关闭数据库的时候,
1: [oracle@gsp-orasvr02 scripts]$ more stop_oracle.sh
在另外一个会话中使用tail -20f 命令查看告警日志的输出,结果发现数据库等待了很长时间都没有正常关闭,hang住在下面地方:
Active call for process 11121 user oracle program oracle@get-orasvr02 (S000)
Active call for process 7162 user oracle program oracle@get-orasvr02 (S011)
截图如下
这时解决办法是找出hang住的进程并杀掉(当时操作没有截图,也没有保存输出信息),因为有些session无法被pmon进程清理,导致数据库无法顺利关闭,需要手工杀掉进程。首先使用ps 和grep找到这两个进程。
[ oracle@get-orasvr02 bdump]$ ps -ef | grep oracle | grep S000
[ oracle@get-orasvr02 bdump]$ ps -ef | grep oracle | grep S011
然后使用kill -9 processesid杀掉这两个进程即可,杀掉这两个进程后,从告警日志里面看到里面跳到关闭dispatcher 。如下所示:
6: handle /u01/app/oracle/product/10.2.0/db_1/dbs/c-2179993557-20140105-0e
12: Current log# 3 seq# 242223 mem# 0: /u01/app/oracle/oradata/epps/redo03_1.log
16: Current log# 5 seq# 242224 mem# 0: /u01/app/oracle/oradata/epps/redo05_1.log
20: Current log# 2 seq# 242225 mem# 0: /u01/app/oracle/oradata/epps/redo02_1.log
55: Active call for process 11121 user oracle program oracle@get-orasvr02 (S000)
56: Active call for process 7162 user oracle program oracle@get-orasvr02 (S011)
Oracle的官方文档介绍、解释如下
The database is waiting for pmon to clean up processes, but pmon is unable to
clean them. The client connections to the server are causing the shutdown
immediate or normal to hang. Killing them allows pmon to clean up and release
the associated Oracle processes and resources.
What resources are we talking about?
1) Any non committed transactions must be rolled back
2) Any temporary space (sort segments / lobs / session temporary tables) must be freed
3) The session itself and any associated memory consumed by the session.
4) Internal locks / enqueues must be cleaned up
Often Oracle (SMON or PMON depending on whether Shared Server is used) will wait for the OS to terminate the process(es) associated with the session. If the OS never returns, or fails to terminate them, then the instance shutdown will hang with this message (Shutdown Waiting for Active Calls to Complete)
Other means exist to achieve a quick shutdown, as outlined inNote 386408.1- What Is The Fastest Way To Cleanly Shutdown An Oracle Database?
结果解决上面问题后,本以为可以顺利关闭数据库,结果又hang住了,告警日志信息提示为
SHUTDOWN: Active processes prevent shutdown operation
出现这个错误原因:
因为我大概如下的操作导致:
[oracle@gsp-orasvr02 scripts]$ sqlplus / as sysdba
...........
SQL !
[oracle@get-orasvr02 ~]$
..... (执行了一些shell 命令)
然后又使用了sqlplus启动登录了数据库,然后做shutdown immediate操作,这时导致shutdown immediate被hang住。
[oracle@gsp-orasvr02 scripts]$ sqlplus / as sysdba
解决办法:退出当前的会话,回到原始会话,并重新连接,就可以正常的关闭数据库了
潇湘隐者 网名潇湘隐者/潇湘剑客、英文名Kerry,兴趣广泛,广泛涉猎,个性随意,不善言辞。执意做一名会写代码的DBA,混迹于IT行业
相关文章
- 将数据库从Oracle迁移到SQL Server
- 【C/C++学院】(24)Oracle数据库编程--管理oracle
- 【Python Oracle】使用cx_Oracle 进行数据库操作介绍
- 数据库选型思考(PostgreSQL,MySQL,Oracle)
- Oracle数据库基本概念理解(1)
- ORACLE数据库异步IO介绍
- ORACLE 10升级到10.2.0.5 Patch Set遇到的内核参数检测失败问题
- ORACLE MERGE 介绍
- ngrinder groovy 参数化--从数据库获取数据(以oracle数据库为例)
- oracle sql语言模糊查询--通配符like的使用教程
- 使用Perl管理Oracle数据库
- How to use udev for Oracle ASM in Oracle Linux 6 怎样使用udev在linux 6系统上使用asm
- m1上 配置OEM 怎样配置oracle oem
- CentOS下无界面静默安装oracle 11g
- Mybatis对oracle数据库进行foreach批量插入操作
- 本地不安装Oracle,plsql远程连接数据库
- jdbc连接rac的oracle数据库
- cx_Oracle连接oracle数据库
- C# 连接Oracle数据库,免安装oracle客户端
- 连接ORACLE数据库,是不是必须要安装oracle客户端的运行时
- 修改Oracle 表空间名称 tablespace name
- Oracle数据库“Specified cast is农田valid”
- oracle 判断列是否在数据库中存在
- oracle 判断列是否在数据库中存在
- C#.NET万能数据库访问封装类(ACCESS、SQLServer、Oracle)
- 关于Oracle树形查询(connect by)的学习笔记
- Oracle数据库误truncate table的数据恢复案例