Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.8k views
in Technique[技术] by (71.8m points)

The listener supports no services - 2 databases on oracle linux 7

I'm running two 12c R2 databases on linux oracle 7.9 I've installed the first database (CDB) and also a listener and both of them were running fine. Then, I've installed another 12c R2 database (CDB2) on the same system.

These are my instances:

CDB
CDB2

The problem is that if I want to startup only the second database(CDB2), and then the listener, when running lsnrctl status LISTENER it says: The listener supports no services

If I startup the first database after that (CDB), the listener comes to life saying that it supports both of the services (CDB and CDB2).

So, it only support CDB2 if I also startup CDB. If I startup only CDB2, it does not support it.

But, after I started CDB and after listener started supporting both services, if i shutdown CDB, the listener is still supporting CDB2.

So, as a summary: If i startup CDB2 and then the listener, the listener does not support any services. If I startup CDB after, the listener supports both dbs. If I shutdown CDB after, the listener supports only CDB2 which is what i want in the first place.

First step:

[oracle@oel7 ~]$ ps -ef | grep pmon
oracle    4350  2463  0 20:56 pts/0    00:00:00 grep --color=auto pmon
[oracle@oel7 ~]$ ps -ef | grep tns
root        37     2  0 20:37 ?        00:00:00 [netns]
oracle    4458  2463  0 20:57 pts/0    00:00:00 grep --color=auto tns
[oracle@oel7 ~]$

Starting CDB2 & listener:

[oracle@oel7 ~]$ ps -ef | grep pmon
oracle    2547     1  0 20:41 ?        00:00:00 ora_pmon_CDB2
oracle    4498  2463  0 20:58 pts/0    00:00:00 grep --color=auto pmon
[oracle@oel7 ~]$
[oracle@oel7 ~]$ ps -ef | grep tns
root        37     2  0 20:37 ?        00:00:00 [netns]
oracle    4537     1  0 20:58 ?        00:00:00 /u01/app/oracle/product/12.2.0/dbhome_1/bin/tnslsnr LISTENER -inherit
oracle    4563  2463  0 20:59 pts/0    00:00:00 grep --color=auto tns
[oracle@oel7 ~]$

STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                21-JAN-2021 20:42:01
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/               listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/oel7/listener/alert/log.x               ml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel7.localdomain)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully

After starting CDB:

[oracle@oel7 dbhome_1]$ ps -ef | grep pmon
oracle    2351     1  0 20:41 ?        00:00:00 ora_pmon_CDB
oracle    2547     1  0 20:41 ?        00:00:00 ora_pmon_CDB2
oracle    4814  2463  0 21:02 pts/0    00:00:00 grep --color=auto pmon
[oracle@oel7 dbhome_1]$

STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                21-JAN-2021 20:42:01
Uptime                    0 days 0 hr. 0 min. 49 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/               listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/oel7/listener/alert/log.x               ml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel7.localdomain)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=oel7.localdomain)(PORT=5500))(Secur               ity=(my_wallet_directory=/u01/app/oracle/admin/CDB/xdb_wallet))(Presentation=HTT               P)(Session=RAW))
Services Summary...
Service "CDB.localdomain" has 1 instance(s).
  Instance "CDB", status READY, has 1 handler(s) for this service...
Service "CDB2" has 1 instance(s).
  Instance "CDB2", status READY, has 1 handler(s) for this service...
Service "CDB2XDB" has 1 instance(s).
  Instance "CDB2", status READY, has 1 handler(s) for this service...
Service "CDBXDB.localdomain" has 1 instance(s).
  Instance "CDB", status READY, has 1 handler(s) for this service...
Service "b8c025790af43eafe0536f64a8c04644.localdomain" has 1 instance(s).
  Instance "CDB", status READY, has 1 handler(s) for this service...
Service "cdbpdb1.localdomain" has 1 instance(s).
  Instance "CDB", status READY, has 1 handler(s) for this service...
The command completed successfully

After shutdown of CDB and only CDB2 running:

STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                21-JAN-2021 20:58:52
Uptime                    0 days 0 hr. 4 min. 55 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/oel7/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel7.localdomain)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "CDB2" has 1 instance(s).
  Instance "CDB2", status READY, has 1 handler(s) for this service...
Service "CDB2XDB" has 1 instance(s).
  Instance "CDB2", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@oel7 dbhome_1]$

And also, even if i stop and start again the listener (having only CDB2 running - closing CDB), it is working as it should be:

STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                21-JAN-2021 20:58:52
Uptime                    0 days 0 hr. 4 min. 55 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/oel7/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel7.localdomain)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "CDB2" has 1 instance(s).
  Instance "CDB2", status READY, has 1 handler(s) for this service...
Service "CDB2XDB" has 1 instance(s).
  Instance "CDB2", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@oel7 dbhome_1]$
 

Both database have the same Oracle Home in:/u01/app/oracle/product/12.2.0/dbhome_1

Network files:

[oracle@oel7 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = oel7.localdomain)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

[oracle@oel7 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
   
LISTENER_CDB =
  (ADDRESS = (PROTOCOL = TCP)(HOST = oel7.localdomain)(PORT = 1521))
    
CDB2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oel7.localdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = CDB2)
    )
  )

CDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oel7.localdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = CDB.localdomain)
    )
  )

What is the problem? Why the listener does not support the second database (CDB2) from the first time and I have to startup also the first database (CDB) in order for it to support both of them?

Thanks.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...