ข้ามไปยังเนื้อหา

Lab 12 — Oracle AutoTask, Maintenance Windows & Scheduler (Read-only)

🧠 ภาพจำก่อนอ่าน: 🧪 Lab → 🗄️ Data → ⚙️ Process → 🩺 Health → 🧹 Cleanup
🎨 Visual Guide ของวิชานี้ — ภาพช่วยจำ ไม่แทนคำสั่งและเนื้อหาจริง

Lesson 27 · Lesson 28

Original companion practice, NOT EXECUTED. Never enable/disable AutoTask, open/close maintenance windows, tune resource plans or run privileged advisor packages in this exercise.

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.

SHOW USER
SHOW CON_NAME
SELECT client_name,status FROM dba_autotask_client ORDER BY client_name;

Which tasks are enabled? Why doesn’t enabled guarantee success?

SELECT window_name,enabled,repeat_interval,duration,resource_plan
FROM dba_scheduler_windows ORDER BY window_name;
SELECT window_group_name,window_name
FROM dba_scheduler_wingroup_members
WHERE 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.

SELECT client_name,window_name,job_status,job_start_time,job_duration,job_error
FROM dba_autotask_job_history
ORDER 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.

Incident: users report slow queries 22:00–23:00. DBA observes a predefined maintenance window starting at 22:00.

  1. Capture application latency, SQL_IDs if available, instance CPU, wait events and timestamps.
  2. Correlate maintenance job history with the same time range; coincidence does not prove cause.
  3. Examine optimizer stats changes and plan regression in permitted tooling.
  4. Check Resource Manager allocations and job durations.
  5. Propose a controlled alternative window instead of immediately disabling auto stats.
  6. Define rollback, validation and owner approvals.
  • 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

แยก Window Schedule, Enabled Client, Actual Job Outcome — สามข้อมูลนี้ไม่เท่ากัน

SHOW CON_NAME
SELECT name,value FROM v$parameter
WHERE name='control_management_pack_access';
SELECT client_name,status
FROM dba_autotask_client ORDER BY client_name;
SELECT client_name,job_start_time,job_status,job_duration
FROM dba_autotask_job_history
ORDER BY job_start_time DESC FETCH FIRST 10 ROWS ONLY;

Worksheet:

  1. Status ของ Client เป็น Enabled แต่ไม่มี Job History: ควรตรวจ Maintenance Group, Window Repeat, Privilege/Errors และ Timestamp อะไรก่อน?
  2. SQL ช้าหลัง Stats Collection: จะยืนยัน Plan/Stats Timeline โดยไม่สรุปจาก Correlation อย่างไร?
  3. CONTROL_MANAGEMENT_PACK_ACCESS=DIAGNOSTIC+TUNING เป็นหลักฐานว่าซื้อ License แล้วหรือไม่? ไม่ใช่
  4. มีสิทธิ์ใช้ Diagnostics/Tuning Packs จริงหรือไม่ ต้องตรวจ Contract/Edition/Deployment ก่อนใช้ AWR/ADDM/SQL Tuning Advisor — ห้ามทำใน Lab นี้

Official: 19c Maintenance Tasks · 19c Licensing.

Status: DOC_REVIEWED / LIVE_NOT_EXECUTED.

▶️ 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.