Oracle Troubleshoot : ORA-12518: TNS:listener could not hand off client connection

Oracle Troubleshoot : ORA-12518: TNS:listener could not hand off client connection

วันนี้มีเรื่องราวปัญหา Oracle มาเล่าสู่กันฟัง เป็นปัญหาที่เกิดขึ้นตอนที่เราสร้างการเชื่อมต่อไปยังฐานข้อมูล oracle
ดังตัวอย่าง

C:\>tnsping db10

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=localhost) (PORT=1522)) (CONNECT_DATA= (SERVICE_NAME=DB10)))

OK (20 msec)

destination service open แต่ไม่สามารถเชื่อมต่อได้

C:\>sqlplus system@db10?

SQL*Plus: Release 10.2.0.1.0 – Production on Thu Aug 20 21:45:16 2009
Copyright (c) 1982, 2005, Oracle.? All rights reserved.
Enter password:

ERROR:
ORA-12518: TNS:listener could not hand off client connection

?

ปัญหานี้เกิดขึ้นเนื่องจากเซิร์ฟเวอร์ไม่สามารถสร้าง connection ใหม่ที่เข้ามาได้ ซึ่งเกิดขึ้นได้จากหลายสาเหตุเช่น

1. Database Service ไม่พร้อมให้บริการ เกิดขึ้นกับ Oracle on MS Windows (ปกติถ้าเป็น Oracle Database ยังไม่ startup เมื่อ connect เข้าไปจะขึ้นข้อความว่า ORA-01034: ORACLE not available, ORA-27101: shared memory realm does not exist) เนื่องจากมี Windows services control อยู่

2. not enough memory?อาจมีทรัพยากรไม่เพียงพอที่จะสร้าง connection ใหม่ได้

3. exceed maximum connection ในกรณีที่ server ให้บริการแบบ shared server process ปัญหานี้อาจเกิดขึ้นได้ถ้า dispatcher ไม่สามารถรับ connection ใหม่ได้แล้ว หรือในกรณีของ Dedicated server หากจำนวน processes เกินกว่าค่าที่กำหนดไว้ก็จะทำให้เข้าไม่ได้

Working around

แนวทางแก้ไขปัญหานี้ หลักๆคือการตรวจสอบ configuration ,resources ว่ามีส่วนไหนไม่เพียงพอหรือเปล่า ซึ่งอาจะทำตามขั้นตอนเบื้องต้นดังนี้
1. ตรวจสอบ database services status ว่ายังเปิดให้บริการอยู่หรือเปล่า (MS Windows)
2. ตรวจสอบ free memory resource หากไม่พออาจสร้าง swap จาก harddisk มาใช้ก่อนหรือเพิ่ม memory
3. ในกรณีของ shared server ลองปรับค่าตัวแปร LARGE_POOL_SIZE เพิ่มขึ้น หรือให้ลองสร้าง DISPACHER เพิ่มเข้าไป
4. ในกรณีของ dedicated server ให้ปรับค่าตัวแปร PROCESSES ให้มีค่าเพิ่มขึ้น ซึ่งเราสามารถตรวจสอบการใช้งานได้จาก statemetn ดังนี้

SQL> select * from v$resource_limit where resource_name=’processes’;?

RESOURCE_NAME?? CURRENT_UTILIZATION MAX_UTILIZATION INITIAL_AL LIMIT_VALUE

————— ——————- ————— ———- ———-

processes 29 30? 30 30

ถ้าค่า MAX_UTILIZATION = LIMIT_VALUE จะทำให้ database ไม่สามารถรับ connection ใหม่ได้ จำเป็นต้องขยาย processes parameter.

5. นอกจากนี้เราอาจตรวจสอบเพิ่มเติมจาก listener.log , trace file ว่ามีข้อความ error ที่เกี่ยวข้องอีกหรือเปล่า หรือตรวจสอบ listener configuration, status ให้ถูกต้องอีกครั้งแล้วลอง restart listener? ใหม่ครับ

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *