一、报错
oracle突然无法登录
二、排查方式
1.查看内存
free -mh
2.查看磁盘
df -h
3.查看oracle进程
ps -ef|grep ora_

可以看到最后的ora_ (32689)占用cpu为99%,所以这个有问题,hung死了数据库
4.查看对应的错误日志
cat alert_*.log
发现有如下报错:ORA-00445: background process “W004” did not start
三、解决办法
1.杀死进程(第一种方法)
查了下是oracle的11.2.0.x的bug,就选择直接杀死这个进程来解决
2.修改系统参数(第二种方法)
# /sbin/sysctl -a | grep randomize 为0意外的任何值表示正在使用aslr,该bug的出现跟aslr有关
[root@p11g01 ~]# /sbin/sysctl -a | grep randomize
kernel.randomize_va_space = 2
[root@p11g01 ~]# /sbin/sysctl -a | grep exec-shield
kernel.exec-shield = 1
[root@p11g01 ~]# cat <<EOF >>/etc/sysctl.conf
> kernel.randomize_va_space = 0
> kernel.exec-shield=0
> EOF
# 就是把kernel.randomize_va_space和kernel.exec-shield参数设置为0,来关闭aslr,可以直接编辑/etc/sysctl.conf文件
[root@p11g01 ~]# sysctl -p
kernel.shmall = 2097152
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmax = 2076760064
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
kernel.panic_on_oops = 1
net.ipv4.conf.eth0.rp_filter = 1
net.ipv4.conf.eth1.rp_filter = 2
kernel.randomize_va_space = 0
kernel.exec-shield = 0
[root@p11g01 ~]# /sbin/sysctl -a | grep randomize
kernel.randomize_va_space = 0
[root@p11g01 ~]# /sbin/sysctl -a | grep exec-shield
kernel.exec-shield = 0
[root@p11g01 ~]# reboot
参考链接:https://blog.youkuaiyun.com/m0_50546016/article/details/115309961
本文讲述了Oracle数据库登录问题的排查过程,通过检查内存、磁盘使用、进程状态和错误日志,发现进程hung死导致OR-00445报错。解决方案包括直接杀死进程和修改系统参数关闭ASLR,以修复11.2.0.x版本的bug。
3241

被折叠的 条评论
为什么被折叠?



