ORA-445报错与ASLR

数据库多次出现ORA-00445: background process "J002" did not start after 30 seconds报错及ORA-3136错误

 

查看相关文档,两个报错都可能与内存压力过大有关

ORA-445报错与ASLR

ORA-00445: background process "J000" did not start after 120 seconds (文档 ID 1600807.1)

ORA-445报错与ASLR

ORA-445报错与ASLR

另外关于ORA-00445还有另一篇文档提到,在Oracle启用ASLR会无法保证shared memory address可用性

With ASLR turned on Oracle cannot guarantee the availability of this shared memory address.

This conflict in the address space means that a process trying to attach a shared memory object to a specific address may not be able to do so, resulting in a failure in shmat subroutine.

        ASLR 技术在 2005 年的 kernel 2.6.12 中被引入到 Linux 系统,它将进程的某些内存空间地址进行随机化来增大入侵者预测目的地址的难度,从而降低进程被成功入侵的风险。

        内存中的对象,是有一个内存地址的。ASLR是基于安全考虑的,是为了增加内存溢出攻击泄露的难度,因为如果内存地址是一定的,那么获取溢出对象的内存地址后,可以根据这个地址进行攻击。启用了ASLR,如果是不同的进程读取,就会给随机的offset偏移量,导致不同的进程,即使是同一个对象,得到的地址是不同的。所以在oracle中,多个进程共享相同地址的共享内存。特别是父进程派生出子进程的时候,父进程告诉子进程的内存对象地址,应该是一致的。这种派生的关系,往往有CJQ0派生出J001,J002,SMCO派生出W001,W002,MMON派生出m001,m002等等。
        当开启ASLR后多个进程在处理同一个共享内存对象的时候,得到了不同的内存地址,这个oracle处理不了,就报错ora-445了。

 

在Oracle最佳实践中,建议关闭该参数

  • Disable ASLR (Address Space Layout Randomization) on OEL/RHEL 5, 6 and 7 and Suse 10 and above to prevent process startup errors.  ASLR  is a feature designed to load shared memory objects in random addresses. In Oracle, multiple processes map a shared memory object at the same address across the processes.  With ASLR turned on Oracle cannot guarantee the availability of this shared memory address.  This conflict in the address space means that a process trying to attach a shared memory object to a specific address may not be able to do so, resulting in a failure in shmat subroutine.  See Document 1345364.1 for additional details.

RAC and Oracle Clusterware Best Practices and Starter Kit (Linux) (文档 ID 811306.1)

 

查看ASLR是否开启

/sbin/sysctl -a | grep randomize

0:没有随机化。即关闭 ASLR。

1:保留的随机化。共享库、栈、mmap() 以及 VDSO 将被随机化。

2:完全的随机化。在 1 的基础上,通过 brk() 分配的内存空间也将被随机化。

 

根据文档建议,我们关闭该参数

redhat 6 及以上

vi /etc/sysctl.conf

kernel.randomize_va_space=0

 

/sbin/sysctl -p

 

Redhat 5

vi /etc/sysctl.conf
kernel.randomize_va_space=0
kernel.exec-shield=0

You need to reboot for kernel.exec-shield parameter to take effect. 

Note that both kernel parameters are required for ASLR to be switched off.

 

验证

/sbin/sysctl -a | grep randomize

kernel.randomize_va_space = 0

 

参考

https://blog.****.net/Plus_RE/article/details/79199772

https://community.oracle.com/docs/DOC-1006799
ORA-00445: Background Process "xxxx" Did Not Start After 120 Seconds (文档 ID 1345364.1)

IF : Troubleshooting ORA-00445: Background Process "xxxx" Did Not Start After n Seconds / Ksvcreate: Process(xxxx) Creation Failed (文档 ID 2023910.1)

RAC and Oracle Clusterware Best Practices and Starter Kit (Linux) (文档 ID 811306.1)

https://www.networkworld.com/article/3331199/what-does-aslr-do-for-linux.html