Ubuntu 上运行的 Oracle 数据库宕机(崩溃/无法启动) 原因很多,下面按最常见 → 较少见给你一个系统排查思路,你可以对照看。
Oracle 很吃内存,Ubuntu 默认可能没调好。
现象
/var/log/syslog 或 dmesg 中有:Out of memory: Kill process (oracle)
检查
dmesg | grep -i oom
free -h
解决
SGA/PGAvm.overcommit_memoryOracle 对空间极其敏感。
重点目录
/u01(Oracle 安装目录)/opt/tmp检查
df -h
du -sh /u01/*
解决
很多人误以为宕机。
检查
lsnrctl status
典型错误
TNS-12541no listener现象
startup 直接失败ORA-01078检查
sqlplus / as sysdba
startup
解决
现象
ORA-00205ORA-01157ORA-01110检查
SELECT * FROM v$recover_file;
Oracle 官方要求:
kernel.sem
kernel.shmmax
kernel.shmall
fs.file-max
检查
sysctl -a | grep sem
常见错误
ORA-27102Too many open filesulimit -a
Ubuntu 自动升级可能:
last reboot
cat /var/log/apt/history.log
# 1. 看系统日志
dmesg | tail -100
grep oracle /var/log/syslog
# 2. 看 Oracle 日志
cd $ORACLE_BASE/diag/rdbms/*/*/trace
ls -lt alert*.log
tail -200 alert*.log
# 3. 看是否能启动
sqlplus / as sysdba
startup
你可以直接贴:
我可以直接告诉你 为什么宕 + 怎么修。