Oracle Enterprise Manager (OEM) 12c และ 13c มี performance analysis tools รวมถึง OEM Real-Time Automatic Database Diagnostic Monitor (Real-Time ADDM) สำหรับ Oracle DBA troubleshooting/tuning real-time performance issues บล็อกนี้แบ่งปันความรู้การใช้ Real-Time ADDM ระบุและรอดการฉุกเฉินจาก database health problems: 100% session/process utilization, เกิน critical limits ของ I/O, memory, interconnect Real-Time ADDM เป็นเครื่องมือ handy ทำ deeper real-time ADDM analysis
ADDM คืออะไร?
ADDM เป็น tool จาก Oracle Database (ตั้งแต่ 10g) วิเคราะห์ข้อมูลใน Automatic Workload Repository (AWR) ระบุ potential performance bottlenecks สำหรับแต่ละ issue หา root cause และแนะนำการแก้ไข
Real-Time ADDM คืออะไร?
ใน OEM Cloud Control 12c Oracle นำเสนอ Real-Time ADDM ช่วยวิเคราะห์และแก้ปัญหา unresponsive/hung databases ที่ปกติต้อง restart database Real-Time ADDM รันผ่าน predefined criteria วิเคราะห์ current database performance หาก criteria ไหน match ช่วยแก้ไข issues (deadlocks, hangs, shared pool contention, exception situations) โดยไม่ต้อง restart database
DBAs ใช้ Real-Time ADDM วิเคราะห์ database performance อัตโนมัติ เช่นกรณี login ไม่ได้เพราะ database hung/running slow เนื่องจาก performance issues Real-Time ADDM ระบุ source ของ SQL contention on global resources
Real-Time ADDM ทำ realistic database time analysis เหมือน ADDM เรียกใช้บน database ที่มี high database activity ตรวจจับ top performance issues ปัจจุบัน และหา major consumer ของ database time (SQL sessions, application connections, etc.)
ความแตกต่างระหว่าง ADDM และ Real-Time ADDM
ADDM เป็น database-level performance diagnosis tool Real-Time ADDM เป็น OEM 12c+ tool ต้องมี OEM ready พร้อม connection ไป database
ความแตกต่างหลัก: Real-Time ADDM ใช้ diagnostic-mode connection เข้าถึง Active Session History (ASH) data โดยตรงใน System Global Area (SGA) ของ database instance ข้าม normal-mode connection และไม่ใช้ global resources (latches, queues) หรือ excessive host resources
ทำไมต้องใช้ Real-Time ADDM?
- วิเคราะห์ current database performance เมื่อ hanging หรือ running slow
- หา sources ของ severe contention
- Database time analysis ตรวจจับ top performance issues
- Direct diagnostic connection ไป SGA
- หลีกเลี่ยง HANGANALYZE ของ ORADEBUG (basic trace utility) สำหรับอ่าน/วิเคราะห์ large trace files
HANGANALYZE คืออะไร?
HANGANALYZE เป็น option ใน ORADEBUG หาข้อมูล hung/blocking sessions ใช้ได้ connection เข้า hung database generate trace files อ่านหรือใช้ trace analysis tools ระบุ hung database issues
Troubleshooting with Real-Time ADDM Demonstration
สมมติ OEM 12c setup พร้อม connection ไป target database ใช้ขั้นตอนต่อไปนี้เมื่อ database instance hung:
- เปิด terminal พยายาม connect database session ยังไม่เริ่ม ไม่ login ได้เพราะ hung condition
- ใน OEM ภายใต้ Target menu เลือก
Databases for Troubleshootingค้นหา database name - Click database name รอ refresh จะเห็น error message
- ไปที่ Performance menu เลือก
Real-Time ADDMใช้ direct connection เพราะ instance hanging - ใช้ SYSDBA credentials สำหรับ Real-Time ADDM connection ใน hung situation
- หลัง diagnostic mode connection established อ่าน ASH data ใน memory จากชั่วโมงก่อน
- ดู top activity ที่ top of activity program
- Click START เริ่ม analysis Real-Time ADDM ดู past 10 minutes ASH samples Click STOP หยุดหลัง 10 นาที
- ดู findings ตาม priority ในแท็บ Findings ตัวอย่าง: unresolved session wait chains ก่อให้เกิด hang
- ดู recommendations ในรูปภาพ: แนะนำ kill particular session
- ไปแท็บ Hang Data ดูข้อมูล process ที่ต้อง kill: Session ID (SID), Serial #, OS Process ID
- หาก login database ไม่ได้ ต้อง kill OS Process ID เปิด terminal kill session
- หลังจากนั้น blocked session ดำเนินต่อได้ใน Real-Time ADDM ลอง connect SQL Plus ใหม่ connection สำเร็จ
สรุป
Real-Time ADDM จาก OEM Cloud Control 12c เป็นหนึ่งในเครื่องมือที่ดีที่สุดและเร็วที่สุดของ Oracle สำหรับ critical database health diagnosis กรณี hung database Real-Time ADDM เป็น definitive, effective support ของ DBA เปรียบเทียบกับ ADDM ที่ใช้จำกัด และ ORADEBUG HANGANALYZE trace utility ใช้ขั้นตอนก่อนหน้าเพื่อ overcome database/hung session issues