当数据库慢到无法连接时可以尝试用prelim 的方式连接数据库做systemstatedump 和hang analyze ,如果仍然不能连接只能考虑pstack strace 分析数据库进程了
-
Generate systemstate dump:
$ sqlplus -prelim / as sysdba
SQL>oradebug setmypid
SQL>oradebug unlimit
SQL>oradebug -g all hanganalyze 3
Wait for 30 seconds
SQL>oradebug -g all hanganalyze 3
SQL>exit -
Open another session:
$ sqlplus -prelim / as sysdba
SQL>oradebug setmypid
SQL>oradebug unlimit
SQL>oradebug -g all dump systemstate 10
Wait for 30 seconds
SQL>oradebug -g all dump systemstate 10
SQL>oradebug tracefile_name
SQL>exit -
The generated files will be under udump. Please upload these files.
$cd udump
$ls –ltr
See Note 121779.1 Taking Systemstate Dumps when You cannot Connect to Oracle.