เกี่ยวกับ SQLNET.INBOUND_CONNECT_TIMEOUT
- หน่วยวินาที default = 60
- สำหรับเมื่อ client มีการขอเชื่อมต่อกับเครือข่ายหรือเรียกว่ามีการสร้าง connection request แล้ว แต่ยังไม่สามารถ authenticate connection หรือ
ไคลเอนต์ไม่สามารถสร้างการเชื่อมต่อ establish a connection และรับรองความถูกต้อง complete authentication ให้เสร็จสิ้นภายในเวลาที่กำหนด นั่นคือ connection ยังไม่ complete
จนหมดเวลาที่กำหนดใน SQLNET.INBOUND_CONNECT_TIMEOUT แล้ว database server จะตัดการเชื่อมต่อ เรียกว่า connection time taking long
- ใช้ป้องกัน listener และ Database Server จากการโจมตีของ Denial-of-Service attack ที่ส่ง connection มาจำนวนมากแต่ไม่ถูกใช้หรือไม่มีการปิดจาก client
โดยตรวจสอบจาก sqlnet.log ว่ามาจาก IP ที่แปลกปลอมหรือไม่
- แสดง error ที่ sqlnet.log file คือ ORA-12170: TNS:Connect timeout occurred
- แสดง error ที่ Client คือ ORA-12547: TNS:lost contact หรือ ORA-12637: Packet gets failed
กำหนดค่า SQLNET.INBOUND_CONNECT_TIMEOUT
--> lsnrctl
LSNRCTL> show inbound_connect_timeout
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=CSPDDB001)(PORT=1521)))
LISTENER parameter "inbound_connect_timeout" set to 60
The command completed successfully
LSNRCTL> set inbound_connect_timeout 120
LSNRCTL> show inbound_connect_timeout
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=CSPDDB001)(PORT=1521)))
LISTENER parameter "inbound_connect_timeout" set to 120
The command completed successfully
ตรวจสอบ SQLNET.INBOUND_CONNECT_TIMEOUT ด้วยการเชื่อมต่อเครื่อง Database ผ่าน port 1521 เพื่อให้เกิดการสร้าง connection request
ที่ Local ดู log
--> tail -f /oracle/diag/tnslsnr/oradb12c/listener1/alert/log.xml
ที่ Client ทดสอบสร้าง connection request ด้วย telnet และปล่อยทิ้งไว้
--> telnet 192.168.1.128 1521
ที่ Local ดู process ผ่าน netstat จะพบว่า listener จับกับ server process ของ client นั้นๆ เพราะ listener ตัวนี้กำหนดให้จับ client process ที่ติดต่อผ่าน port 1521
จะได้ PID = 26181
--> netstat -anp | grep 192.168.1.1
...
....
.....
tcp 0 0 ::ffff:192.168.1.128:1521 ::ffff:192.168.1.1:9494 ESTABLISHED 26181/tnslsnr
ที่ Local ดู process จะพบ listener ชื่อ listener1
--> ps -ef|grep 26181
oracle 26181 1 0 Nov25 ? 00:00:38 /oracle/product/12.2.0/dbhome_1/bin/tnslsnr listener1 -inherit
ที่ Local ดู log จะพบ error นี้เมื่อเกินเวลาที่กำหนด
TNS-12525: TNS:listener has not received client's request in time allowed
หรือ TNS-12535: TNS:operation timed out
--> tail -f /oracle/diag/tnslsnr/oradb12c/listener1/alert/log.xml
...
....
.....
host_addr='192.168.1.128' pid='26181'>
TNS-12535: TNS:operation timed out
TNS-12606: TNS: Application timeout occurred