Resolving a Hung Database not able to login with sysdba
If database is not connected then use :
sqlplus -prelim "/ as sysdba"
execute the oradebug hanganalyze command to analyze a hung database
SQL> oradebug hanganalyze 3
Statement processed.
SQL>
Oracle RAC environment, specify the oradebug hanganalyze command:
SQL> oradebug setinst all
SQL> oradebug -g def hanganalyze 3
Note: You can repeat the oradebug hanganalyze command a couple of times to generate dump files for varying process states.
You can 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.
In RAC:
SQL> oradebug setmypid
SQL> oradebug unlimit
SQL> oradebug -g all dump systemstate 266