oracle 11gr2 SCAN LISTENER配置

panpong發表於2014-08-14

儲存故障導致手動重建建立資料庫後,出現透過tns不能連線的問題;檢查發現tnsnames.ora中配置的hostscan_ip;但是,如果透過vip則可以訪問資料庫;那麼可以確定是scan ipscan listener問題;

檢查所有listener後,發現LISTENERLISTENER_SCAN1狀態都正常,只是LISTENER_SCAN1沒有註冊服務;對比重建前後的相關listener引數後,發現新建立的資料庫remote_listener引數沒有設定,設定後正常,問題解決;下面是測試環境的配置表;

grid使用者下$GRID_HOME/network/admin/listener.ora

[grid@db1 admin]$ cat listener.ora

LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))))                # line added by Agent

LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))            # line added by Agent

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON              # line added by Agent

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON                # line added by Agent

 

grid使用者下$GRID_HOME/network/admin/sqlnet.ora

[grid@db1 admin]$ cat sqlnet.ora

# sqlnet.ora.db1 Network Configuration File: /u01/app/11.2.0/grid/network/admin/sqlnet.ora.db1

# Generated by Oracle configuration tools.

 

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

 

ADR_BASE = /u01/app/grid

 

oracle使用者下$ORACLE_HOME/network/admin/tnsnames.ora

[oracle@db1 admin]$ cat tnsnames.ora

# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.

 

RACDB =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = racdb)

    )

  )

此時,如果沒有設定remote_listener引數,則不能透過scan ip登入,如:

$sqlplus system/oracle@racdb

報錯,不能連線;

設定remote_listener後正常;

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

SQL>show parameter listener

 

NAME                                 TYPE        VALUE

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

listener_networks                    string

local_listener                       string      (DESCRIPTION=(ADDRESS_LIST=(AD

DRESS=(PROTOCOL=TCP)(HOST=192

.168.1.120)(PORT=1521))))

remote_listener                      string      rac-scan:1521

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/16976507/viewspace-1250912/,如需轉載,請註明出處,否則將追究法律責任。

相關文章