Oracle DBA - Enterprise Manager (OEM) / Tooling
OEM (Cloud Control) target/agent/blackout/template management and repository
administration via emcli/emctl (host-boundary tools), read-only repository
reporting via SQLcl dba_ai_conn, and the plan-only Tier-3 OEM/Cloud
Control upgrade + repository DR runbooks. Targets EM Cloud Control 13.5 (on a
19c repository) and EM 24ai (on a 23ai repository), EE, single-instance
and Data Guard, on-prem. Everything self-executing is T1 (observe) or T2
(reversible, dry-run-default). The OEM upgrade, repository DB upgrade,
OMS/repository DR, and destructive repository administration are T3 and
live only in references/runbooks.md — they print commands for a human and never
self-execute.
Routing. emcli/emctl are HOST-boundary tools and are not reachable
through the SQLcl MCP server (restrict level 4 = no host commands). They run as
generated .sh/.ps1 scripts (candidates to later front a guarded
oracle-dba-ops MCP). In-DB reads/maintenance (repository health, SYSMAN stats,
scheduler-job pause/resume) run through SQLcl MCP run-sql on dba_ai_conn
(sql/*.sql + supported SYSMAN package calls). T3 -> runbook + approval token.
Scope & risk map
| Task |
Level |
Tier |
Mechanism (script / sql / runbook path) |
Idempotent? |
| OEM target management — list |
L2 |
T1 |
scripts/manage_targets.sh list / .ps1 list |
yes — read-only (emcli get_targets) |
| OEM target management — add |
L2 |
T2 |
scripts/manage_targets.sh add / .ps1 add |
yes — noop if target already managed (get_targets probe) |
| OEM target management — relocate |
L2 |
T2 |
scripts/manage_targets.sh relocate / .ps1 relocate |
yes — reversible (relocate back); postcheck target still managed |
| OEM target management — remove |
L2 |
T2 |
scripts/manage_targets.sh remove / .ps1 remove |
yes — noop if not managed; reversible (re-add) |
| OEM agent management — sync/resync |
L2 |
T2 |
scripts/manage_targets.sh sync / .ps1 sync |
yes — resyncAgent is repeatable/reversible |
| OEM blackout — list |
L2 |
T1 |
scripts/manage_blackout.sh list / .ps1 list |
yes — read-only (get_blackouts) |
| OEM blackout — create |
L2 |
T2 |
scripts/manage_blackout.sh create / .ps1 create |
yes — noop if a blackout of that name is already active; reversible (stop) |
| OEM blackout — stop |
L2 |
T2 |
scripts/manage_blackout.sh stop / .ps1 stop |
yes — noop if not active; reversible (re-create) |
| OEM monitoring template — list |
L2 |
T1 |
scripts/manage_template.sh list / .ps1 list |
yes — read-only (list_templates) |
| OEM monitoring template — export |
L2 |
T2 |
scripts/manage_template.sh export / .ps1 export |
yes — read-only on repo; writes/overwrites a local XML; postcheck file exists |
| OEM monitoring template — create/import |
L2 |
T2 |
scripts/manage_template.sh create / .ps1 create |
yes — noop if template name exists; reversible (delete) |
| OEM monitoring template — apply |
L2 |
T2 |
scripts/manage_template.sh apply / .ps1 apply |
yes — re-appliable; reversible (apply baseline); precheck template exists |
| OEM monitoring template — delete |
L2 |
T2 |
scripts/manage_template.sh delete / .ps1 delete |
yes — noop if absent; reversible (re-create from exported XML) |
| OEM repository administration — status |
L2 |
T1 |
scripts/repository_admin.sh status / .ps1 status + sql/repository_health.sql |
yes — read-only (emctl status oms + repo-health probe) |
| OEM repository administration — gather SYSMAN stats |
L2 |
T2 |
scripts/repository_admin.sh gather-stats / .ps1 gather-stats |
yes — re-runnable; reversible (DBMS_STATS.RESTORE_SCHEMA_STATS) |
| OEM repository administration — pause collection |
L2 |
T2 |
scripts/repository_admin.sh pause / .ps1 pause |
yes — noop if no enabled SYSMAN jobs; reversible (resume) |
| OEM repository administration — resume collection |
L2 |
T2 |
scripts/repository_admin.sh resume / .ps1 resume |
yes — noop if none disabled |
| OEM repository inventory report |
L2 |
T1 |
sql/repository_dictionary.sql (via dba_ai_conn) |
yes — read-only (SYSMAN MGMT$ views) |
| OEM / Cloud Control upgrade (OMS + repository schema) |
L3 |
T3 |
references/runbooks.md#oem-upgrade |
no — rewrites SYSMAN schema; rollback = restore from backup |
| Repository DB upgrade prerequisite (19c->23ai under EM) |
L3 |
T3 |
references/runbooks.md#repo-db-upgrade |
no — DB upgrade; delegated to patching-and-upgrades |
| OMS / repository disaster recovery (rebuild / restore) |
recovery |
T3 |
references/runbooks.md#oem-dr |
no — restore from backup; failed-upgrade recovery |
| Destructive repository admin (DROP SYSMAN, AQ reset, purge redesign, repo move) |
L3 |
T3 |
references/runbooks.md#repo-destructive |
n/a — refused by repository_admin |
Preconditions
- SQLcl MCP connection
dba_ai_conn is reachable and wallet-backed. All in-DB
repository reads (sql/repository_health.sql, sql/repository_dictionary.sql),
the repository_admin status probe, the SYSMAN optimizer-stats gather, and the
scheduler-job pause/resume run through it via connect_db / Connect-Db. Never
SYS/SYSTEM — except inside a T3 runbook that explicitly states AS SYSDBA,
supplied interactively by the operator (e.g. repository restore, RepManager).
- emcli / emctl are HOST-boundary tools with a pre-established, wallet-backed
session. Run
emcli login (wallet) out of band before the wrappers; on the
OMS host for emctl. The scripts NEVER accept a password on argv/env and
refuse any plaintext-credential pattern (user/pass@db, password=, identified by) with ERR_SECRET (8). Override binaries only with paths: ODB_EMCLI_BIN,
ODB_EMCTL_BIN.
- Secrets resolve from the Oracle Wallet / external password store. No plaintext
anywhere — not in argv, env, files, or the runbooks. SYSMAN/SYS passwords for
T3 installer/
RepManager steps are entered interactively at the prompt.
- Helpers are sourced from
_common (scripts/lib.sh / lib.ps1): connect_db,
log_event, emit_metric, require_dry_run, guard_blocked_dry_run,
require_approval_token, precheck, postcheck, print_banner. Not reinvented.
- Logging: structured
key=value lines to the canonical paths
/var/log/oracle-dba/oem/oem.log (Linux) /
C:/ProgramData/oracle-dba/logs/oem/oem.log (Windows); skill segment oem.
- T2 dry-run default: every T2 script previews and changes nothing unless given
--execute. The repository is the SYSMAN schema inside an ordinary Oracle DB; the
read-only SQL degrades gracefully (prints a NOTE) when SYSMAN is not visible.
Procedures
Scripts ship as behaviour-equivalent .sh (Linux) / .ps1 (Windows) pairs. T2
scripts default to --dry-run; pass --execute to act. See each script's header / usage.
OEM target & agent management
- Trigger: onboard/offboard a target, move monitoring to another agent, or
resync an agent after config drift.
- Precheck: active emcli session (
emcli sync); idempotency probe via
get_targets.
- Action:
scripts/manage_targets.sh {list|add|sync|relocate|remove} … --execute
/ .ps1 {list|add|sync|relocate|remove}. list is T1 (immediate, read-only).
- Postcheck: target/agent now (or no longer) appears in
get_targets.
- Rollback note: add<->remove and relocate-back are the reversals; sync is
repeatable. Removing a target only stops monitoring it — it does not touch the DB.
OEM blackout management
- Trigger: suppress monitoring/notifications during planned maintenance; end a
blackout early when work finishes.
- Precheck: active emcli session;
get_blackouts state probe.
- Action:
scripts/manage_blackout.sh {list|create|stop} … --execute / .ps1.
--indefinite or --duration HH:MM controls the window; list is T1.
- Postcheck: blackout exists/started after create; not active after stop.
- Rollback note: blackouts are inherently reversible —
create <-> stop.
OEM monitoring template management
- Trigger: standardise metrics/thresholds across like targets; export a golden
template; apply it to new targets; retire an old one.
- Precheck: active emcli session;
list_templates existence probe; create
requires the XML file to exist and be non-empty.
- Action:
scripts/manage_template.sh {list|export|create|apply|delete} … --execute
/ .ps1. --copy on apply replaces target settings (override); default merges.
- Postcheck: template present after create; file written after export; still
present after apply; absent after delete.
- Rollback note: delete<->create (from the exported XML); revert an apply by
applying a baseline/previous template to the same targets.
OEM repository administration
- Trigger: check OMS + repository health; freshen SYSMAN optimizer stats (slow
console / loader backlog); pause repository collection jobs for DB maintenance and
resume after.
- Precheck:
status is read-only (no precheck); gather-stats/pause/resume
require SYSMAN visible via dba_ai_conn.
- Action:
scripts/repository_admin.sh {status|gather-stats|pause|resume} --execute
/ .ps1. status is T1 and runs emctl status oms -details + repository_health.sql.
- Postcheck: fresh SYSMAN stats (<1d) after gather; all SYSMAN jobs disabled
after pause / none disabled after resume.
- Rollback note: stats restorable via
DBMS_STATS.RESTORE_SCHEMA_STATS;
pause<->resume. DESTRUCTIVE repository ops are refused and routed to
references/runbooks.md#repo-destructive.
Repository read-only reporting (T1)
- Trigger: inventory the managed estate (targets, agents, blackouts, templates)
or report repository health/headroom; underpins emcli idempotency probes.
- Action: via
dba_ai_conn: @sql/repository_dictionary.sql (inventory) and
@sql/repository_health.sql (OMS-repo DB health + SYSMAN internals).
- Postcheck: n/a — emits
KEYVAL lines (machine-parseable). Read-only.
- Rollback note: none — read-only; degrades gracefully without SYSMAN visibility.
Tier-3 runbooks
The OEM / Cloud Control upgrade and the destructive repository operations are
Tier 3 and live in references/runbooks.md: #oem-upgrade (OMS + repository
schema upgrade, e.g. 13.5 -> 24ai), #repo-db-upgrade (repository database upgrade,
e.g. 19c -> 23ai, delegated to patching-and-upgrades), #oem-dr (OMS/repository
disaster recovery / failed-upgrade restore), and #repo-destructive (DROP SYSMAN,
AQ/loader reset, purge-policy redesign, repository re-create/move).
These runbooks PRINT exact emcli/emctl/installer/SQL commands for a human operator
and NEVER self-execute. They are gated by require_approval_token /
Require-ApprovalToken: an automated agent's only sanctioned action is to print the
relevant section and stop with ERR_APPROVAL (6) until a human supplies a real
change ticket/token (--token <TICKET> or ODB_APPROVAL_TOKEN; placeholders are
rejected). The T2 repository_admin script deliberately refuses the destructive
escape hatches (schema drop, AQ reset, purge redesign) and points to the runbook
instead. SYSDBA / SYSMAN passwords are a T3-only, interactively-supplied exception.
When in doubt, runbook.
See references/version-notes.md for EM 13.5-vs-24ai and 19c-vs-23ai repository deltas.
Schedulable T1/T2 jobs are in cron/crontab.d (Linux) and cron/task-scheduler.xml
(Windows).
1---2name: oracle-dba-enterprise-manager-oem-tooling3description: USE THIS SKILL WHENEVER the user mentions Oracle Enterprise Manager (OEM), Cloud Control, EM 13.5 / EM 24ai, the OMS (Oracle Management Service), the Management Repository / SYSMAN schema, emcli or emctl, a management agent, OEM targets, blackouts, monitoring templates, metric/threshold templates, OEM repository administration, or an OEM / Cloud Control upgrade — EVEN IF they do not name the specific task. Covers OEM target/agent management (add/sync/relocate/remove), blackout management (create/stop), monitoring template management (export/create/apply/delete), repository administration (status, SYSMAN stats gather, pause/resume repository collection jobs), and the plan-only Tier-3 OEM/Cloud Control upgrade + repository DR + destructive-repo runbooks. Follows the oracle-dba-common contracts: SQLcl MCP saved connection dba_ai_conn, Oracle Wallet secrets (never plaintext), --dry-run defaults on T2, and tier gating (max self-execute = T2; the OEM upgrade and destructive repository ops are T3).4---5# Oracle DBA - Enterprise Manager (OEM) / Tooling67OEM (Cloud Control) target/agent/blackout/template management and repository8administration via **emcli/emctl** (host-boundary tools), read-only repository9reporting via **SQLcl `dba_ai_conn`**, and the plan-only **Tier-3** OEM/Cloud10Control upgrade + repository DR runbooks. Targets EM **Cloud Control 13.5** (on a11**19c** repository) and **EM 24ai** (on a **23ai** repository), EE, single-instance12and Data Guard, on-prem. Everything self-executing is **T1 (observe)** or **T213(reversible, dry-run-default)**. The **OEM upgrade**, **repository DB upgrade**,14**OMS/repository DR**, and **destructive repository administration** are **T3** and15live only in `references/runbooks.md` — they print commands for a human and never16self-execute.1718> **Routing.** `emcli`/`emctl` are HOST-boundary tools and are **not** reachable19> through the SQLcl MCP server (restrict level 4 = no host commands). They run as20> generated `.sh`/`.ps1` scripts (candidates to later front a guarded21> `oracle-dba-ops` MCP). In-DB reads/maintenance (repository health, SYSMAN stats,22> scheduler-job pause/resume) run through SQLcl MCP `run-sql` on **`dba_ai_conn`**23> (`sql/*.sql` + supported SYSMAN package calls). T3 -> runbook + approval token.2425## Scope & risk map2627| Task | Level | Tier | Mechanism (script / sql / runbook path) | Idempotent? |28|------|-------|------|------------------------------------------|-------------|29| OEM target management — list | L2 | T1 | `scripts/manage_targets.sh list` / `.ps1 list` | yes — read-only (emcli `get_targets`) |30| OEM target management — add | L2 | T2 | `scripts/manage_targets.sh add` / `.ps1 add` | yes — noop if target already managed (`get_targets` probe) |31| OEM target management — relocate | L2 | T2 | `scripts/manage_targets.sh relocate` / `.ps1 relocate` | yes — reversible (relocate back); postcheck target still managed |32| OEM target management — remove | L2 | T2 | `scripts/manage_targets.sh remove` / `.ps1 remove` | yes — noop if not managed; reversible (re-add) |33| OEM agent management — sync/resync | L2 | T2 | `scripts/manage_targets.sh sync` / `.ps1 sync` | yes — `resyncAgent` is repeatable/reversible |34| OEM blackout — list | L2 | T1 | `scripts/manage_blackout.sh list` / `.ps1 list` | yes — read-only (`get_blackouts`) |35| OEM blackout — create | L2 | T2 | `scripts/manage_blackout.sh create` / `.ps1 create` | yes — noop if a blackout of that name is already active; reversible (stop) |36| OEM blackout — stop | L2 | T2 | `scripts/manage_blackout.sh stop` / `.ps1 stop` | yes — noop if not active; reversible (re-create) |37| OEM monitoring template — list | L2 | T1 | `scripts/manage_template.sh list` / `.ps1 list` | yes — read-only (`list_templates`) |38| OEM monitoring template — export | L2 | T2 | `scripts/manage_template.sh export` / `.ps1 export` | yes — read-only on repo; writes/overwrites a local XML; postcheck file exists |39| OEM monitoring template — create/import | L2 | T2 | `scripts/manage_template.sh create` / `.ps1 create` | yes — noop if template name exists; reversible (delete) |40| OEM monitoring template — apply | L2 | T2 | `scripts/manage_template.sh apply` / `.ps1 apply` | yes — re-appliable; reversible (apply baseline); precheck template exists |41| OEM monitoring template — delete | L2 | T2 | `scripts/manage_template.sh delete` / `.ps1 delete` | yes — noop if absent; reversible (re-create from exported XML) |42| OEM repository administration — status | L2 | T1 | `scripts/repository_admin.sh status` / `.ps1 status` + `sql/repository_health.sql` | yes — read-only (`emctl status oms` + repo-health probe) |43| OEM repository administration — gather SYSMAN stats | L2 | T2 | `scripts/repository_admin.sh gather-stats` / `.ps1 gather-stats` | yes — re-runnable; reversible (`DBMS_STATS.RESTORE_SCHEMA_STATS`) |44| OEM repository administration — pause collection | L2 | T2 | `scripts/repository_admin.sh pause` / `.ps1 pause` | yes — noop if no enabled SYSMAN jobs; reversible (resume) |45| OEM repository administration — resume collection | L2 | T2 | `scripts/repository_admin.sh resume` / `.ps1 resume` | yes — noop if none disabled |46| OEM repository inventory report | L2 | T1 | `sql/repository_dictionary.sql` (via `dba_ai_conn`) | yes — read-only (SYSMAN MGMT$ views) |47| OEM / Cloud Control upgrade (OMS + repository schema) | L3 | **T3** | `references/runbooks.md#oem-upgrade` | no — rewrites SYSMAN schema; rollback = restore from backup |48| Repository DB upgrade prerequisite (19c->23ai under EM) | L3 | **T3** | `references/runbooks.md#repo-db-upgrade` | no — DB upgrade; delegated to patching-and-upgrades |49| OMS / repository disaster recovery (rebuild / restore) | recovery | **T3** | `references/runbooks.md#oem-dr` | no — restore from backup; failed-upgrade recovery |50| Destructive repository admin (DROP SYSMAN, AQ reset, purge redesign, repo move) | L3 | **T3** | `references/runbooks.md#repo-destructive` | n/a — refused by `repository_admin` |5152## Preconditions5354- **SQLcl MCP connection `dba_ai_conn`** is reachable and wallet-backed. All in-DB55 repository reads (`sql/repository_health.sql`, `sql/repository_dictionary.sql`),56 the `repository_admin` status probe, the SYSMAN optimizer-stats gather, and the57 scheduler-job pause/resume run through it via `connect_db` / `Connect-Db`. Never58 SYS/SYSTEM — except inside a T3 runbook that explicitly states `AS SYSDBA`,59 supplied interactively by the operator (e.g. repository restore, `RepManager`).60- **emcli / emctl are HOST-boundary tools with a pre-established, wallet-backed61 session.** Run `emcli login` (wallet) **out of band** before the wrappers; on the62 **OMS host** for `emctl`. The scripts NEVER accept a password on argv/env and63 refuse any plaintext-credential pattern (`user/pass@db`, `password=`, `identified64 by`) with `ERR_SECRET` (8). Override binaries only with paths: `ODB_EMCLI_BIN`,65 `ODB_EMCTL_BIN`.66- **Secrets resolve from the Oracle Wallet / external password store. No plaintext67 anywhere** — not in argv, env, files, or the runbooks. SYSMAN/SYS passwords for68 T3 installer/`RepManager` steps are entered **interactively** at the prompt.69- **Helpers are sourced from `_common`** (`scripts/lib.sh` / `lib.ps1`): `connect_db`,70 `log_event`, `emit_metric`, `require_dry_run`, `guard_blocked_dry_run`,71 `require_approval_token`, `precheck`, `postcheck`, `print_banner`. Not reinvented.72- **Logging**: structured `key=value` lines to the canonical paths73 `/var/log/oracle-dba/oem/oem.log` (Linux) /74 `C:/ProgramData/oracle-dba/logs/oem/oem.log` (Windows); skill segment `oem`.75- **T2 dry-run default**: every T2 script previews and changes nothing unless given76 `--execute`. The repository is the SYSMAN schema inside an ordinary Oracle DB; the77 read-only SQL degrades gracefully (prints a NOTE) when SYSMAN is not visible.7879## Procedures8081Scripts ship as behaviour-equivalent `.sh` (Linux) / `.ps1` (Windows) pairs. T282scripts default to `--dry-run`; pass `--execute` to act. See each script's header / usage.8384### OEM target & agent management85- **Trigger**: onboard/offboard a target, move monitoring to another agent, or86 resync an agent after config drift.87- **Precheck**: active emcli session (`emcli sync`); idempotency probe via88 `get_targets`.89- **Action**: `scripts/manage_targets.sh {list|add|sync|relocate|remove} … --execute`90 / `.ps1 {list|add|sync|relocate|remove}`. `list` is T1 (immediate, read-only).91- **Postcheck**: target/agent now (or no longer) appears in `get_targets`.92- **Rollback note**: add<->remove and relocate-back are the reversals; sync is93 repeatable. Removing a target only stops monitoring it — it does not touch the DB.9495### OEM blackout management96- **Trigger**: suppress monitoring/notifications during planned maintenance; end a97 blackout early when work finishes.98- **Precheck**: active emcli session; `get_blackouts` state probe.99- **Action**: `scripts/manage_blackout.sh {list|create|stop} … --execute` / `.ps1`.100 `--indefinite` or `--duration HH:MM` controls the window; `list` is T1.101- **Postcheck**: blackout exists/started after create; not active after stop.102- **Rollback note**: blackouts are inherently reversible — `create` <-> `stop`.103104### OEM monitoring template management105- **Trigger**: standardise metrics/thresholds across like targets; export a golden106 template; apply it to new targets; retire an old one.107- **Precheck**: active emcli session; `list_templates` existence probe; create108 requires the XML file to exist and be non-empty.109- **Action**: `scripts/manage_template.sh {list|export|create|apply|delete} … --execute`110 / `.ps1`. `--copy` on apply replaces target settings (override); default merges.111- **Postcheck**: template present after create; file written after export; still112 present after apply; absent after delete.113- **Rollback note**: delete<->create (from the exported XML); revert an apply by114 applying a baseline/previous template to the same targets.115116### OEM repository administration117- **Trigger**: check OMS + repository health; freshen SYSMAN optimizer stats (slow118 console / loader backlog); pause repository collection jobs for DB maintenance and119 resume after.120- **Precheck**: `status` is read-only (no precheck); `gather-stats`/`pause`/`resume`121 require SYSMAN visible via `dba_ai_conn`.122- **Action**: `scripts/repository_admin.sh {status|gather-stats|pause|resume} --execute`123 / `.ps1`. `status` is T1 and runs `emctl status oms -details` + `repository_health.sql`.124- **Postcheck**: fresh SYSMAN stats (<1d) after gather; all SYSMAN jobs disabled125 after pause / none disabled after resume.126- **Rollback note**: stats restorable via `DBMS_STATS.RESTORE_SCHEMA_STATS`;127 pause<->resume. DESTRUCTIVE repository ops are refused and routed to128 `references/runbooks.md#repo-destructive`.129130### Repository read-only reporting (T1)131- **Trigger**: inventory the managed estate (targets, agents, blackouts, templates)132 or report repository health/headroom; underpins emcli idempotency probes.133- **Action**: via `dba_ai_conn`: `@sql/repository_dictionary.sql` (inventory) and134 `@sql/repository_health.sql` (OMS-repo DB health + SYSMAN internals).135- **Postcheck**: n/a — emits `KEYVAL` lines (machine-parseable). Read-only.136- **Rollback note**: none — read-only; degrades gracefully without SYSMAN visibility.137138## Tier-3 runbooks139140The **OEM / Cloud Control upgrade** and the destructive repository operations are141Tier 3 and live in **`references/runbooks.md`**: `#oem-upgrade` (OMS + repository142schema upgrade, e.g. 13.5 -> 24ai), `#repo-db-upgrade` (repository database upgrade,143e.g. 19c -> 23ai, delegated to `patching-and-upgrades`), `#oem-dr` (OMS/repository144disaster recovery / failed-upgrade restore), and `#repo-destructive` (DROP SYSMAN,145AQ/loader reset, purge-policy redesign, repository re-create/move).146147These runbooks **PRINT exact emcli/emctl/installer/SQL commands for a human operator148and NEVER self-execute.** They are gated by `require_approval_token` /149`Require-ApprovalToken`: an automated agent's only sanctioned action is to print the150relevant section and stop with `ERR_APPROVAL` (6) until a human supplies a real151change ticket/token (`--token <TICKET>` or `ODB_APPROVAL_TOKEN`; placeholders are152rejected). The T2 `repository_admin` script deliberately refuses the destructive153escape hatches (schema drop, AQ reset, purge redesign) and points to the runbook154instead. SYSDBA / SYSMAN passwords are a T3-only, interactively-supplied exception.155When in doubt, runbook.156157See `references/version-notes.md` for EM 13.5-vs-24ai and 19c-vs-23ai repository deltas.158Schedulable T1/T2 jobs are in `cron/crontab.d` (Linux) and `cron/task-scheduler.xml`159(Windows).