Fix Oracle Error: Service handle not Initialized

ในกรณีที่เราทำการ Query Data บน Oracle Database แล้วไม่สามารถทำการ Query ได้ เนื่องจาก Service Name ทำการ Connect Database ผิด ทำให้เกิด Service Handle not Initialized ส่งผลให้ไม่สามารถทำการ Query Data รวมถึงการ Start Database และ Shutdown Database ได้


Cause : สาเหตุเนื่องมาจาก Service Name ทำการ Connect Database ผิด ทำให้เกิด Service Handle not Initialized หากทำการ Restart Listener แล้วยังไม่หาย อาจะต้องทำการ Kill Process

SQL> shutdown immediate

ORA-24324: service handle not initialized
ORA-01041: internal error. hostdef extension doesn't exist

Configuration

  • ทำการตรวจสอบ Process ของ Oracle SID ทั้งหมด
# ps -ef | grep $ORACLE_SID
  • ทำการ Kill Process ทั้งหมดของ Oracle SID ที่ต้องการ
# ps -ef | grep $ORACLE_SID | grep -v grep | awk '{print $2}' | xargs -i kill -9 {}
  • ทำการ Restart LISTENER
# lsnrctl reload LISTENER
  • ทำการ Connect Database ด้วย SQL*Plus
# sqlplus / as sysdba
  • ทำการ Start Database อีกครั้งหนึ่ง
SQL> startup

อ่านเพิ่มเติม : https://bit.ly/2ShlPwk


Leave a Reply

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