REMOTE_LISTENER對LOAD_BALANCE的影響(一)
如果使用DBCA建立RAC資料庫,預設情況下會在各個節點上配置REMOTE_LISTENER引數,因此以前測試的LOAD_BALANCE是在REMOTE_LISTENER存在的情況下進行的測試,這裡測試一下去掉REMOTE_LISTENER對LOAD_BALANCE的影響。
連線RAC資料庫中單個例項(二):http://yangtingkun.itpub.net/post/468/508047
資料庫環境為10.2.0.4 Rac for Solaris for sparc 64:
SQL> SELECT * FROM V$VERSION;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Solaris: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL> SELECT NAME FROM V$DATABASE;
NAME
---------
TESTRAC
SQL> SELECT INSTANCE_NUMBER, INSTANCE_NAME FROM GV$INSTANCE;
INSTANCE_NUMBER INSTANCE_NAME
--------------- ----------------
1 testrac1
2 testrac2
檢查節點1上LISTENER相關配置:
SQL> SELECT INSTANCE_NAME FROM V$INSTANCE;
INSTANCE_NAME
----------------
testrac1
SQL> SHOW PARAMETER LISTENER
NAME TYPE VALUE
---------------- ----------- ------------------------------
local_listener string (ADDRESS = (PROTOCOL = TCP)(HOST = 172.25.198.224)(PORT = 1521))
remote_listener string
節點2上的引數配置:
SQL> SELECT INSTANCE_NAME FROM V$INSTANCE;
INSTANCE_NAME
----------------
testrac2
SQL> SHOW PARAMETER LISTENER
NAME TYPE VALUE
---------------- ----------- ------------------------------
local_listener string (ADDRESS = (PROTOCOL = TCP)(HOST = 172.25.198.225)(PORT = 1521))
remote_listener string
將本地TNSNAMES.ORA中服務名配置為:
TESTRAC =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.25.198.224)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.25.198.225)(PORT = 1521))
(LOAD_BALANCE = NO)
)
(CONNECT_DATA =
(SERVICE_NAME = TESTRAC)
)
)
根據文章開頭給出的連線文章可以確定,當REMOTE_LISTENER設定為空時,服務名指定一個地址,連線這個服務名是不會連線到兩個例項上的,這裡測試一下當存在兩個地址的情況,先將LOAD_BALANCE設定為NO:
SQL> HOST SQLPLUS YANGTK/YANGTK@TESTRAC
SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 11月 3 11:34:39 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
連線到:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> SELECT INSTANCE_NAME FROM V$INSTANCE;
INSTANCE_NAME
----------------
testrac1
SQL> HOST SQLPLUS YANGTK/YANGTK@TESTRAC
SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 11月 3 11:34:42 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
連線到:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> SELECT INSTANCE_NAME FROM V$INSTANCE;
INSTANCE_NAME
----------------
testrac1
SQL> HOST SQLPLUS YANGTK/YANGTK@TESTRAC
SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 11月 3 11:34:45 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
連線到:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> SELECT INSTANCE_NAME FROM V$INSTANCE;
INSTANCE_NAME
----------------
testrac1
SQL> EXIT
從 Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options 斷開
SQL> EXIT
從 Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options 斷開
SQL> EXIT
從 Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options 斷開
由於LOAD_BALANCE設定為NO,Oracle找到第一個可用的連線即可,因此每次都連線到例項1上,下面修改TESTRAC服務名,將兩個地址調換位置:
TESTRAC =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.25.198.225)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.25.198.224)(PORT = 1521))
(LOAD_BALANCE = NO)
)
(CONNECT_DATA =
(SERVICE_NAME = TESTRAC)
)
)
測試TESTRAC的連線:
SQL> HOST SQLPLUS YANGTK/YANGTK@TESTRAC
SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 11月 3 11:36:29 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
連線到:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> SELECT INSTANCE_NAME FROM V$INSTANCE;
INSTANCE_NAME
----------------
testrac2
SQL> HOST SQLPLUS YANGTK/YANGTK@TESTRAC
SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 11月 3 11:36:31 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
連線到:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> SELECT INSTANCE_NAME FROM V$INSTANCE;
INSTANCE_NAME
----------------
testrac2
SQL> HOST SQLPLUS YANGTK/YANGTK@TESTRAC
SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 11月 3 11:36:33 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
連線到:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> SELECT INSTANCE_NAME FROM V$INSTANCE;
INSTANCE_NAME
----------------
testrac2
SQL> EXIT
從 Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options 斷開
SQL> EXIT
從 Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options 斷開
SQL> EXIT
從 Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options 斷開
將LOAD_BALANCE設定為YES(LOAD_BALANCE設定YES、ON、TRUE是等價的,相反的設定包括NO、OFF、FALSE):
TESTRAC =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.25.198.225)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.25.198.224)(PORT = 1521))
(LOAD_BALANCE = YES)
)
(CONNECT_DATA =
(SERVICE_NAME = TESTRAC)
)
)
檢查此時的連線設定:
SQL> HOST SQLPLUS YANGTK/YANGTK@TESTRAC
SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 11月 3 11:41:49 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
連線到:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> SELECT INSTANCE_NAME FROM V$INSTANCE;
INSTANCE_NAME
----------------
testrac2
SQL> HOST SQLPLUS YANGTK/YANGTK@TESTRAC
SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 11月 3 11:41:52 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
連線到:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> SELECT INSTANCE_NAME FROM V$INSTANCE;
INSTANCE_NAME
----------------
testrac1
SQL> EXIT
從 Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options 斷開
SQL> EXIT
從 Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options 斷開
當引數對於REMOTE_LISTENER不存在時,單主機地址的使用者無法利用LOAD_BALANCE,但是如果配置了兩個地址,那麼設定LOAD_BALANCE是可以正常工作的。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/4227/viewspace-677596/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- REMOTE_LISTENER對LOAD_BALANCE的影響(二)REM
- REMOTE_LISTENER對靜態FAILOVER的影響REMAI
- “影響者研究”系列(一):社會網路化時代影響者對營銷創新的影響
- 【Oracle】-【COMMIT對索引的影響】-從trace看COMMIT對索引的影響OracleMIT索引
- shrink 操作對索引的影響索引
- Update操作對索引的影響索引
- unusable index對DML/QUERY的影響Index
- Arraysize 對consistent get的影響
- mysql event對主從的影響MySql
- 新增欄位對SQL的影響SQL
- 語言對思維的影響
- 絕對定位對margin外邊距的影響
- shrink 與rebuild對索引高度的影響對比Rebuild索引
- 資料列not null對索引影響一例Null索引
- 遊戲暗示對於遊戲玩家的影響遊戲
- INDEX建立方式對SQL的影響IndexSQL
- 關於OPcache對Swoole影響的理解opcache
- 物聯網對企業的影響
- Web-Scale IT:對企業的影響Web
- 音樂對程式設計的影響程式設計
- JAVA 異常對於效能的影響Java
- 表型別對AUTO_INCREMENT的影響型別REM
- 對我影響最大的圖靈書圖靈
- 關於drop操作對role的影響
- Stripe Size大小對讀寫的影響
- append HINT 的對事務的影響APP
- 探索webpack熱更新對程式碼打包結果的影響(一)Web
- 從一次 FULL GC 卡頓談對服務的影響GC
- 小議分析函式中排序對結果的影響(一)函式排序
- Cirium:資料揭示新冠肺炎對中國航空業的影響及對全球航空旅遊增長的影響
- 淺談疫情對消費金融的影響
- cluster factor對執行計劃的影響
- JVM 引數調整對 sortx 的影響JVM
- 任正非談人工智慧對全球的影響人工智慧
- namespace對axis解析xml請求的影響namespaceXML
- margin為負值對佈局的影響
- python:super()對多繼承的影響Python繼承
- DB2 HADR對效能的影響DB2