Oracle Linux 7 and Redhat Linux 7: The socket files in /var/tmp/.oracle Location Get Deleted (Doc ID 2455193.1)
APPLIES TO:
Oracle Database - Enterprise Edition - Version 11.2.0.4 and later
Linux x86-64
SYMPTOMS
On Redhat Linux 7 and Oracle Linux 7, the socket files in /var/tmp/.oracle location mysteriously get deleted.
CAUSE
Both Oracle Linux 7 and Redhat Linux 7 have a kernel service systemd-tmpfiles-clean.service that is managed by systemd and deletes the files in the temp location. Oracle Linux 7和Redhat Linux 7都具有内核服务systemd-tmpfiles-clean.service,该服务由systemd管理,并删除临时位置中的文件。
The above service removes
- files/directories in /tmp/ un-accessed more than 10 days(defined in tmp.conf) /tmp/中的文件/目录超过10天未访问(在tmp.conf中定义)
- files/directories in /var/tmp/ un-accessed more than 30 days(defined in tmp.conf) /var/tmp/中的文件/目录超过30天未访问(在tmp.conf中定义)
The "un-accessed" is decided by checking all of atime/mtime/ctime of the file/directory. 通过检查文件/目录的所有atime/mtime/ctime来确定"un-accessed"。
atime/mtime/ctime的获取方法参考文章:https://blog.csdn.net/u010692693/article/details/103182285
SOLUTION
Exclude the socket files from getting deleted by the kernel service systemd-tmpfiles-clean.service 在内核服务systemd-tmpfiles-clean.service的删除策略中排除socket文件
To exclude the socket files in a tmp directory from getting deleted by the tempfile clean service, change the content of /usr/lib/tmpfiles.d/tmp.conf and add 要排除tempfile clean服务删除tmp目录中的socket文件,请更改/usr/lib/tmpfiles.d/tmp.conf的内容,并添加
x /tmp/.oracle*
x /var/tmp/.oracle*
x /usr/tmp/.oracle*
The "x" option above indicates to the systemd-tmpfiles-clean.service to exclude files in the listed directory. 上面的"x"选项指示systemd-tmpfiles-clean.service排除列出目录中的文件。
Note: The directory /var/tmp/.oracle contains a number of "special" socket files that are used by local clients to connect via the IPC protocol (sqlnet) to various Oracle processes including the TNS listener, the CSS, CRS & EVM daemons or even database or ASM instances. The symptoms as per Doc ID 391790.1 results when socket files are removed while Clusterware is running 注意:目录/var/tmp/.oracle包含许多"special" socket文件,本地客户端使用这些socket文件通过IPC协议(sqlnet)连接到各种Oracle进程,包括TNS侦听器,CSS,CRS和EVM守护程序,甚至数据库或ASM实例。在Clusterware运行时删除socket文件时 ,会出现Doc ID 391790.1的症状
REFERENCES
NOTE:391790.1 - Unable To Connect To Cluster Manager Ora-29701 as Network Socket Files are Removed