The listener supports no services

ISSUE:-

Many times we encountered an issue where the database listener was unable to connect to DB service although the associated database service is up and running.I am trying to connect to database it is throwing no listener error

[ora12c@server1 ~]$ sqlplus scott@DBname/*******;

SQL*Plus: Release 12.1.0.2.0 Production on Thu Nov 16 15:25:25 2017

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

ERROR:
ORA-12541: TNS:no listener

Enter user-name: ^C
[ora12c@server1 ~]

When we try to check the status of listener , it throws below error.

[ora12c@server1 ~]$ lsnrctl status LISTENER

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 16-NOV-2017 17:18:00

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                16-NOV-2017 15:14:35
Uptime                    0 days 2 hr. 3 min. 25 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /rdbms/app/12.1.0/grid/network/admin/listener.ora
Listener Log File         /rdbms/app/12.1.0/grid_base/diag/tnslsnr/server1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=server1.co.in)(PORT=1521)))
Services Summary...
The listener supports no services
The command completed successfully

To overcome issue , I found the below solution. It worked successfully in my environment & listener started listening to a port.

SOLUTION:-

Step 1 :-  Assign similar port in listener.ora and tnsnames.ora file .  In my case I am using 1521.

Export the ASM profile and make an appropriate port changes in the listener.ora
Export the DB profile and make an appropriate port changes in the tnsnames.ora

Step 2:-  Set the local_listener parameter in the database. 

[ora12c@server1 ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 12.1.0.2.0 Production on Thu Nov 16 13:47:38 2017

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options
SQL> 
SQL> 
SQL> sh ow parameter local_listener

NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener     string

Here you can see the local_listener parameter is set to NULL.

Run the below command to set local_listener parameter.

select 'alter system set local_listener="(ADDRESS=(PROTOCOL=TCP)(HOST=' || host_name || ')(PORT = 1521))" scope=both;' from v$instance;              // Select appropriate port number
        
SQL> select 'alter system set local_listener="(ADDRESS=(PROTOCOL=TCP)(HOST=' || host_name || ')(PORT = 1521))" scope=both;' from v$instance;

'ALTERSYSTEMSETLOCAL_LISTENER="(ADDRESS=(PROTOCOL=TCP)(HOST='||HOST_NAME||')(POR
--------------------------------------------------------------------------------
alter system set local_listener="(ADDRESS=(PROTOCOL=TCP)(HOST=server1
.co.in)(PORT = 1521))" scope=both;


SQL> alter system set local_listener="(ADDRESS=(PROTOCOL=TCP)(HOST=server1.co.in)(PORT = 1521))" scope=both;

System altered.

SQL> 
SQL> 

Step 3:- Once all above conditions has fulfilled , start the listener and check the status of the listener.

[ora12c@server1 ~]$ lsnrctl status LISTENER

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 16-NOV-2017 15:16:08

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=server1.co.in)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                16-NOV-2017 15:14:35
Uptime                    0 days 0 hr. 1 min. 32 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /rdbms/app/12.1.0/grid/network/admin/listener.ora
Listener Log File         /rdbms/app/12.1.0/grid_base/diag/tnslsnr/server1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=server1.co.in)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "DBName" has 1 instance(s).
  Instance "DBName", status READY, has 1 handler(s) for this service...
Service "DBNameXDB" has 1 instance(s).
  Instance "DBName", status READY, has 1 handler(s) for this service...
The command completed successfully.

Check are you able to connect to DB by sqlplus

[ora12c@server1 ~]$
[ora12c@server1 ~]$ sqlplus scott@DBname/*******;

SQL*Plus: Release 12.1.0.2.0 Production on Fri Nov 17 14:23:15 2017

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Last Successful login time: Fri Nov 17 2017 01:52:41 +05:30

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SQL>
SQL>


Its successful , that's it

Oracle RAC Error: CRS-2805: Unable to start 'ora.LISTENER.lsnr' because it has a 'hard' dependency on resource type 'ora.cluster_vip_net2.type' and no resource of that type can satisfy the dependency_part1

Issue :- 
LISTENER is not running on one of RAC node. After attempting to restart throws below error.

[ora12c@RAC2 ~]$ srvctl start listener -n RAC2
PRCR-1013 : Failed to start resource ora.LISTENER.lsnr
PRCR-1064 : Failed to start resource ora.LISTENER.lsnr on node RAC2
CRS-2805: Unable to start 'ora.LISTENER.lsnr' because it has a 'hard' dependency on resource type 'ora.cluster_vip_net1.type' and no resource of that type can satisfy the dependency
CRS-2525: All instances of the resource 'ora.RAC1.vip' are already running; relocate is not allowed because the force option was not specified


Solution :-

Step 1 :- Do pre check list.

[ora12c@RAC2 ~]$ crsctl status res -t
 Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
      ONLINE  ONLINE       RAC1            STABLE
      ONLINE  ONLINE       RAC2            STABLE
ora.FRA.dg
      ONLINE  ONLINE       RAC1            STABLE
      ONLINE  ONLINE       RAC2            STABLE
ora.LISTENER.lsnr
      ONLINE  ONLINE       RAC1            STABLE
      OFFLINE OFFLINE      RAC2            STABLE
ora.OCR_VOTING.dg
      ONLINE  ONLINE       RAC1            STABLE
      ONLINE  ONLINE       RAC2            STABLE
ora.asm
      ONLINE  ONLINE       RAC1            Started,STABLE
      ONLINE  ONLINE       RAC2            Started,STABLE
ora.net1.network
      ONLINE  ONLINE       RAC1            STABLE
      ONLINE  ONLINE       RAC2            STABLE
ora.net2.network
      OFFLINE OFFLINE      RAC1            STABLE
      OFFLINE OFFLINE      RAC2            STABLE
ora.ons
      ONLINE  ONLINE       RAC1            STABLE
      ONLINE  ONLINE       RAC2            STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       RAC2            STABLE
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       RAC1            STABLE
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       RAC1            STABLE
ora.MGMTLSNR
      1        OFFLINE OFFLINE                      STABLE
ora.cvu
      1        ONLINE  ONLINE       RAC1            STABLE
ora.RAC1.vip
      1        ONLINE  ONLINE       RAC1            STABLE
ora.RAC2_2.vip
      1        OFFLINE OFFLINE                      STABLE
ora.oc4j
      1        ONLINE  ONLINE       RAC1            STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       RAC2            STABLE
ora.scan2.vip
      1        ONLINE  ONLINE       RAC1            STABLE
ora.scan3.vip
      1        ONLINE  ONLINE       RAC1            STABLE
ora.wacprod.db
      1        ONLINE  ONLINE       RAC1            Open,STABLE
      2        ONLINE  ONLINE       RAC2            Open,STABLE
--------------------------------------------------------------------------------

In one of RAC setup , process ora.LISTENER.lsnr was in OFFLINE state. When I tried to start it throws an subjected error and LISTENER did not come up.

Its good to check for other cluster important process

[ora12c@RAC2 ~]$ crsctl check cluster -all
**************************************************************
RAC1:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
RAC2:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************

CSS,CRS,EVM seems to be fine.

Step 2 :-  Check are you able to ping VIP from both nodes

                                            Ping RAC1 virtual IP

[ora12c@RAC1 ~]$ ping RAC1-vip

PING RAC1 (RAC1) 56(84) bytes of data.
64 bytes from RAC1: icmp_seq=1 ttl=63 time=0.378 ms
64 bytes from RAC1: icmp_seq=2 ttl=63 time=0.313 ms
64 bytes from RAC1: icmp_seq=3 ttl=63 time=0.334 ms
64 bytes from RAC1: icmp_seq=4 ttl=63 time=0.438 ms
64 bytes from RAC1: icmp_seq=5 ttl=63 time=0.377 ms
^C
--- RAC1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3999ms
rtt min/avg/max/mdev = 0.313/0.368/0.438/0.043 ms

------------------------------------------------------------------------------------------------

                                             Ping RAC2 virtual IP

[ora12c@RAC1 ~]$ ping RAC2-vip

PING RAC2 (RAC2) 56(84) bytes of data.

Destination host unreachable.
Destination host unreachable.
Destination host unreachable.
Destination host unreachable.

This seems to be an issue.

Step 3 :- After doing some R&D , I found that VIP of RAC2 is not registered with CRS due to which LISTENER on RAC2 is not coming up.

Run srvctl config nodeapps -a to check both VIP's is registered or not

[ora12c@RAC2 ~]$ srvctl config nodeapps -a
Network 1 exists
Subnet IPv4: *.*.*.0/255.255.255.0/eno167832, static
Subnet IPv6:
Ping Targets:
Network is enabled
Network is individually enabled on nodes:
Network is individually disabled on nodes:
VIP exists: network number 1, hosting node RAC1
VIP Name: RAC1-vip.co.in
VIP IPv4 Address: *.*.*.*
VIP IPv6 Address:
VIP is enabled.
VIP is individually enabled on nodes:
VIP is individually disabled on nodes:

Above out put shows that only RAC1 vip is registered with CRS. It means we need to register RAC2 vip in CRS.

Step 4 :- Run as root
Go to Grid path ----> bin

[root@RAC1 ~]# cd /rdbms/app/12.1.0.2/grid/bin
[root@RAC1 bin]# ./srvctl add vip -n RAC2 -A RAC2-vip/255.255.255.0/eno167832 -k 2

Now both the VIPs are registered.


Run again srvctl config nodeapps -a to check both VIP's is registered or not

[root@rac1 bin]# ./srvctl config nodeapps -a

Network 1 exists
Subnet IPv4: *.*.*.0/255.255.255.0/eno167832, static
Subnet IPv6:
Ping Targets:
Network is enabled
Network is individually enabled on nodes:
Network is individually disabled on nodes:
VIP exists: network number 1, hosting node RAC1
VIP Name: RAC1-vip.co.in
VIP IPv4 Address: *.*.*.*
VIP IPv6 Address:
VIP is enabled.
VIP is individually enabled on nodes:
VIP is individually disabled on nodes:
VIP exists: network number 1, hosting node RAC2
VIP Name: RAC2-vip.co.in
VIP IPv4 Address: *.*.*.*
VIP IPv6 Address:
VIP is enabled.
VIP is individually enabled on nodes:
VIP is individually disabled on nodes:

Step 5 :- Start RAC2-vip
Attempting to start `ora.RAC2.vip` on member `RAC2`
Start of `ora.RAC2.vip` on member `RAC2` succeeded.
Attempting to start `ora.LISTENER.lsnr` on member `RAC2`

Start of `ora.LISTENER.lsnr` on member `RAC2` succeeded.

Now the both nodes VIP is registered and it is reachable.

Step 6:- Check the status again (Step 1 commands)

[ora12c@RAC2 ~]$ crsctl status res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
       ONLINE  ONLINE       RAC1            STABLE
       ONLINE  ONLINE       RAC2            STABLE
ora.FRA.dg
       ONLINE  ONLINE       RAC1            STABLE
       ONLINE  ONLINE       RAC2            STABLE
ora.LISTENER.lsnr
       ONLINE  ONLINE       RAC1            STABLE
       ONLINE  ONLINE       RAC2            STABLE
ora.OCR_VOTING.dg
       ONLINE  ONLINE       RAC1            STABLE
       ONLINE  ONLINE       RAC2            STABLE
ora.asm
       ONLINE  ONLINE       RAC1            Started,STABLE
       ONLINE  ONLINE       RAC2            Started,STABLE
ora.net1.network
       ONLINE  ONLINE       RAC1            STABLE
       ONLINE  ONLINE       RAC2            STABLE
ora.net2.network
       ONLINE ONLINE        RAC1            STABLE
       ONLINE ONLINE        RAC2            STABLE
ora.ons
       ONLINE  ONLINE       RAC1            STABLE
       ONLINE  ONLINE       RAC2            STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       RAC2            STABLE
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       RAC1            STABLE
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       RAC1            STABLE
ora.MGMTLSNR
      1        ONLINE ONLINE                        STABLE
ora.cvu
      1        ONLINE  ONLINE       RAC1            STABLE
ora.RAC1.vip
      1        ONLINE  ONLINE       RAC1            STABLE
ora.RAC2_2.vip
      1        ONLINE ONLINE                        STABLE
ora.oc4j
      1        ONLINE  ONLINE       RAC1            STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       RAC2            STABLE
ora.scan2.vip
      1        ONLINE  ONLINE       RAC1            STABLE
ora.scan3.vip
      1        ONLINE  ONLINE       RAC1            STABLE
ora.wacprod.db
      1        ONLINE  ONLINE       RAC1            Open,STABLE
      2        ONLINE  ONLINE       RAC2            Open,STABLE
--------------------------------------------------------------------------------


Issue Resolved :)



Thats It :)

Segmentation fault (core dumped) occures when 32 bit and 64 bit oracle client install on same machine

Issue :- 

A “Segmentation Fault” error while trying to run sqlplus on a newly installed client/server. 
Also it may occures when 32 bit and 64 bit oracle client install on same machine




Cause :-
OS-related issue on RHEL 7 with Oracle SQL*Plus 12.1.0.2 32-bit client 


Solution 1:-

1.  Login as root user.
2. Create an empty file /etc/sysconfig/64bit_strstr_via_64bit_strstr_sse2_unaligned 


Solution 2:-

1. Go to $ORACLE_HOME/bin/
2. run ./relink



Thats It :)

ORA-01565: error in identifying file '+DATA/DB_NAME/spfileDB_NAME.ora'

ISSUE :- 
SQL> startup
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DATA/DB_NAME/spfileDB_NAME.ora'
ORA-17503: ksfdopn:2 Failed to open file +DATA/DB_NAME/spfileDB_NAME.ora
ORA-27140: attach to post/wait facility failed
ORA-27300: OS system dependent operation:invalid_egid failed with status: 1
ORA-27301: OS failure message: Operation not permitted
ORA-27302: failure occurred at: skgpwinit6
ORA-27303: additional information: startup egid = 501 (oinstall), current egid = 502 (dba)
SQL>
SQL>

Solution :- 

SQL> exit
Disconnected
[ora12c@Server2 ~]$
[ora12c@Server2 ~]$
[ora12c@Server2 ~]$ . ./.bash_profile_asm         //Set ASM Profile
[ora12c@Server2 ~]$
[ora12c@Server2 ~]$ asmcmd                        //Connect to ASM prompt
ASMCMD> ls                                        // Check where sp file is present
DATA/
FRA/
OCR_VOTING/

ASMCMD> cd DATA/

ASMCMD> ls
DB_NAME/

ASMCMD> cd DB_NAME/

ASMCMD> ls
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
PASSWORD/
TEMPFILE/

ASMCMD> cd PARAMETERFILE/
ASMCMD> ls
spfile.932.934567412

ASMCMD> pwd
+DATA/DB_NAME/PARAMETERFILE          //Location for current SP file

ASMCMD> cd ..                         


ASMCMD> pwd
+DATA/DB_NAME/            //Location where we have to create SP file
         

Create alias for spfile to location +DATA/DB_NAME/  as per error

ASMCMD> mkalias +DATA/DB_NAME/PARAMETERFILE/spfile.932.934567412  spfileDB_NAME.ora

ASMCMD> ls -l
Type  Redund  Striped  Time   Sys  Name
                               Y    ARCHIVELOG/
                               Y    CONTROLFILE/
                               Y    DATAFILE/
                               Y    ONLINELOG/
                               Y    PARAMETERFILE/
                               Y    TEMPFILE/
                               N    spfileDB_NAME.ora => +DATA/DB_NAME/PARAMETERFILE/spfile.932.934567412 

ASMCMD> exit
[ora12c@Server2 ~]$ which crsctl
/rdbms/app/12.1.0.2/grid/bin/crsctl
[ora12c@Server2 ~]$
[ora12c@Server2 ~]$

Stop the cluster :-

[ora12c@Server2 ~]$ sudo /rdbms/app/12.1.0.2/grid/bin/crsctl stop crs      
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'Server2'
CRS-2673: Attempting to stop 'ora.crsd' on 'Server2'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'Server2'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'Server2'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'Server2'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'Server2'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'Server2' succeeded
CRS-2673: Attempting to stop 'ora.Server2.vip' on 'Server2'
CRS-2677: Stop of 'ora.FRA.dg' on 'Server2' succeeded
CRS-2677: Stop of 'ora.DATA.dg' on 'Server2' succeeded
CRS-2673: Attempting to stop 'ora.OCR_VOTING.dg' on 'Server2'
CRS-2677: Stop of 'ora.OCR_VOTING.dg' on 'Server2' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'Server2'
CRS-2677: Stop of 'ora.asm' on 'Server2' succeeded
CRS-2677: Stop of 'ora.Server2.vip' on 'Server2' succeeded
CRS-2672: Attempting to start 'ora.Server2.vip' on 'Server1'
CRS-2676: Start of 'ora.Server2.vip' on 'Server1' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'Server2'
CRS-2677: Stop of 'ora.ons' on 'Server2' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'Server2'
CRS-2677: Stop of 'ora.net1.network' on 'Server2' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'Server2' has completed
CRS-2677: Stop of 'ora.crsd' on 'Server2' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'Server2'
CRS-2673: Attempting to stop 'ora.evmd' on 'Server2'
CRS-2673: Attempting to stop 'ora.storage' on 'Server2'
CRS-2673: Attempting to stop 'ora.gpnpd' on 'Server2'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'Server2'
CRS-2677: Stop of 'ora.storage' on 'Server2' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'Server2'
CRS-2677: Stop of 'ora.ctssd' on 'Server2' succeeded
CRS-2677: Stop of 'ora.gpnpd' on 'Server2' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'Server2' succeeded
CRS-2677: Stop of 'ora.evmd' on 'Server2' succeeded
CRS-2677: Stop of 'ora.asm' on 'Server2' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'Server2'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'Server2' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'Server2'
CRS-2677: Stop of 'ora.cssd' on 'Server2' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'Server2'
CRS-2677: Stop of 'ora.gipcd' on 'Server2' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'Server2' has completed
CRS-4133: Oracle High Availability Services has been stopped.
[ora12c@Server2 ~]$
[ora12c@Server2 ~]$
[ora12c@Server2 ~]$

Start the cluster :-

[ora12c@Server2 ~]$ sudo /rdbms/app/12.1.0.2/grid/bin/crsctl start crs
CRS-4123: Oracle High Availability Services has been started.


Thats it :)