Resolve the reasons for the hung database

 resolve the reasons for the hung database

How to Collect Diagnostics for Database Hanging Issues [ID 452358.1]


use the command sqlplus -prelim "/ as sysdba" to log in with the -prelim
option.

execute the oradebug hanganalyze command to analyze a hung
database

SQL>oradebug hanganalyze 3
In RAC
SQL> oradebug setinst all
SQL> oradebug -g def hanganalyze 3

oradebug hanganalyze command a couple of times to generate dump files for
varying process states.

get a systemstate dump from a non-RAC system by executing the following set of
commands.
SQL> oradebug setmypid
Statement processed.
SQL> oradebug dump systemstate 266
Statement processed.
SQL>
Issue the following commands to get a systemstate dump in a RAC environment:
SQL> oradebug setmypid
SQL> oradebug unlimit
SQL> oradebug -g all dump systemstate 266

take the systemstate dumps a few times,

You can also gather a hanganalyze trace file to identify hung sessions with SQL*Plus when connected as SYSDBA:

SQL> oradebug hanganalyze 3
Wait at least 2 minutes to give time to identify process state changes.
SQL> oradebug hanganalyze 3
Open a separate SQL session and immediately generate a system state dump.
SQL> alter session set events 'immediate trace name SYSTEMSTATE level 10';

You can also gat a trace dump to identify hung session details in Oracle Real Application Clusters (RAC) as follows:
SQL> oradebug setmypid
SQL> oradebug setinst all
SQL> oradebug -g def hanganalyze 3
... Wait at least 2 minutes to give time to identify process state changes.
SQL> oradebug -g def hanganalyze 3


Non-RAC:
Sometimes, database may actually just be very slow and not actually hanging. It is therefore recommended,  where possible to get 2 hanganalyze and 2 systemstate dumps in order to determine whether processes
are moving at all or whether they are "frozen".
Hanganalyze
sqlplus '/ as sysdba'
oradebug setmypid
oradebug unlimit
oradebug hanganalyze 3
-- Wait one minute before getting the second hanganalyze
oradebug hanganalyze 3
oradebug tracefile_name
exit

Systemstate
sqlplus '/ as sysdba'
oradebug setmypid
oradebug unlimit
oradebug dump systemstate 266
oradebug dump systemstate 266
oradebug tracefile_name
exit

Comments

Popular posts from this blog

QUERY DATAGUARD AND STANDBY STATUS

Blocking session on RAC database

Finding object size in Oracle database