Thursday, September 1, 2016

Static listener vs Dynamic listener differences

Difference between Static listener and Dynamic listener registrations

Database can be registered in two ways with a listener

1. Static Registration :- A static registration of database to a listener is used when we want to remotely start our database. Static registration is like hardcoding a instance details in listener.ora file. In a static registration an instance is registered with the listener whether its up or not. When a client request comes listener opens a dedicated connection , and server later find out that instance is not up then it gives error message as "Oracle not available". 

2. Dynamic Registration :- In Dynamic registration , registration is performed by PMON process. Once a Database instance starts, its PMON process registers instance details with associated listener. Dynamic registration does not require any manual configuration in the listener.ora file where as Static configuration does.From Oracle 8i dynamic configuration introduced. 

PFB listener.ora file having static configuration :-

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = DCPROD)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
    )
    (SID_DESC =
      (SID_NAME = DCPROD)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.100.26.241)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

ADR_BASE_LISTENER = /oracle_home/oracle
PFB listener.ora file having dynamic configuration :-
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.100.26.242)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

ADR_BASE_LISTENER = /oracle_home/oracle
 
As we can see dynamic configuration is more simple then static configuration.

PFB listener status details when using Dynamic regitration :-

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 01-SEP-2016 23:19:29

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.100.26.241)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                01-SEP-2016 23:07:46
Uptime                    0 days 0 hr. 11 min. 43 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/11.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.100.26.241)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "DCPROD" has 2 instance(s).
  Instance "DCPROD", status UNKNOWN, has 2 handler(s) for this service...
  Instance "dcprod", status READY, has 1 handler(s) for this service...
Service "dcprodXDB" has 1 instance(s).
  Instance "dcprod", status READY, has 1 handler(s) for this service...
The command completed successfully
Above status as "READY" resembles that listener has checked instance details and found its status as up or running to handle client request.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=amit)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for IBM/AIX RISC System/6000: Version 11.2.0.1.0 - Production
Start Date                01-DEC-2013 16:42:04
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      ON
Listener Parameter File  /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /oracle_home/oracle/diag/tnslsnr/new/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.100.26.242)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
Above status resembles that either Instance is not up, or its not been registered with listener.
PFB commands to register database instance with listerner if its not automatically registering with listener :-
 [oracle@dbrac1 admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 1 23:22:18 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> alter system register;

System altered.

SQL> exit
 
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
 
[oracle@dbrac1  lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 01-SEP-2016 23:19:29

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.100.26.241)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                01-SEP-2016 23:07:46
Uptime                    0 days 0 hr. 11 min. 43 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/11.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.100.26.241)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "DCPROD" has 2 instance(s).
  Instance "DCPROD", status UNKNOWN, has 2 handler(s) for this service...
  Instance "dcprod", status READY, has 1 handler(s) for this service...
Service "dcprodXDB" has 1 instance(s).
  Instance "dcprod", status READY, has 1 handler(s) for this service...
The command completed successfully


PFB listener status details when using static regitration also 
 
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 01-SEP-2016 23:19:29

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.100.26.241)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                01-SEP-2016 23:07:46
Uptime                    0 days 0 hr. 11 min. 43 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/11.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.100.26.241)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "DCPROD" has 2 instance(s).
  Instance "DCPROD", status UNKNOWN, has 2 handler(s) for this service...
  Instance "dcprod", status READY, has 1 handler(s) for this service...
Service "dcprodXDB" has 1 instance(s).
  Instance "dcprod", status READY, has 1 handler(s) for this service...
The command completed successfully


Above status as "UNKNOWN" means that listener has not checked instance status details that whether its up or not, it has just registered the details of instance. So listener is not sure that whether instance can handle client request or not.

No comments:

Post a Comment