Skip to main content

database not registered to scan_listener

created a new database COGSTD, but it's not registered on scan_listener, when connect, the error is:

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

In the alert log, when the database started, I usually see the remote_listener and local_listener are set dynamically before database is mount, but on this problematic database, I only see local_listener are set, but not remote_listener

ALTER SYSTEM SET local_listener=' (ADDRESS=(PROTOCOL=TCP)(HOST=xx.xx.xx.xx0)(PORT=1521))' SCOPE=MEMORY SID='COGSTD3';

Troubleshooting:

1. The service is registered with local listener:
node1>lsnrctl status listener|grep COGSTD
Service "COGSTD" has 1 instance(s).
  Instance "COGSTD1", status READY, has 1 handler(s) for this service...

Similar output on node2 and node 3 with the local instnance name

2. The service is not registered with scan_listener:
-bash-4.1>srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node node3
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node node2
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node node1

node3>lsnrctl status listener_scan1|grep COGSTD
node2>lsnrctl status listener_scan2|grep COGSTD
node1>lsnrctl status listener_scan3|grep COGSTD

nothing!!!

google and metalink search suggest that it's an oracle bug.

Bug 12887685  - INSTANCE CAN'T BE REGISTERED IN LISTENER_SCAN1
Bug 12665692  - PMON DOES NOT REGISTER TO ONE OF THE SCAN LISTENER.
Bug 12392343  - INSTANCE/SERVICE DOES NOT REGISTER TO ALL SCAN LISTENERS
Bug 12659561  - INSTANCE DOES NOT REGISTER SERVICES WHEN SCAN FAILOVERED
Bug 10194101  - SOME INSTANCES INTERMITTENTLY DO NOT CROSS-REGISTER WITH THE 
SCAN LISTENER
Bug 7420414   - SCAN LISTENER LOSE SERVICE REGISTRATION INFORMATION AFTER 
SERVICE RELOCATION

The following note is the workaround:
SCAN Registration Issue: Services Fail to Register to SCAN Listeners (Doc ID 1448717.1)

Now implement the workaround:
Try to use the scan name, but it does not accept it at first time
SQL>  alter system set remote_listener='scan.devxx.racxx.company.corp:1521';
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-00119: invalid specification for system parameter REMOTE_LISTENER
ORA-00132: syntax error or unresolved network name
'scan.devxx.racxx.company.corp:1521'

then try

1. add  SCAN IP to tnsnames.ora for RDBMS $ORACLE_HOME on all three RAC nodes.
REMOTE_LISTENERS_SCAN=
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST =  xx.xx.xx.x3)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST =  xx.xx.xx.x4)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST =  xx.xx.xx.x5)(PORT = 1521))
    )
2. modify the sqlnet.ora to allow ezconnect
3. modify the remote_listener parameter
SQL> alter system set REMOTE_LISTENER='REMOTE_LISTENERS_SCAN' scope=both sid='*';

System altered.

this time, it accept it.
SQL> alter system register;

System altered.
node1>lsnrctl status listener_scan3|grep COGSTD
Service "COGSTD" has 3 instance(s).
  Instance "COGSTD1", status READY, has 1 handler(s) for this service...
  Instance "COGSTD2", status READY, has 1 handler(s) for this service...
  Instance "COGSTD3", status READY, has 1 handler(s) for this service...

it works on all three nodes. I can connect to database from remote.

4. Try to use the scan name that failed before, it's ok this time. WTF!

SQL> alter system set REMOTE_LISTENER='scan.devxx.racxx.company.corp:1521' scope=both sid='*';

System altered.

SQL> alter system register;

System altered.

To avoid future problem, I relocate the scan_listener

srvctl relocate scan -scannumber 1 -node node1
srvctl relocate scan -scannumber 3 -node node3

Remove the scan_listener parameter from spfile and bounce the database, check the alert log, noticed that the local_listener and remote_listener are both setup dynamically before mount database:

Tue Jul 11 14:38:13 2017
ALTER SYSTEM SET local_listener=' (ADDRESS=(PROTOCOL=TCP)(HOST=xx.xx.xx.xx0)(PORT=1521))' SCOPE=MEMORY SID='COGSTD3';
Tue Jul 11 14:38:13 2017
ALTER SYSTEM SET remote_listener=' scan.xxx.xxx.xxx.xxx:1521' SCOPE=MEMORY SID='COGSTD3';
ALTER DATABASE MOUNT /* db agent *//* {3:56066:29347} */

So what's the problem? does it has something to do with listener.ora and  endpoints_listener.ora.
or it's because of the tnsnames.ora does not have ezconnect, to did not trace the LREG|PMON process, but let me revoke all the changes but only leave ezconnect as the only change.

relocate scan_listener as it was
remove remote_listener parameter
bounce database

Everything work as normal, so I think the problem is the missing ezconnect in sqlnet.ora on some of the nodes. if sqlnet.ora is missing, by default, it using

NAMES.DIRECTORY_PATH=(tnsnames, ldap, ezconnect)

But on some of the RAC nodes, NAMES.DIRECTORY_PATH only configured to use tnsnames, not ezconnect.

So this problem may have nothing to do with bug, it's just ezconnect is missing.

Comments

  1. Hi,

    Thanks for this article. It was helpful.

    Just to point out, in the first para..."In the alert log, when the database started, I usually see the remote_listener and local_listener are set dynamically before database is mount, but on this problematic database, I only see local_listener are set, but not remote_listener"

    Not sure if something is missing or there is a typo, but this statement did not seem clear...

    ReplyDelete

Post a Comment

Popular posts from this blog

Opatch apply/lsinventory error: oneoff is corrupted or does not exist

I am applying the quarterly patch for 19c RDBMS, I tried using napply but failed, but somehow it corrupted the inventory though nothing applied. further apply and lsinventory command ran into error like this: $ ./OPatch/opatch lsinventory Oracle Interim Patch Installer version 12.2.0.1.21 Copyright (c) 2020, Oracle Corporation.  All rights reserved. Oracle Home       : /u02/app/oracle/19.0.0 Central Inventory : /u01/app/oraInventory    from           : /u02/app/oracle/19.0.0/oraInst.loc OPatch version    : 12.2.0.1.21 OUI version       : 12.2.0.7.0 Log file location : /u02/app/oracle/19.0.0/cfgtoollogs/opatch/opatch2020-09-08_13-35-59PM_1.log Lsinventory Output file location : /u02/app/oracle/19.0.0/cfgtoollogs/opatch/lsinv/lsinventory2020-09-08_13-35-59PM.txt -------------------------------------------------------------------------------- Inventory load failed... OPatch cannot load inventory ...

oracle dba_hist_sysmetric_summary

found this blog is helpful to get CPU and IO statistics on oracle database. http://shob-dbadmin.blogspot.ca/2012/12/how-to-find-total-io-of-database.html courtesy to  Shomil Bansal , below are hist writing, not mine. How to find total IO of the database instance Total IO of database instance is sum of the physical reads, physical writes and redo writes. There are several views to find these values. v$sysmetric  - Reports metric values for only the most current time sample 60 secs. v$sysmetric_summary  - Reports metric values for time sample of 1 hour. v$sysmetric_history  - Reports metric values every 60 sec from the time instance is up. Better way to analyse IO using this view to take deltas between two time periods. dba_hist_sysmetric_history  - All the above views are refreshed when the instance is restarted. This view, part of AWR, stores the historical stats. I have used this view for my report. Query: ====== set lines 350...

ORA_RMAN_SGA_TARGET

assume that we lost all the files of oracle database but we do have rman backup, when trying to bring up a dummy database before restore start, I get this error. RMAN> startup nomount force; WARNING: cannot translate ORA_RMAN_SGA_TARGET value startup failed: ORA-01078: failure in processing system parameters ORA-01565: error in identifying file '+DATA/PROD/spfilePROD.ora' ORA-17503: ksfdopn:2 Failed to open file +DATA/PROD/spfilePROD.ora ORA-15056: additional error message ORA-17503: ksfdopn:DGOpenFile05 Failed to open file +DATA/prod/spfileprod.ora ORA-17503: ksfdopn:2 Failed to open file +DATA/prod/spfileprod.ora ORA-15173: entry 'spfileprod.ora' does not exist in directory 'prod' ORA-06512: at line 4 starting Oracle instance without parameter file for retrival of spfile RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =================================...