🍐Check Oracle Error in Alert Log with SQL*Plus

การตรวจสอบ Error ของ Database บน Oracle โดยปกติเราสามารถตรวจสอบ Error ที่พบได้จาก Automatic Diagnostic Repository ( ADR ) แต่จะไม่สะดวกในการเรียกดู Error ย้อนหลัง

Get Started

  • ทำการ Connect Database ด้วย SQL*Plus

sqlplus / as sysdba
  • ทำการ Find Error ย้อนหลัง 365 วัน

SQL>
set linesize 150 ;
SQL>
col record_id for 9999999 head ID ;
SQL>
col message_text for a120 head message ;
SQL>
select record_id, 
to_char(originating_timestamp,'DD-MON-YYYY HH24:MI:SS') "TIMESTAMP", message_text 
from X$DBGALERTEXT 
where originating_timestamp > systimestamp - 365 and regexp_like(message_text, '(ORA-|error)') order by record_id ;
   ID TIMESTAMP            message
-------- -------------------- -----------------------------
   32109 17-APR-2021 00:00:19 ORA-00060: Deadlock detected.

อ่านเพิ่มเติม : https://bit.ly/3pBYJRF

Last updated

Was this helpful?