Showing posts with label Listener. Show all posts
Showing posts with label Listener. Show all posts

Wednesday, 25 August 2021

listener service register


alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = demo.localdomain)(PORT = 1531))';


alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = demo.localdomain)(PORT = 1531))','(ADDRESS = (PROTOCOL = TCP)(HOST = demo.localdomain)(PORT = 1522))' scope=both;


stop and start the listener


lsnrctl status LISTENR.



Thursday, 5 September 2019

listener.ora

ADMIN_RESTRICTIONS_LISTENER = on

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = sdefr2pldb02.moviantogroup.com)(PORT = 1523))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1523))
    )
  )

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
       (ORACLE_HOME = /oraclebase/app/oracle/product/18.0.0/dbhome_1)
      (SID_NAME = PRIPRDSBY)
      (ORACLE_HOME = /oraclebase/app/oracle/product/18.0.0/dbhome_1)
      (SID_NAME = PRIPRD)
    )
  )





ADR_BASE_LISTENER = /oraclebase/dump/
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON              # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_LISTENER=ON

Tuesday, 27 November 2018

ORA-12514: TNS:listener does not currently know of service requested in connect

ORA-12514: TNS:listener does not currently know of service requested in connect

check the service name and sid name.

if there is sid _name running fine , then add a entry about the service_name as global _name


example

listener.ora


(SID_DESC =
      (GLOBAL_DBNAME = DOM.h1.al.mi.com)
      (ORACLE_HOME = /oraclebase/app/oracle/product/18.0.0/dbhome_1)
      (SID_NAME = DOM)
    )
(SID_DESC =
      (GLOBAL_DBNAME = DOM)
      (ORACLE_HOME = /oraclebase/app/oracle/product/18.0.0/dbhome_1)
      (SID_NAME = DOM)



Let me explain :

listener status :

Service "magesh.hq.dal.omi.com" has 1 instance(s). ====================================> Service_name = magesh.hq.dal.omi.com
Instance "magesh", status UNKNOWN, has 1 handler(s) for this service... ====================> SID/ Instance = magesh

a) When you connected using SID : magesh , connection succeed as the instance name in the listener matched :

Note :
Instance "magesh", status UNKNOWN, has 1 handler(s) for this service... ====================> SID/ Instance = magesh
----------------------------------------------------------

b) When you connected using SERVICE_NAME = magesh , connection succeed as the service name in the listener status is not matching : :

Note :
Service "magesh.hq.dal.omi.com" has 1 instance(s). ====================================> Service_name = magesh.hq.dal.omi.com

Solution:

Change the SERVICE_NAME=magesh.hq.dal.omi.com 

Sunday, 11 November 2018

TNS-12541: TNS:no listener

TNS-12541: TNS:no listener


The hostname was valid but the listener was not contactable. Things to check are that the tnsnames has the correct port (and hostname) specified, and that the listener is running on the server and using the correct port.
TNS-12545: Connect failed because target host or object does not exist

The host in specified in the tnsnames is not contactable. Verify that you have spelled the host name correctly. If you have, try pinging the host with 'ping '. If ping returns 'unknown host', speak to your network admin. It might be that you have a DNS issue (you could try using the IP address if you have it to hand). If you get 'host unreachable', again speak to your network person, the problem could be down to a routing or firewall issue.

ORA-00119: invalid specification for system parameter LOCAL_LISTENER

What are the symptoms?

The local_listener parameter has been set, the listener is running, but when attempting to start the instance an ORA-00119 is reported:
SQL> startup
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00132: syntax error or unresolved network name 'LIST_ANDY'
Why is this happening?

Oracle only checks for listeners running on the default port (1521). It would have to spend all day trying every possible port number otherwise. You'll need to give it some help to find your listener.

How do I fix it?

Simply add an entry to the servers tnsnames.ora pointing at the listener. For example my listener 'LIST_ANDY' is running on port 3801, so I would add the following entry to my tnsnames:
LIST_ANDY = (ADDRESS = (PROTOCOL = TCP)(HOST = fermat)(PORT = 3801))
Test it with tnsping:
tnsping
Then try starting your instance again - it should work now.

ORA-12505: TNS:listener does not currently know of SID given in connect



Either the SID is misspelled in the tnsnames, or the listener isn't listening for it. Check the tnsnames.ora first. If it looks ok, do a 'lsnrctl status' on your server, to see what databases the listener is listening for.

ORA-12520: TNS:listener could not find available handler for requested type of server


ORA-12520: TNS:listener could not find available handler for requested type of server

If you are seeing this error, first check the listener services status. Notice the 'state:blocked' on my listener below:
oracle@bloo$ lsnrctl services

LSNRCTL for Linux: Version 10.2.0.2.0 - Production

Copyright (c) 1991, 2005, Oracle. All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
Services Summary...

Service "scr9" has 1 instance(s).
Instance "scr9", status BLOCKED, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:blocked
LOCAL SERVER
The problem turned out to be caused by the fact that my listener was not named LISTENER. The database was still registering with it somehow, presumably because it was using the default port, but when attempting to open a connection to the service I saw the following error:
/home/oracle/tns_admin$ sqlplus system@scr9

SQL*Plus: Release 10.2.0.2.0 - Production

Copyright (c) 1982, 2005, Oracle. All Rights Reserved.

Enter password:
ERROR:
ORA-12520: TNS:listener could not find available handler for
requested type of server
To resolved the issue I configured the instances local_listener parameter to point at my listener:
alter system set local_listener=
'(ADDRESS=(PROTOCOL=TCP)(HOST=bloo)(PORT=1521))' scope=spfile;
If you have an entry in your tnsnames.ora that points to the listener, you can simply use the listener name instead:
alter system set local_listener='' scope=spfile;

Monday, 29 January 2018

Local listener configred on standby when it is outside cluster.

Local listener configred on standby when it is outside cluster.

===================================================================



#



LISTENER_bol1p =

  (ADDRESS_LIST=

    (ADDRESS=

      (PROTOCOL=IPC)

      (KEY=bol1p)

    )

    (ADDRESS=

      (PROTOCOL=IPC)

      (KEY=bol1p)

    )

    (ADDRESS=

      (PROTOCOL=TCP)

      (Host=bol1p.na.xyz.com)

      (Port=1521)

    )

    (ADDRESS=

      (PROTOCOL=TCP)

      (Host=bol1p.na.xyz.com)

      (Port=1526)

    )

  )



SID_LIST_LISTENER_bol1p =

  (SID_LIST=

    (SID_DESC=

      (SID_NAME=bol1p)

      (ORACLE_HOME=E:\Oracle\ORA11204GDR)

    )

  )



CONNECT_TIMEOUT_LISTENER_bol1p = 10

TRACE_LEVEL_LISTENER_bol1p = 0

STARTUP_WAIT_TIME_LISTENER_bol1p = 0







if it inside cluster



+++++++++++++++++++++++++++++++++++++++++++++++++++





Fslusvv920 =

  (ADDRESS_LIST=

    (ADDRESS=

      (PROTOCOL=IPC)

      (KEY=bol1p)

    )

    (ADDRESS=

      (PROTOCOL=IPC)

      (KEY=bol1p_USEAR920.WORLD)

    )

    (ADDRESS=

      (PROTOCOL=TCP)

      (Host=129.225.12.114)

      (Port=1521)

    )

    (ADDRESS=

      (PROTOCOL=TCP)

      (Host=129.225.12.114)

      (Port=1526)

    )

  )



SID_LIST_Fslusvv920 =

  (SID_LIST=

    (SID_DESC=

      (SID_NAME=bol1p)

      (ORACLE_HOME=E:\Oracle\ORA11204R)

    )

  )



CONNECT_TIMEOUT_Fslusea20 = 10

TRACE_LEVEL_Fslusear920 = 0

STARTUP_WAIT_TIME_Fslusear920 = 0









Tns names.ora



===============







bol1p_USEA920.WORLD =

  (DESCRIPTION=

    (ADDRESS_LIST=

      (ADDRESS=

        (PROTOCOL=TCP)

        (Host=129.225.80.114)

        (Port=1521)

      )

    )

    (CONNECT_DATA=

      (SID=bol1p)

    )

  )





bol1p_USEAIHV771 =

  (DESCRIPTION =

    (FAILOVER=ON)

    (ADDRESS_LIST =

      (ADDRESS =

        (PROTOCOL = TCP)

        (HOST = 192.61.113.36)

        (PORT = 1521)

      )

      (ADDRESS =

        (PROTOCOL = TCP)

        (HOST = 192.61.113.36)

        (PORT = 1526)

      )

    )

    (CONNECT_DATA =

      (SID = bol1p)

    )

  )

bol1p.WORLD =

  (DESCRIPTION=

    (ADDRESS_LIST=

      (ADDRESS=

        (PROTOCOL=TCP)

        (Host=129.225.80.114)

        (Port=1521)

      )

      (ADDRESS=

        (PROTOCOL=TCP)

        (Host=129.225.80.114)

        (Port=1526)

      )

    )

    (CONNECT_DATA=

      (SID=bol1p)

    )

  )

bol1p_USEAIHV771.WORLD =

  (DESCRIPTION =

    (FAILOVER=ON)

    (ADDRESS_LIST =

      (ADDRESS =

        (PROTOCOL = TCP)

        (HOST = 192.61.113.36)

        (PORT = 1521)

      )

      (ADDRESS =

        (PROTOCOL = TCP)

        (HOST = 192.61.113.36)

        (PORT = 1526)

      )

    )

    (CONNECT_DATA =

      (SID = bol1p)

    )

  )



real_prod_bol1p.world =

  (DESCRIPTION =

    (FAILOVER=ON)

    (ADDRESS_LIST =

      (ADDRESS =

        (PROTOCOL = TCP)

        (HOST = 192.61.113.36)

        (PORT = 1521)

      )

      (ADDRESS =

        (PROTOCOL = TCP)

        (HOST = 192.61.113.36)

        (PORT = 1526)

      )

    )

    (CONNECT_DATA =

      (SID = bol1p)

    )

  )

bol1p =

  (DESCRIPTION=

    (ADDRESS_LIST=

      (ADDRESS=

        (PROTOCOL=TCP)

        (Host=129.225.80.114)

        (Port=1521)

      )

      (ADDRESS=

        (PROTOCOL=TCP)

        (Host=129.225.80.114)

        (Port=1526)

      )

    )

    (CONNECT_DATA=

      (SID=bol1p)

    )

  )





======================================================================



ih 180 check the bol1p production and standby entry







grep -i bol1p tnsnames.ora



:/unnbo1p  enter



N









standby entry





STANDBY_bol1p =

   (DESCRIPTION =

     (FAILOVER=ON)

     (ADDRESS_LIST =

       (ADDRESS = (PROTOCOL = TCP)(HOST = 129.225.80.114)(PORT = 1521))

       (ADDRESS = (PROTOCOL = TCP)(HOST = 129.225.80.114)(PORT = 1526))

     )

     (CONNECT_DATA =

       (SID = bol1p)

     )

)







129.225.80.114 is the entry of cluster listener of standby





production entry



bol1p =

   (DESCRIPTION =

     (FAILOVER=ON)

     (ADDRESS_LIST =

       (ADDRESS = (PROTOCOL = TCP)(HOST = bol1p.na.uis.unisys.com)(PORT = 1521))

       (ADDRESS = (PROTOCOL = TCP)(HOST = bol1p.na.uis.unisys.com)(PORT = 1526))

     )

     (CONNECT_DATA =

       (SID = bol1p)

     )

   )







bol1p.na.uis.unisys.com refer to 129.225.113.36









listener entry of standby inside the cluster.



====================================================



#

# This file is written by Oracle Services For MSCS

# on Wed Oct 21 16:43:36 2015

#





FslUSEA920 =

  (ADDRESS_LIST=

    (ADDRESS=

      (PROTOCOL=IPC)

      (KEY=bol1p)

    )

    (ADDRESS=

      (PROTOCOL=IPC)

      (KEY=bol1p_USEA920.WORLD)

    )

    (ADDRESS=

      (PROTOCOL=TCP)

      (Host=129.225.80.114)

      (Port=1521)

    )

    (ADDRESS=

      (PROTOCOL=TCP)

      (Host=129.225.80.114)

      (Port=1526)

    )

  )



SID_LIST_FslUSEA920 =

  (SID_LIST=

    (SID_DESC=

      (SID_NAME=bol1p)

      (ORACLE_HOME=E:\Oracle\ORA11204GDR)

    )

  )



CONNECT_TIMEOUT_FslUSEA920 = 10

TRACE_LEVEL_FslUSEA920 = 0

STARTUP_WAIT_TIME_FslUSEA920 = 0







====================================================================================













































































How to Register Listener in the Database ?

How to Register Listener in the Database ?


The  listener is a separate process that runs on the database server computer. It  receives incoming client connection requests and manages the traffic of these requests to the database server. There are two methods by which a listener comes to know of a database instance. In Oracle terminology, this is referred  as “Registering with the Listener” .  The two methods are

1.) Static Instance Registration
2.) Dynamic Instance Registration

First we will discuss about the Static Instance Listener  :
This is the very basic method to register listener .We can either add the entries in $ORACLE_HOME\NETWORK\ADMIN\listener.ora file or by using the GUI i.e, through Net Manager. The configuration inside the listener.ora file looks like :

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = noida)
      (ORACLE_HOME = C:\app\neerajs\product\11.2.0\dbhome_1)
      (SID_NAME = noida)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = hyd)
      (ORACLE_HOME = C:\app\neerajs\product\11.2.0\dbhome_1)
      (SID_NAME = hyd)
    )
  )
LISTENER =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = tech-199)(PORT = 1521))
  )

and when we check the registration , it shows the status of UNKNOWN :

C:\>lsnrctl
LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 05-OCT-2011 15:26:27
Copyright (c) 1991, 2010, Oracle.  All rights reserved.
Welcome to LSNRCTL, type "help" for information.

LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=tech-199)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
Start Date                28-SEP-2011 15:03:39
Uptime                    7 days 0 hr. 22 min. 52 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   C:\app\neerajs\product\11.2.0\dbhome_1\network\admin\listener.ora
Listener Log File         c:\app\neerajs\diag\tnslsnr\tech-199\listener\alert\log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=tech-199)(PORT=1521)))
Services Summary...
Service "hyd" has 1 instance(s).
  Instance "hyd", status UNKNOWN, has 1 handler(s) for this service...
Service "noida" has 1 instance(s).
  Instance "noida", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL>

The status is unknown because there is no mechanism to guarantee that the specified status even exists.Here the listener assumes that instance will be there whenever there will be any request. It donot have inforamtion about the status of the Current Instance.

Now, we will check the Dynamic Instance Listener :

Dynamic Instance Registration :  This dynamic registration feature is called service registration. The registration is performed by the PMON process  an instance background process   of each database instance that has the necessary configuration in the database initialization parameter file. Dynamic service registration does not require any configuration in the listener.ora file.

Service registration offers the following benefits :

1.) Simplified configuration  :  Service registration reduces the need for the SID_LIST_listener_name parameter setting, which specifies information about the databases served by the listener, in the listener.ora file.

Note :  The SID_LIST_listener_name parameter is still required if we are using Oracle Enterprise Manager to manage the database.

2.) Connect-time failover  : Because the listener always knows the state of the instances, service registration facilitates automatic failover of the client connect request to a different instance if one instance is down.
In a static configuration model, a listener would start a dedicated server upon receiving a client request. The server would later find out that the instance is not up, causing an "Oracle not available" error message.

3.) Connection load balancing : Service registration enables the listener to forward client connect requests to the least loaded instance and dispatcher or dedicated server. Service registration balances the load across the service handlers and nodes.  To ensure service registration works properly, the initialization parameter file should contain the following parameters:

SERVICE_NAMES for the database service name
INSTANCE_NAME for the instance name
For example:
SERVICE_NAMES=noida.TECH-199
INSTANCE_NAME=noida

Let's have a Demo of Dynamic Listener.

The listener is quite capable of running without a listner.ora file at all. It will simply start and run with all default values.Here i have rename the listener.ora file and stop and start the listener and find that listener supports no services.Check the below:

LSNRCTL> stop
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=tech-199)(PORT=1521)))
The command completed successfully.

Now start the listener

LSNRCTL> start
Starting tnslsnr: please wait...

TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
Log messages written to c:\app\neerajs\diag\tnslsnr\tech-199\listener\alert\log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=tech-199)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=tech-199)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
Start Date                05-OCT-2011 16:21:30
Uptime                    0 days 0 hr. 0 min. 7 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Log File         c:\app\neerajs\diag\tnslsnr\tech-199\listener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=tech-199)(PORT=1521)))
The listener supports no services
The command completed successfully

Here, we find that listener donot support any services.Since it doesnot found the listener.ora file ,and  if we try to connect to the Instance then it will  throws the error i.e, ORA-12514 :

C:\> tnsping noida
TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 05-OCT-2011 16:23:03
Copyright (c) 1997, 2010, Oracle.  All rights reserved.
Used parameter files:
C:\app\neerajs\product\11.2.0\dbhome_1\network\admin\sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.100.0.112)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = noida)))
OK (40 msec)

Now, we try to connect with Instance "NOIDA"

C:\> sqlplus sys/xxxx@noida as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Wed Oct 5 16:23:45 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor

Since the tnsping proves that our tnsnames.ora resolution is correct, but it throws the error while connecting to database because the listener doesnot knows anything about the services "NOIDA" . Let's start the instance and check again :

C:\> set ORACLE_SID=noida
SQL> startup
ORACLE instance started.

Total System Global Area  263639040 bytes
Fixed Size                  1373964 bytes
Variable Size             222300404 bytes
Database Buffers           33554432 bytes
Redo Buffers                6410240 bytes
Database mounted.
Database opened.

Now check the listener status again :

LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=tech-199)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
Start Date                05-OCT-2011 16:21:30
Uptime                    0 days 0 hr. 19 min. 21 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Log File         c:\app\neerajs\diag\tnslsnr\tech-199\listener\alert\log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=tech-199)(PORT=1521)))
Services Summary...
Service "noida.TECH-199" has 1 instance(s).
  Instance "noida", status READY, has 1 handler(s) for this service...
Service "noidaXDB.TECH-199" has 1 instance(s).
  Instance "noida", status READY, has 1 handler(s) for this service...
Service "noida_DGB.TECH-199" has 1 instance(s).
  Instance "noida", status READY, has 1 handler(s) for this service...
The command completed successfully

Here we observe that once the instance is started , when we re-check the listener now knows of service “NOIDA”, with a status of READY . This obviously did not come from listener.ora as the file is renamed. Notice also that, unlike the static registration, this time the status is READY. The listener knows the instance is ready because the instance itself told the listener it was ready.

Now agian connecting to the Instance :

C:\>sqlplus sys/xxxx@noida as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Tue Oct 4 18:14:28 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>

Here by default, the PMON process registers service information with its local listener on the default local address of TCP/IP, port 1521. As long as the listener configuration is synchronized with the database configuration, PMON can register service information with a nondefault local listener or a remote listener on another node. During service registration PMON provides listener with the following information:

- Name of the associated instance
- Current load and maximum load on instance
- Names of DB services provided by database.
- Information about dedicated servers and dispatchers (depends on database server mode i.e dedicated/shared server mode) .

PMON process wakes up at every 60 seconds and provide information to the listener. If any problem arises and PMON process fails then it's not possible to register information to listener periodically. In this case we can do 'Manual service registration' using command:
SQL> ALTER SYSTEM REGISTER;

Featured post

Restircted session due to sync filed with ora-65177

Application is unable to connect the database due to restricted session. sql> show pdbs; SQL> show con_name CON_NAME -----------------...