| Diagnosing Database Hanging Issues [ID 61552.1] | |||||
|
| |||||
| 修改时间 12-OCT-2010 类型 BULLETIN 状态 PUBLISHED | |||||
In this Document
Scope and Application
Diagnosing Database Hanging Issues
1. Describe the problem
3. Spool out relevant V$ VIEWS
4. Gather OS-Level Info
5. Get SYSTEMSTATE and HANGANALYZE Dumps
7. Generate a CORE DUMP And Run a DEBUGGER.
8. If certain processes get PROCESSSTATE dump.
9. Check List for diagnostics.
- complete release like database release 8.0.5.2, etc...Is the "hanging" a true freeze or is activity just very slow?
- Does the problem persist if you shutdown all but one instance?
- Please note: Some of the solutions discussed here are useful for OPS; many are not. Different tuning rules apply;
for example, a "smaller" buffer cache often means better performance in OPS. Also, the most common sources
of hanging issues in OPS are not discussed here. These include: PCM locking problems, pinging, space
management problems, lack of work partitioning, internode parallel query tuning requirements, shared disk or
virtual shared disk problems, network problems, and DLM problems.
- Does the problem persist without it?Are you using any Oracle applications or tools (financials, forms, etc.)?
- How many users?
- All instances?
- All connections?
- All operations?
- All nodes?
- Can you start a session and select * from dual?
- How often are log switches occurring?
- If there are archive-related errors in the alert log (see step 2), stop reading this bulletin: Archiving problems always freeze
the database. Review the error(s) and resolve the problem.
Example: the device may be full. Another common cause is that the ARCH process is stopped while the database is in
ARCHIVELOG mode.
Check this by connecting internal and typing ARCHIVE LOG LIST. If ARCHIVELOG mode and automatic archival is
DISABLED, that's the problem. Either restart the ARCH process by typing ALTER SYSTEM ARCHIVE LOG START
(or log_archive_start = true in init.ora) or shutdown, startup mount exclusive and ALTER DATABASE
NOARCHIVELOG.
- If archiving problems have been ruled out and the database is truly frozen, complete steps 1, 2, 3, 4, 5 and 6.
- If database is not really frozen but is suffering performance degradation due to increased activity, complete steps 1, 2, 3, 4 and 6. Do not forget 1(d).
See Note 10585.1 QUERY AND APPLICATION TUNING USING EXPLAIN AND TKPROF UTILITY
Note 10585.1 QUERY AND APPLICATION TUNING USING EXPLAIN AND TKPROF UTILITY
Note 41634.1 TKPROF and Problem Solving
Note 1019631.6 TFTS SCRIPT. TO SIMPLIFY THE USE OF EXPLAIN PLAN
- It may need tuning. (This is useful for more than sql syntax.)
- If a complex sql statement is hanging, can you break successfully?
- See 1 (c)
- See Note 240762.1 script. to show Explain Plan for Parallel Queries
- Could be space transaction contention. If there are ora-1575 errors in the alert log, try setting pct_increase = 0
in the temporary tablespace to disable SMON from coalescing contiguous extents, thus reducing contention
with query slaves. Also try spreading datafiles over several disks, increasing sort_area_size (but don't introduce
paging) and possibly "reducing" degree of parallelism. Refer to additional tuning documentation.
- possibly locking. Be sure to get v$lock output in step 3. There are the following scripts available to help debug locking problems.
Note 1020012.6 TFTS SCRIPT. TO RETURN MEDIUM DETAIL LOCKING INFO
Note 1020008.6 TFTS FULLY DECODED LOCKING SCRIPT
Note 1019527.6 TFTS CHECK FOR FOREIGN KEY LOCKING
Note 1020007.6 TFTS: DISPLAY LOCKS & GIVE SID AND SERIAL# TO KILL
- Do you have constraints and/or triggers on the object(s) you're updating? Could be a cascading locking problem.
Try putting index(es) on relevant foreign key columns. This modifies the locking behavior. on the parent. (See
Application Developers Guide for more info).
See Note 33453.1 REFERENTIAL INTEGRITY AND LOCKING
- also see steps 1(c) and 1(d).
- possibly a data dictionary related problem. See step 1(c).- Does the operation run faster the second time around?
- if "create index" it might be a space transaction contention issue.
- Try tuning i/o. The following could be helpful: clustering, increasing db_block_size, distributing i/o (i.e. striping, separating
indexes and data, parallelizing). Also try setting pre_page_sga = true in the init.ora.
- Is the operation always slower immediately after a large update? This is delayed block cleanout.
- Try select count(*)
- If updates only are the problem, could be locking.Scripts are available to help resolve these issues see:
Be sure to do get lock information 1(b) and 1(d).
There are the following scripts available to help debug locking problems.
Note 1020012.6 TFTS SCRIPT. TO RETURN MEDIUM DETAIL LOCKING INFO
Note 1020008.6 TFTS FULLY DECODED LOCKING SCRIPT
Note 1019527.6 TFTS CHECK FOR FOREIGN KEY LOCKING
Note 1020007.6 TFTS: DISPLAY LOCKS & GIVE SID AND SERIAL# TO KILL
- any errors? Errors signify table or index corruption.Call support.
- To identify the underlying tables:
- you may need to SET ARRAYSIZE 1 / SET LONG 2000 to see all the text.
- definitely get tkprof output as in 1(b).
- Data dictionary objects might also be affected by the above.
- each file should go into a separate email message
- put the tar number and file description in the subject line
- don't uuencode or attach the files if you don't have to (i.e. unless they're too big) - just read them into the message as ascii.
Kill it with "alter system kill session ''".
If on sqlnet 2.1 or above, try setting sqlnet.expire_time in the sqlnet.ora on the server side. (For more info, see page A-16 of "Understanding SQL*NET" v2.1).
- On unix: use SAR, VMSTAT and NETSTAT (man sar)
- You can use truss, trace (man truss) or oradbx (call support) for tracing specific processes.
- You can also unix debuggers such as dbx, xdb, adb or truss to dump process activity. Example:
dbx -a- On vms: use MONITOR (help monitor)/*attach to hanging process*/
where /*dump Oracle stack */
detach /*detach from process*/
truss -o /tmp/mytruss -fae -p
- you can use analyze/process (help analyze) or orambx (call support) for tracing specific processes.
- On novl: use LOAD MONITOR (gui - no online documentation)
- On Windows NT: use Performance Monitor, Event Monitor, Dr. Watson (see Resource kit for documentation).
- use pview for monitoring specific processes (resource kit).
$ sqlplus /nolog
connect / as sysdba
oradebug setmypid
oradebug unlimit
oradebug hanganalyze 3
wait 90 seconds
oradebug hanganalyze 3
exit
$ sqlplus /nolog
connect / as sysdba
oradebug setmypid
oradebug unlimit
oradebug dump systemstate 10
wait 90 seconds
oradebug dump systemstate 10
wait 90 seconds
oradebug dump systemstate 10
exit
Use systemstate level 266 in 9.2.0.6+. Use level 10 prior to this version.
For HangFG for Unix Platforms.
NOTE.362094.1 HANGFG User Guide
For RAC environment and datbase hang, please review Note 135714.1.
6. Get BSTAT-ESTAT OR (for 8.1.6 or higher) STATSPACK output
If the entire database is suffering performance degradation .
See Note 62161.1 System wide Tuning using UTLESTAT Reports in Oracle7/8
See Note 149113.1 Installing and Configuring StatsPack Package
See Note 149124.1 Creating a StatsPack performance report
Send this report to support along with the other files requested.
Note 149124.1 Creating a StatsPack performance report
Send this report to support along with the other files requested.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/611609/viewspace-687086/ ,如需转载,请注明出处,否则将追究法律责任。