Tuesday, May 9, 2023

TNS-12508: TNS:listener could not resolve the COMMAND given

If you are in process of rotating listener log file  and you receive TNS-12508 while disabling log_status, this means you have imposed admin restrictions in listener log file for this listener. Same error would be returned for any other settings you would want to change using “set” command from lsnrctl utility. In the following I have reproduced this error and explained how to set and unset admin restrictions in listner log file.

[grid: admin]$ lsnrctl
 
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 09-MAY-2023 09:27:10
 
Copyright (c) 1991, 2022, Oracle.  All rights reserved.
 
Welcome to LSNRCTL, type "help" for information.
 
LSNRCTL> set current_listener listener
Current Listener is listener
LSNRCTL> set log_status off
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))

TNS-12508: TNS:listener could not resolve the COMMAND given

If you look into listener.ora file, you will find following parameter set to “ON”. This should be noted that this parameter is set for the default listener “listener”. Like other parameters, _<listener_name> is appended at the end of each parameter to specify which listener this parameter is for.

ADMIN_RESTRICTIONS_LISTENER=ON

Set above parameter to either “off” or alternatively comment out the parameter and do a listener reload. After that you should be able to set log_status, as well as other parameters.

[grid: admin]$ lsnrctl
 
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 09-MAY-2023 09:32:25
 
Copyright (c) 1991, 2022, Oracle.  All rights reserved.
 
Welcome to LSNRCTL, type "help" for information.
 
LSNRCTL> set current_listener listener
Current Listener is listener
 
LSNRCTL> set log_status off
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
TNS-12508: TNS:listener could not resolve the COMMAND given
 
LSNRCTL> reload
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
The command completed successfully
 
LSNRCTL> set log_status off
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
listener parameter "log_status" set to OFF
The command completed successfully
LSNRCTL> set log_status on
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
listener parameter "log_status" set to ON
The command completed successfully

No comments:

Post a Comment

Popular Posts - All Times