附MOS文章:
Windows Virtual account Listener refused the connection with error ORA-12518 (Doc ID 3107616.1)
In this Document
Symptoms
Changes
Cause
Solution
References
Applies to:
Oracle Net Services - Version 19.3.0.0.0 and later
Information in this document applies to any platform.
Symptoms
Windows Virtual account database service is running. Listener refused the connection with the following error: ORA-12518, TNS:listener could not hand off client connection.
Changes
Cause
The Device / System name is more than 15 caharcters. "XXXXXdb-dev-2025". The Device or hostname or system name should be less then 15 characters length
We have created a new bug for this case to troubleshoot the case.
Bug 38542990 - WINDOWS VIRTUAL ACCOUNT LISTENER REFUSED THE CONNECTION WITH ERROR ORA-12518
The long hostname causing VIRTUAL Account groupname not be added to provide PROCESS_DUP_HANDLE
In the InitializeProcessSecurity() function within ssmain.c, Access Control Entries (ACEs) are added for groups (ORA_DBA, ORA_INSTALL, ORA_GRID_LISTENERS, and ORA_CLIENT_LISTENERS) to grant PROCESS_DUP_HANDLE access.
Just before this step, the computer name is obtained via GetComputerNameEx(). However, due to a coding limitation, only the first 16 characters of the computer name are captured.
If the computer name exceeds 16 characters, it is truncated, which causes subsequent LookupAccountName calls to fail. As a result, the ACEs for the specified groups and access rights are not added.
Solution
Here the issue was caused by the machine name exceeding 16 characters. After updating the machine name to less then 15 characters and restart server fixed the problem.
Development reviewed the code and confirmed this issue was addressed in the MAIN branch under “23C: Support for Long Hostnames on Windows,” but this fix cannot be backported easily as it would require multiple additional transactions.
References
NOTE:951187.1 - Windows: TNS-12518 TNS-534 "Failed to Grant Connection Ownership"
NOTE:2159157.1 - 12c Windows: ORA-12518 Errors Connecting to 11g Dedicated Service Via Listener
NOTE:550859.1 - Troubleshooting Guide for TNS-12518 TNS listener could not hand off client connection