[20190314]理解TRANSPORT_CONNECT_TIMEOUT RETRY_COUNT引數在tnsnames.ora.tx
[20190314]理解LOAD_BALANCE TRANSPORT_CONNECT_TIMEOUT RETRY_COUNT引數在tnsnames.ora.txt
--//連結:
--//以前也做過類似測試:http://blog.itpub.net/267265/viewspace-2199977/
TRANSPORT_CONNECT_TIMEOUT:
"The TRANSPORT_CONNECT_TIMEOUT parameter specifies the time, in seconds, for a client to establish a TCP connection to
the database server. The default value is 60 seconds." For more information, click here
RETRY_COUNT:
"To specify the number of times an ADDRESS list is traversed before the connection attempt is terminated." For more
information, click here
--//實際上測試次數是RETRY_COUNT+1.
--//重複測試:
1.在/tmp目錄下建立tnsnames.ora,內容如下:
$ export TNS_ADMIN=/tmp
$ cat tnsnames.ora
CLIENT_CON =
(DESCRIPTION =
(LOAD_BALANCE=ON)
(TRANSPORT_CONNECT_TIMEOUT=3)(RETRY_COUNT=2)
(ADDRESS = (PROTOCOL = TCP)(HOST =10.10.10.10)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST =11.11.11.11)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST =12.12.12.12)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST =13.13.13.13)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST =14.14.14.14)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST =15.15.15.15)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orclgg)
))
2.測試:
$ export TNS_ADMIN=/tmp
$ strace -tT -f tnsping client_con 2>&1 | grep 'connect'
$ strace -tT -f tnsping client_con 2>&1 | grep 'connect'
08:58:03 connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory) <0.000033>
08:58:03 connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory) <0.000033>
08:58:03 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("15.15.15.15")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000052>
08:58:06 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("12.12.12.12")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000042>
08:58:09 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("14.14.14.14")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000044>
08:58:12 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("11.11.11.11")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000041>
08:58:15 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("13.13.13.13")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000041>
08:58:18 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("10.10.10.10")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000042>
08:58:21 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("12.12.12.12")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000042>
08:58:24 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("10.10.10.10")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000041>
08:58:27 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("11.11.11.11")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000041>
08:58:30 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("14.14.14.14")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000043>
08:58:33 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("13.13.13.13")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000042>
08:58:36 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("15.15.15.15")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000041>
08:58:39 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("10.10.10.10")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000044>
08:58:42 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("12.12.12.12")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000043>
08:58:45 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("15.15.15.15")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000042>
08:58:48 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("11.11.11.11")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000040>
08:58:51 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("13.13.13.13")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000045>
08:58:54 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("14.14.14.14")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000041>
--//分成3組,也就是嘗試3次.每次選擇的IP不是定義的順序(LOAD_BALANCE=ON).
--//如果連線不上,時間間隔是3秒嘗試下一個.
3.修改tnsnames.ora檔案(LOAD_BALANCE=OFF):
--//重複測試:
$ strace -tT -f tnsping client_con 2>&1 | grep -E 'connect'
09:01:46 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("10.10.10.10")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000050>
09:01:49 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("11.11.11.11")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000042>
09:01:52 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("12.12.12.12")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000042>
09:01:55 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("13.13.13.13")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000043>
09:01:58 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("14.14.14.14")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000044>
09:02:01 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("15.15.15.15")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000042>
09:02:04 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("10.10.10.10")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000042>
09:02:07 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("11.11.11.11")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000046>
09:02:10 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("12.12.12.12")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000036>
09:02:13 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("13.13.13.13")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000034>
09:02:16 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("14.14.14.14")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000036>
09:02:19 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("15.15.15.15")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000038>
09:02:22 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("10.10.10.10")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000037>
09:02:25 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("11.11.11.11")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000038>
09:02:28 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("12.12.12.12")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000037>
09:02:31 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("13.13.13.13")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000038>
09:02:34 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("14.14.14.14")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000037>
09:02:37 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("15.15.15.15")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000037>
--//可以發現嘗試順便選擇的IP是定義的順序.
4.取消TRANSPORT_CONNECT_TIMEOUT設定:
$ cat tnsnames.ora
CLIENT_CON =
(DESCRIPTION =
(LOAD_BALANCE=OFF)
(RETRY_COUNT=1)
(ADDRESS = (PROTOCOL = TCP)(HOST =10.10.10.10)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST =11.11.11.11)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST =12.12.12.12)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST =13.13.13.13)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST =14.14.14.14)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST =15.15.15.15)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orclgg)
))
$ strace -tT -f tnsping client_con 2>&1 | grep -E 'connect'
09:05:53 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("10.10.10.10")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000052>
09:06:53 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("11.11.11.11")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000045>
09:07:53 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("12.12.12.12")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000047>
09:08:53 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("13.13.13.13")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000057>
09:09:53 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("14.14.14.14")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000057>
09:10:53 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("15.15.15.15")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000067>
09:11:53 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("10.10.10.10")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000056>
09:12:53 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("11.11.11.11")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000051>
09:13:53 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("12.12.12.12")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000042>
09:14:54 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("13.13.13.13")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000043>
09:15:54 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("14.14.14.14")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000045>
09:16:54 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("15.15.15.15")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000043>
--//可以發現間隔是60秒,也就是預設TRANSPORT_CONNECT_TIMEOUT=60.
4.取消RETRY_COUNT設定:
$ cat tnsnames.ora
CLIENT_CON =
(DESCRIPTION =
(LOAD_BALANCE=OFF)
(TRANSPORT_CONNECT_TIMEOUT=1)
(ADDRESS = (PROTOCOL = TCP)(HOST =10.10.10.10)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST =11.11.11.11)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST =12.12.12.12)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST =13.13.13.13)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST =14.14.14.14)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST =15.15.15.15)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orclgg)
))
$ strace -tT -f tnsping client_con 2>&1 | grep 'connect'
09:20:05 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("10.10.10.10")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000047>
09:20:06 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("11.11.11.11")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000041>
09:20:07 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("12.12.12.12")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000050>
09:20:08 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("13.13.13.13")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000042>
09:20:09 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("14.14.14.14")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000043>
09:20:10 connect(4, {sa_family=AF_INET, sin_port=htons(1522), sin_addr=inet_addr("15.15.15.15")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000042>
--//預設RETRY_COUNT=0.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2638329/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle11gr2網路配置新增TRANSPORT_CONNECT_TIMEOUT引數Oracle
- jmeter 引數理解JMeter
- 深入理解mysql引數MySql
- linux find depth引數理解Linux
- find命令-mtime引數理解
- 深入理解JVM(三)——配置引數JVM
- flume 寫往hdfs引數理解分析
- linux,mtime引數的理解Linux
- 帶你深入理解傳遞引數
- Request 接收引數亂碼原理解析
- JavaScript引數傳遞的深入理解JavaScript
- 理解spread運算子與rest引數REST
- 引數FAST_START_MTTR_TARGET的理解AST
- 1.5 - Numpy的方法中,axis引數的理解
- 在WinDbg指令碼中使用引數指令碼
- optimizer_dynamic_sampling引數的理解
- 初始化引數OPEN_CURSORS的理解加深
- v$session中LAST_CALL_ET引數的理解SessionAST
- kettle 引數——變數引數和常量引數變數
- 在Solaris10上配置核心引數
- 3、在Shell程式中使用的引數
- 淺談對python pandas中 inplace 引數的理解Python
- 你都理解建立執行緒池的引數嗎?執行緒
- innodb_flush_log_at_trx_commit引數的直白理解MIT
- 關於 groutine 喚醒中 skipframes 引數不理解
- 深入理解RabbitMQ中的prefetch_count引數MQ
- JAVAScript柯里化、部分應用引數終極理解JavaScript
- JavaScript引數傳遞中值和引用的一種理解JavaScript
- 隱含引數_minimum_giga_scn的理解
- RAC中對DB引數檔案的簡單理解
- Oracle一些引數的理解 cursor_sharingOracle
- 在COM中使用陣列引數-ICollection (轉)陣列
- 【Data Pump】理解expdp中的ESTIMATE和ESTIMATE_ONLY引數
- MYSQL INNODB innodb_thread_concurrency相關引數理解MySqlthread
- 2、從引數估計的角度理解邏輯迴歸邏輯迴歸
- F5負載均衡器的重要引數理解負載
- Oracle引數-隱藏引數Oracle
- 對 “C語言指標變數作為函式引數” 的個人理解C語言指標變數函式