案例:使用scan IP無法連接數據庫


環境:Oracle RAC(11.2.0.3)
現象:通過scanIP連接數據庫報錯ORA-12514: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

1.查看scan listener狀態,發現服務沒有注冊成功:

[grid@rac1 ~]$ lsnrctl status LISTENER_SCAN1

LSNRCTL for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production on 10-APR-2017 11:06:34

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN1
Version                   TNSLSNR for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production
Start Date                14-MAR-2017 23:19:53
Uptime                    26 days 11 hr. 46 min. 41 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      ON
Listener Parameter File   /oracle/app/grid_home/network/admin/listener.ora
Listener Log File         /oracle/app/grid_home/log/diag/tnslsnr/jyrac2/listener_scan1/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.80)(PORT=1521)))
The listener supports no services
The command completed successfully

2.Oracle用戶查看 remote_listener 參數配置:

SQL> show parameter remote_listener

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_listener                      string      

發現remote_listener參數為空,這顯然是不正常的。

3.查看/etc/hosts的scan IP配置行:
cat /etc/hosts

192.168.1.80 jyrac-scan

4.oracle用戶登錄數據庫,配置remote_listener參數:

SQL> alter system set remote_listener = 'jyrac-scan:1521' sid='*' scope=both;
SQL> alter system register;

5.再次查看scan listener狀態,發現服務已經注冊成功:

[grid@rac1 ~]$ lsnrctl status LISTENER_SCAN1

LSNRCTL for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production on 10-APR-2017 11:13:47

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN1
Version                   TNSLSNR for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production
Start Date                14-MAR-2017 23:19:53
Uptime                    26 days 11 hr. 53 min. 54 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      ON
Listener Parameter File   /oracle/app/grid_home/network/admin/listener.ora
Listener Log File         /oracle/app/grid_home/log/diag/tnslsnr/jyrac2/listener_scan1/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.80)(PORT=1521)))
Services Summary...
Service "SERVICE2" has 1 instance(s).
  Instance "testdb1", status READY, has 1 handler(s) for this service...
Service "testdb" has 2 instance(s).
  Instance "testdb1", status READY, has 1 handler(s) for this service...
  Instance "testdb2", status READY, has 1 handler(s) for this service...
Service "testdb2" has 1 instance(s).
  Instance "testdb2", status READY, has 1 handler(s) for this service...
The command completed successfully

再次測試通過scanip連接數據庫已經ok。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM