以下面的报错信息为例:
ORA-03113: end-of-file on communication channel
Process ID: 16770
Session ID: 771 Serial number: 45608
我们可以通过以下几种方法来进一步分析该报错。
使用Oracle提供的oerr
命令来查看错误信息的含义和大致解决思路。
oerr命令的使用格式为:
oerr <进程名> <错误编号>
例如:
# 查看ORA-03113报错的含义
[oracle@orahost ~]$ oerr ora 03113
03113, 00000, "end-of-file on communication channel"
// *Cause: The connection between Client and Server process was broken.
// *Action: There was a communication error that requires further investigation.
// First, check for network problems and review the SQL*Net setup.
// Also, look in the alert.log file for any errors. Finally, test to
// see whether the server process is dead and whether a trace file
// was generated at failure time.# 查看LRM-00109报错的含义
[oracle@orahost ~]$ oerr lrm 00109
109, 0, "could not open parameter file '%.*s'"
// *Cause: The parameter file does not exist.
// *Action: Create an appropriate parameter file.
Alert日志记录了数据库在运行过程中的几乎所有告警信息。
Alert日志的位置和命名格式如下:
$ORACLE_BASE/diag/rdbms///trace/alert_.log
如果数据库运行了较长时间,alert日志通常会非常大(几个G甚至十几个G),不建议使用vim打开。
less $ORACLE_BASE/diag/rdbms/bangkok/BANGKOK/trace/alert_BANGKOK.log
tail -n 200 $ORACLE_BASE/diag/rdbms/bangkok/BANGKOK/trace/alert_BANGKOK.log# 从Alert日志中提取指定的行
grep -n 'ORA-03113' $ORACLE_BASE/diag/rdbms/bangkok/BANGKOK/trace/alert_BANGKOK.log
sed -n '20000,20500p' $ORACLE_BASE/diag/rdbms/bangkok/BANGKOK/trace/alert_BANGKOK.log > /tmp/alert_ora_0308.log
Trace文件中详细记录了数据库进程在运行过程中产生的重要信息。
Trace跟踪文件的位置和命名格式如下:
$ORACLE_BASE/diag/rdbms///trace/__.trc
根据报错信息中的进程名和进程编号(Process ID),找到对应的trace文件。
tail -f $ORACLE_BASE/diag/rdbms/bangkok/BANGKOK/trace/BANGKOK_ora_16770.trc
上一篇:Golang并发编程