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

non-existent process lock port on windows server

I have a database link created between oracle and sqlserver using oracle tg4odbc, the product is installed on windows server and run as service "OracleOraGtw11g_home1TNSListener", but sometime the service cannot started, the root cause of this problem is that the port number 1521 is used by an non-existent process. The first step is to use netstat -bano|find "1521" to get the process id, in my case it's 5844, which shows the connection is from my oracle server 10.8.0.169 H:\>netstat -bano|find "1521"   TCP    0.0.0.0:1521           0.0.0.0:0              LISTENING       5844   TCP    10.14.45.33:1521       10.8.0.169:42987       ESTABLISHED     5844 however the process id does not show in either task manager or process explorer. The next step is to run tcpview, which shows non-existent under process column, there are three rows, two show status as "listening", the other one shows status "established", right click and k

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 for the given Oracle Home. LsInventorySession failed: Unable to create patchObject Possible ca

shell script to clean up oracle dumpfile

https://github.com/iacosta/personal/blob/master/shells/cleanhouse.sh #!/bin/ksh # # Script used to cleanup any Oracle environment. # # Cleans:      audit_file_dest #              background_dump_dest #              core_dump_dest #              user_dump_dest #              Clusterware logs # # Rotates:     Alert Logs #              Listener Logs # # Scheduling:  00 00 * * * /networkdrive/dba/scripts/purge/cleanup.sh -d 7 > /u01/dba/bin/cleanup.log 2>&1 # # Created By:  Lei Dao # # # RM="rm -f" RMDIR="rm -rf" LS="ls -l" MV="mv" TOUCH="touch" TESTTOUCH="echo touch" TESTMV="echo mv" TESTRM=$LS TESTRMDIR=$LS SUCCESS=0 FAILURE=1 TEST=0 HOSTNAME=`hostname` ORAENV="oraenv" TODAY=`date +%Y%m%d` ORIGPATH=/usr/local/bin:$PATH ORIGLD=$LD_LIBRARY_PATH export PATH=$ORIGPATH # Usage function. f_usage(){   echo "Usage: `basename $0` -d DAYS [-a DAYS] [-b DAYS] [