首页 数据库 mysql教程 Oracle 11g中SYS连接阻止关闭数据库

Oracle 11g中SYS连接阻止关闭数据库

Jun 07, 2016 pm 05:34 PM

以前就发现11g的Oracle有这个问题,一直没有太在意,直到今天关闭数据库的时候发现很长时间Oracle都无法正常关闭。发现数据库可以

以前就发现11g的Oracle有这个问题,一直没有太在意,直到今天关闭数据库的时候发现很长时间Oracle都无法正常关闭。

  从后台查询,发现数据库出现错误提示:

SHUTDOWN: Active processes prevent shutdown operation


  检查数据库后台进程,未发现占用大量资源的连接,实际上整个数据库中只有一个本地连接:

      bash-3.00$ ps -ef|grep oraclerac11g2
  oracle 22273 22272 0 19:59:51 ? 0:00 oraclerac11g2 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
  oracle 29307 22520 0 20:09:28 pts/2 0:00 grep oraclerac11g2


  经过检查发现,似乎是由于当前的SYS连接没有退出,而直接通过HOST命令启动了另一个sqlplus命令,并在其中执行了shutdown immediate操作,,这时就会导致shutdown immediate被hang住:

    $ sqlplus "/ as sysdba"
  SQL*Plus: Release 11.1.0.6.0 - Production on 星期五 8月 22 19:49:35 2008
  Copyright (c) 1982, 2007, Oracle. All rights reserved.
  连接到:
  Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
  With the Partitioning, Real Application Clusters, OLAP, Data Mining
  and Real Application Testing options
  SQL> shutdown immediate数据库已经关闭。已经卸载数据库。
  ORACLE 例程已经关闭。
  SQL> startup
  ORACLE 例程已经启动。
  Total System Global Area 1.7108E+10 bytes
  Fixed Size 2101632 bytes
  Variable Size 3344420480 bytes
  Database Buffers 1.3757E+10 bytes
  Redo Buffers 4431872 bytes数据库装载完毕。数据库已经打开。


  下面启动另一个会话,并以SYS登陆数据库,然后尝试关闭数据库:

      SQL> shutdown immediate数据库已经关闭。已经卸载数据库。
  ORACLE 例程已经关闭。

发现数据库可以正常关闭,然后根据刚才的描述,在sqlplus中切换到主机命令行,然后再新启动一个sqlplus,执行shutdown immediate:


      SQL> startup
  ORACLE 例程已经启动。
  Total System Global Area 1.7108E+10 bytes
  Fixed Size 2101632 bytes
  Variable Size 3344420480 bytes
  Database Buffers 1.3757E+10 bytes
  Redo Buffers 4431872 bytes数据库装载完毕。数据库已经打开。
  SQL> select count(*) from v$session;
  COUNT(*)
  ----------
  36
  SQL> host
  $ sqlplus "/ as sysdba"
  SQL*Plus: Release 11.1.0.6.0 - Production on 星期五 8月 22 19:59:51 2008
  Copyright (c) 1982, 2007, Oracle. All rights reserved.
  连接到:
  Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
  With the Partitioning, Real Application Clusters, OLAP, Data Mining
  and Real Application Testing options
  SQL> shutdown immediate


  和预期的一样,关闭命令被hang住了,检查alert文件就可以看到上面的提示信息。

  退出当前的会话,回到原始会话,并重新连接,就可以正常的关闭数据库了:

    SQL> shutdown immediate
  ^CORA-01013: 用户请求取消当前的操作
  SQL> exit从 Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
  With the Partitioning, Real Application Clusters, OLAP, Data Mining
  and Real Application Testing options 断开
  $ exit
  SQL> shutdown immediate
  ORA-03135: 连接失去联系
  SQL> conn / as sysdba已连接。
  SQL> shutdown immediate数据库已经关闭。已经卸载数据库。
  ORACLE 例程已经关闭。


而920版本的数据库是没有这个问题的:

      [oracle@bjtest ~]$ sqlplus "/ as sysdba"
  SQL*Plus: Release 9.2.0.4.0 - Production on 星期六 8月 23 04:14:36 2008
  Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
  已连接到空闲例程。
  SQL> host
  [oracle@bjtest ~]$ ps -ef|grep ora
  root 3804 3792 0 Jul18 ? 00:00:29 hald-addon-storage: polling /dev/hda
  root 26417 26385 0 04:14 pts/1 00:00:00 su - oracle
  oracle 26418 26417 0 04:14 pts/1 00:00:00 -bash
  oracle 26451 26418 0 04:14 pts/1 00:00:00 sqlplus
  oracle 26452 26451 0 04:14 ? 00:00:00 oraclebjtest (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
  oracle 26453 26451 0 04:14 pts/1 00:00:00 /bin/bash
  oracle 26481 26453 0 04:14 pts/1 00:00:00 ps -ef
  oracle 26482 26453 0 04:14 pts/1 00:00:00 grep ora
  [oracle@bjtest ~]$ exit
  exit
  SQL> startup
  ORACLE 例程已经启动。
  Total System Global Area 9415145752 bytes
  Fixed Size 755992 bytes
  Variable Size 822083584 bytes
  Database Buffers 8589934592 bytes
  Redo Buffers 2371584 bytes数据库装载完毕。数据库已经打开。
  SQL> host
  [oracle@bjtest ~]$ sqlplus "/ as sysdba"
  SQL*Plus: Release 9.2.0.4.0 - Production on 星期六 8月 23 04:15:08 2008
  Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
  连接到:
  Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
  With the Partitioning, OLAP and Oracle Data Mining options
  JServer Release 9.2.0.4.0 - Production
  SQL> shutdown immediate数据库已经关闭。已经卸载数据库。
  ORACLE 例程已经关闭。
  SQL> exit从Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
  With the Partitioning, OLAP and Oracle Data Mining options
  JServer Release 9.2.0.4.0 - Production中断开
  [oracle@bjtest ~]$ exit
  exit
  SQL> exit
  ERROR:
  ORA-03113: 通信通道的文件结束
  从Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
  With the Partitioning, OLAP and Oracle Data Mining options
  JServer Release 9.2.0.4.0 - Production(情况复杂)中断开

linux

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
1 个月前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳图形设置
1 个月前 By 尊渡假赌尊渡假赌尊渡假赌
威尔R.E.P.O.有交叉游戏吗?
1 个月前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

说明InnoDB全文搜索功能。 说明InnoDB全文搜索功能。 Apr 02, 2025 pm 06:09 PM

InnoDB的全文搜索功能非常强大,能够显着提高数据库查询效率和处理大量文本数据的能力。 1)InnoDB通过倒排索引实现全文搜索,支持基本和高级搜索查询。 2)使用MATCH和AGAINST关键字进行搜索,支持布尔模式和短语搜索。 3)优化方法包括使用分词技术、定期重建索引和调整缓存大小,以提升性能和准确性。

如何使用Alter Table语句在MySQL中更改表? 如何使用Alter Table语句在MySQL中更改表? Mar 19, 2025 pm 03:51 PM

本文讨论了使用MySQL的Alter Table语句修改表,包括添加/删除列,重命名表/列以及更改列数据类型。

与MySQL中使用索引相比,全表扫描何时可以更快? 与MySQL中使用索引相比,全表扫描何时可以更快? Apr 09, 2025 am 12:05 AM

全表扫描在MySQL中可能比使用索引更快,具体情况包括:1)数据量较小时;2)查询返回大量数据时;3)索引列不具备高选择性时;4)复杂查询时。通过分析查询计划、优化索引、避免过度索引和定期维护表,可以在实际应用中做出最优选择。

可以在 Windows 7 上安装 mysql 吗 可以在 Windows 7 上安装 mysql 吗 Apr 08, 2025 pm 03:21 PM

是的,可以在 Windows 7 上安装 MySQL,虽然微软已停止支持 Windows 7,但 MySQL 仍兼容它。不过,安装过程中需要注意以下几点:下载适用于 Windows 的 MySQL 安装程序。选择合适的 MySQL 版本(社区版或企业版)。安装过程中选择适当的安装目录和字符集。设置 root 用户密码,并妥善保管。连接数据库进行测试。注意 Windows 7 上的兼容性问题和安全性问题,建议升级到受支持的操作系统。

如何为MySQL连接配置SSL/TLS加密? 如何为MySQL连接配置SSL/TLS加密? Mar 18, 2025 pm 12:01 PM

文章讨论了为MySQL配置SSL/TLS加密,包括证书生成和验证。主要问题是使用自签名证书的安全含义。[角色计数:159]

哪些流行的MySQL GUI工具(例如MySQL Workbench,PhpMyAdmin)是什么? 哪些流行的MySQL GUI工具(例如MySQL Workbench,PhpMyAdmin)是什么? Mar 21, 2025 pm 06:28 PM

文章讨论了流行的MySQL GUI工具,例如MySQL Workbench和PhpMyAdmin,比较了它们对初学者和高级用户的功能和适合性。[159个字符]

InnoDB中的聚类索引和非簇索引(次级索引)之间的差异。 InnoDB中的聚类索引和非簇索引(次级索引)之间的差异。 Apr 02, 2025 pm 06:25 PM

聚集索引和非聚集索引的区别在于:1.聚集索引将数据行存储在索引结构中,适合按主键查询和范围查询。2.非聚集索引存储索引键值和数据行的指针,适用于非主键列查询。

您如何处理MySQL中的大型数据集? 您如何处理MySQL中的大型数据集? Mar 21, 2025 pm 12:15 PM

文章讨论了处理MySQL中大型数据集的策略,包括分区,碎片,索引和查询优化。

See all articles