很多情况下,Oracle hang导致sqlplus无法连接,从而无法获得Oracle系统和进程状态,使得定位问题缺少强有力的依据。所幸的是Oracle 10g推出了sqlplus -prelim选项,在Oracle挂起时依然能使用sqlplus,从而能获得数据库状态。
使用方法如下
引用
$ sqlplus -prelim "/as sysdba"
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Mar 28 06:40:21 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
在prelim模式下,不可以查询数据字典,但可以关闭数据库
引用
SQL> select status from v$instance;
select status from v$instance
*
ERROR at line 1:
ORA-01012: not logged on
引用
SQL> shutdown abort
ORACLE instance shut down.
但可以使用oradebug,但对于系统诊断,已经足够了
dump系统状态
引用
SQL> oradebug setmypid
Statement processed.
SQL> oradebug unlimit
Statement processed.
SQL> oradebug dump systemstate 266
Statement processed.
或者dump hanganalyze
引用
SQL> oradebug hanganalyze 3
Hang Analysis in /oracle/app/oracle/admin/ora10g/udump/ora10g_ora_52642.trc
对于rac
引用
SQLPLUS> oradebug setmypid
SQLPLUS>oradebug setinst all
SQLPLUS>oradebug -g def hanganalyze 3
或者dump 进程状态
引用
SQL> oradebug dump processstate 10
Statement processed.
进一步,如果有10g客户端,数据库是9i,依然可以用-prelim
引用
$ sqlplus -prelim /nolog
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Mar 28 06:50:19 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
SQL> conn sys/oracle@ora9i as sysdba
Prelim connection established
SQL> oradebug setmypid
Statement processed.
SQL> oradebug unlimit
Statement processed.
SQL> oradebug dump systemstate 266
Statement processed.
分享到:
相关推荐
oracle-instantclient-sqlplus-21.6.0.0.0-1.x86_64.rpm oracle-instantclient-tools-21.6.0.0.0-1.x86_64.rpm oracle-instantclient19.10-basic-19.10.0.0.0-1.aarch64.rpm oracle-instantclient19.10-devel-19.10....
oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.ziporacle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.ziporacle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.ziporacle-instantclient11.2-sqlplus...
连接oracle使用 oracle-instantclient-sqlplus-10.2.0.3-1.x86_64.rpm
oracle-instantclient-sqlplus-11.1.0.1-1.i386.rpm
oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm --补充包/文件,是为了运行sql*plus 的即时客户端; oracle-instantclient11.2-odbc-11.2.0.4.0-1.x86_64.rpm --补充包/文件,为运行ODBC环境附加库; ...
oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.i386.rpm
oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
sftp直接上载到home文件夹下方便调用(可以先解压缩之后再传,虽然网速会慢一丢丢) sudo apt-get install alien ...sudo alien -i /home/ubuntu/oracle-instantclient-sqlplus-21.1.0.0.0-1.x86_64.rpm
oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm
instantclient-sqlplus-nt-11.2.0.3.0.zip instantclient-basic-nt-11.2.0.3.0.zip 链接: http://download.csdn.net/detail/lh11077/7727125 免安装客户端
官网太难下 遂下了老版本后,上传分享
instantclient-sqlplus-windows.x64-11.2.0.4.0 instantclient-sqlplus-windows.x64-11.2.0.4.0
oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64 ,rpm
instantclient-sqlplus-windows.x64-12.1.0.2.0.zip
instantclient-sqlplus32位, oracle网站总崩, 给需要的小伙伴
oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm
Oracle 插件 instantclient-sqlplus-windows.x64-12.2.0.1.0.zip
*Instant Client 程序包 — SQL*Plus(win ia64): 为通过 Instant Client 运行 SQL*Plus 而提供的额外的库和可执行文件