设为首页 收藏本站
查看: 386|回复: 0

[经验分享] Taking Systemstate Dumps when You cannot Connect to Oracle

[复制链接]

尚未签到

发表于 2016-8-5 13:59:21 | 显示全部楼层 |阅读模式
Doc ID: 121779.1
  
  "Checked for relevance on 13-09-2008"
PURPOSE
-------

The purpose of this note is to provide a method for taking system state dumps
on the very rare occasions when connect internal is not possible.


SCOPE & APPLICATION
-------------------

This document is intended for Oracle database administrators and support
analysts.


Taking System State Dumps without Connecting to Oracle
------------------------------------------------------

If you are encountering a database hanging situation, you need to take system
state dumps so that Oracle Support can begin to diagnose the cause of the problem.
Whenever you take such dumps for a hang it is important to take at least 3 of
them a few minutes apart, on all instances of your database. That way there is
evidence showing whether a resource is still being held from one time to the
next.

Ordinarily, you can take a systemstate dump in the case of a hanging situation
in one of two ways:

1. alter session set events 'immediate trace name SYSTEMSTATE level 10';

or

2. $ svrmgrl
connect internal
oradebug setospid <process ID>
oradebug unlimit
oradebug dump systemstate 10

(Note, do not use any semi colons in oradebug. Also, starting in 8.1.6 this should
be possible in sqlplus.)

When using one of these two methods, be sure to disconnect and connect internal
again in between dumps. That way each dump will be in a separate ora_<pid>.trc
trace file in your user_dump_dest.

On very rare occasions it is not possible to make the svrmgrl or
sqlplus connection necessary for issuing these commands. In that event, there
is still a back door method of getting the systemstate dump using a debugger
like dbx, if that is available on your system. The process you attach to will
most likely dump core and be killed, so do not attach to an Oracle background
process. Here is the syntax:

dbx -a PID (where PID = any oracle shadow process)
dbx() print ksudss(10)
...return value printed here
dbx() detach

First, you will need to find a shadow process:

(saki) % ps -ef |grep sqlplus
osupport 78526 154096 0 12:11:05 pts/1 0:00 sqlplus scott/tiger
osupport 94130 84332 1 12:11:20 pts/3 0:00 grep sqlplus
(saki) % ps -ef |grep 78526
osupport 28348 78526 0 12:11:05 - 0:00 oracles734 (DESCRIPTION=(LOCAL
osupport 78526 154096 0 12:11:05 pts/1 0:00 sqlplus scott/tiger
osupport 94132 84332 1 12:11:38 pts/3 0:00 grep 78526

You will attach to shadow PID 28348, enter the print ksudss (10) command
when the prompt comes back, and detach:

(saki) % dbx -a 28348
Waiting to attach to process 28348 ...
Successfully attached to oracle.
warning: Directory containing oracle could not be determined.
Apply 'use' command to initialize source path.

Type 'help' for help.
reading symbolic information ...
stopped in read at 0xd016fdf0
0xd016fdf0 (read+0x114) 80410014 lwz r2,0x14(r1)
(dbx) print ksudss(10)
2
(dbx) detach


You will find a systemstate in the user_dump_dest directory under the PID
trace (and probably a useless core file as well).

(saki) % ls -lrt *28348*
-rw-r----- 1 osupport dba 46922 Oct 10 12:12 ora_28348.trc

core_28348:
total 72
-rw-r--r-- 1 osupport dba 16567 Oct 10 12:12 core
drwxr-xr-x 7 osupport dba 12288 Oct 10 12:12 ../
drwxr-x--- 2 osupport dba 512 Oct 10 12:12 ./

You will find the usual header information in the trace file. On 7.3.4 OPS
systems this will be followed by some lock information. Then the system state
begins. On Oracle8 OPS and non-OPS systems, and on 7.3.4 non-OPS systems the
system state immediately follows the header information.

Here is the beginning of our dump:

Dump file /oracle/mpp/734/rdbms/log/ora_28348.trc
Oracle7 Server Release 7.3.4.4.1 - Production
With the distributed, replication, parallel query, Parallel Server
and Spatial Data options
PL/SQL Release 2.3.4.4.1 - Production
ORACLE_HOME = /oracle/mpp/734
System name: AIX
Node name: saki
Release: 3
Version: 4
Machine: 000089914C00
Instance name: s734
Redo thread mounted by this instance: 2
Oracle process number: 0
Unix process pid: 28348, image:

ksinfy: nfytype = 0x5
ksinfy: calling scggra(&se)
scggra: SCG_PROCESS_LOCKING not defined
scggra: calling lk_group_attach()
ksinfy: returning
*** SESSION ID:(12.15) 2000.10.10.12.11.06.000
ksqcmi: get or convert
ksqcmi: get or convert
*** 2000.10.10.12.12.08.000
===================================================
SYSTEM STATE

.....

Make sure there is an END OF SYSTEM STATE in the file. You can grep for
it or do a search in vi. If it is not there then the dump is not complete,
possibly because max_dump_file size is too small in the init.ora.

Update for 10g:
In some cases, no connections are allowed on the instance (in some ORA-20 situations for example).
As of 10.1.x, there is a new option with SQL*Plus to allow access to an instance to
generate traces.

sqlplus -prelim / as sysdba

For example
export ORACLE_SID=PROD ## Replace PROD with the SID you want to trace
sqlplus -prelim / as sysdba
oradebug setmypid
oradebug unlimit;
oradebug dump systemstate 10



RELATED DOCUMENTS
-----------------

Note 61552.1 Diagnosing Database Hanging Issues

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-253309-1-1.html 上篇帖子: Oracle listener静态注册和动态注册(zt) 下篇帖子: [转]oracle的复合索引两个知识点
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表