TNS-12518 TNS listener could not hand off client connection

ORA-12518/TNS-12518 indica un problema mentre il listener trasferisce la connessione client al processo del server o al processo del dispatcher. TNS-12518 viene registrato nel registro del listener. Il client potrebbe ricevere ORA-12518 o altri errori di disconnessione come ORA-12537. 

Come vengono effettivamente effettuate le connessioni al database?

Dedicated mode, il client contatta il listener e fornisce il SERVICE NAME del database. Quindi il listener genera un server process dedicato e trasferisce la connessione client a questo processo server dedicato. TNS-12518 indica un problema durante il trasferimento della connessione client al processo server.

Shared Server mode, il client del database contatta il listener e fornisce il  SERVICE NAME del database. Quindi il listener trasferisce la connessione client a uno dei dispatcher configurati per quel servizio. TNS-12518 indica un problema durante il trasferimento della connessione client al processo del server di distribuzione.

Sebbene questo errore sia registrato nel listener log, il listener è solo il messenger, ORA-12518/TNS-12518 è principalmente correlato alle risorse RDBMS e OS.

The first place you would look for the TNS-12518 error is the listener log. Usually the listener log would be located under $ORACLE_HOME/network/log directory. You can use 'lsnrctl status' command output to look for the location of the listener log file.

Il primo posto in cui dovresti cercare l'errore TNS-12518 è il listener log nella directory $ORACLE_HOME/network/log. È possibile utilizzare l'output del comando 'lsnrctl status' per cercare la posizione del file di registro del listener.
lsnrctl status

Error stack in listener log:

 TNS-12518: TNS:listener could not hand off client connection
  TNS-12571: TNS:packet writer failure
   TNS-12560: TNS:protocol adapter error
    TNS-00530: Protocol adapter error
      32-bit Windows Error: 54: Unknown error


Error Description:
ERROR_NETWORK_BUSY
54
0x36
The network is busy.


Causa
This indicates a bottleneck at the network layer(TCP/IP).

Soluzione
1.Try increasing dispatchers and shared servers.


Error stack in listener log:

TNS-12518: TNS: il listener non è riuscito a rilasciare la connessione del client
TNS-12571: TNS: errore nel dispositivo di scrittura del pacchetto
TNS-12560: TNS: errore dell'adattatore del protocollo
TNS-00530: Errore di adattatore del protocollo
64-bit Windows Error: 53: Unknown error

In Windows il listener.log ha raggiunto il file size limit (on Windows) of 4GB. 
Inoltre è probabile che sia abilitato ADR diagnostic per listener su questo server. i.e. No DIAG_ADR_<listener_name>=OFF in listener.ora.

Soluzione:

You can solve this problem by deleting the large listener in $ORACLE_BASE\diag\tnslsnr\<hostname>\listener\trace\<listener_name>.log

1) Stop the listener process using the command line or Control Panel Service.

2) Delete the log file(s) that are at or approaching the 4G size limit at this location:
$ORACLE_BASE\diag\tnslsnr\<hostname>\listener\trace\<listener_name>.log
(Alternatively, you can copy the entire diag folder to a new location and create a new, empty diag folder)

3) Issue any lsnrctl command and you will see a new listener.log in its place under:
$ORACLE_BASE\diag\tnslsnr\<hostname>\listener\trace\


Since ADR Diagnostics are enabled for this listener these steps cannot be done dynamically using the lsnrctl utility.
e.g.
LSNRCTL>set log_file mylog
Will yield: TNS-01251: Cannot set trace/log directory under ADR.
However, it is possible to disable the flat file listener logging using the following commands:
LSNRCTL>set current_listener <listener_name>
LSNRCTL>set log_status OFF
LSNRCTL>save_config
This will prevent this issue from arising in the future. This also stop the ADR logging.

Post popolari in questo blog

ORA-12154: TNS: il listener non è attualmente a conoscenza del servizio richiesto nel descrittore di connessione

Create e Drop Pluggable Database