Lab 12 — Oracle AutoTask, Maintenance Windows & Scheduler (Read-only)
🧠 ภาพจำก่อนอ่าน: 🧪 Lab → 🗄️ Data → ⚙️ Process → 🩺 Health → 🧹 Cleanup
🎨 Visual Guide ของวิชานี้ — ภาพช่วยจำ ไม่แทนคำสั่งและเนื้อหาจริง
Original companion practice, NOT EXECUTED. Never enable/disable AutoTask, open/close maintenance windows, tune resource plans or run privileged advisor packages in this exercise.
Prerequisites
หัวข้อที่มีชื่อว่า “Prerequisites”Authorized lab SQL account with narrowly scoped read permissions to Scheduler/AutoTask dictionary views, and known Oracle version/PDB. Verify licensing before invoking any Diagnostics or Tuning Pack features. SELECTing metadata is not equivalent to running licensed SQL Tuning Advisor.
Task 1 — Identify scope and clients
หัวข้อที่มีชื่อว่า “Task 1 — Identify scope and clients”SHOW USERSHOW CON_NAMESELECT client_name,status FROM dba_autotask_client ORDER BY client_name;Which tasks are enabled? Why doesn’t enabled guarantee success?
Task 2 — Inspect scheduled windows
หัวข้อที่มีชื่อว่า “Task 2 — Inspect scheduled windows”SELECT window_name,enabled,repeat_interval,duration,resource_planFROM dba_scheduler_windows ORDER BY window_name;SELECT window_group_name,window_nameFROM dba_scheduler_wingroup_membersWHERE window_group_name='MAINTENANCE_WINDOW_GROUP'ORDER BY window_name;Record timezone, calendar expression, effective timing and expected workload peaks; report whether members are actually enabled.
Task 3 — Confirm historic job outcomes
หัวข้อที่มีชื่อว่า “Task 3 — Confirm historic job outcomes”SELECT client_name,window_name,job_status,job_start_time,job_duration,job_errorFROM dba_autotask_job_historyORDER BY job_start_time DESC FETCH FIRST 20 ROWS ONLY;Expected: completed jobs with statuses, not guaranteed success. In some configurations history may be empty for authorized user. Separate actual job completion from client enabled state.
Task 4 — Analyze nightly CPU spike
หัวข้อที่มีชื่อว่า “Task 4 — Analyze nightly CPU spike”Incident: users report slow queries 22:00–23:00. DBA observes a predefined maintenance window starting at 22:00.
- Capture application latency, SQL_IDs if available, instance CPU, wait events and timestamps.
- Correlate maintenance job history with the same time range; coincidence does not prove cause.
- Examine optimizer stats changes and plan regression in permitted tooling.
- Check Resource Manager allocations and job durations.
- Propose a controlled alternative window instead of immediately disabling auto stats.
- Define rollback, validation and owner approvals.
Exit criteria
หัวข้อที่มีชื่อว่า “Exit criteria”- Correctly explain window/group/client/job distinctions
- Read-only SQL output interpreted with privilege/version context
- Licensing implications recognized
- Incident timeline and change proposal drafted
- No Scheduler/AutoTask mutations executed
- Lab execution status explicitly NOT RUN
Cleanup: none beyond disconnect.
Official docs: https://docs.oracle.com/en/database/oracle/oracle-database/26/admin/managing-automated-database-maintenance-tasks.html
🧪 V2 Automated Maintenance & Pack Access Drill (DOC_REVIEWED, NOT_EXECUTED)
หัวข้อที่มีชื่อว่า “🧪 V2 Automated Maintenance & Pack Access Drill (DOC_REVIEWED, NOT_EXECUTED)”แยก Window Schedule, Enabled Client, Actual Job Outcome — สามข้อมูลนี้ไม่เท่ากัน
SHOW CON_NAMESELECT name,value FROM v$parameterWHERE name='control_management_pack_access';SELECT client_name,statusFROM dba_autotask_client ORDER BY client_name;SELECT client_name,job_start_time,job_status,job_durationFROM dba_autotask_job_historyORDER BY job_start_time DESC FETCH FIRST 10 ROWS ONLY;Worksheet:
- Status ของ Client เป็น Enabled แต่ไม่มี Job History: ควรตรวจ Maintenance Group, Window Repeat, Privilege/Errors และ Timestamp อะไรก่อน?
- SQL ช้าหลัง Stats Collection: จะยืนยัน Plan/Stats Timeline โดยไม่สรุปจาก Correlation อย่างไร?
CONTROL_MANAGEMENT_PACK_ACCESS=DIAGNOSTIC+TUNINGเป็นหลักฐานว่าซื้อ License แล้วหรือไม่? ไม่ใช่- มีสิทธิ์ใช้ Diagnostics/Tuning Packs จริงหรือไม่ ต้องตรวจ Contract/Edition/Deployment ก่อนใช้ AWR/ADDM/SQL Tuning Advisor — ห้ามทำใน Lab นี้
Official: 19c Maintenance Tasks · 19c Licensing.
Status: DOC_REVIEWED / LIVE_NOT_EXECUTED.
🧪 Sandbox Execution & Evidence (Optional)
หัวข้อที่มีชื่อว่า “🧪 Sandbox Execution & Evidence (Optional)”▶️ Runbook + Approved Read-only SQL Scripts · 📝 Expected vs Actual Evidence Template
Status: NOT_EXECUTED. เมื่อมี Isolated Sandbox ที่ได้รับอนุญาต ให้เลือก Script ที่ตรงหัวข้อ, บันทึก Oracle Version/RU, Container/Privileges และ Expected vs Actual ลง Private Evidence. อย่าอ้างว่า GitHub Actions PASS เท่ากับรัน Lab จริง และห้าม Commit Raw Database Output ลง Public Repository.