AgentSkillsCN

oracle-impact-analyzer

在修改表、列或存储过程之前,先分析Oracle数据库的变更影响。当开发者询问依赖关系、可能引发的破坏,或需要变更影响报告时使用此功能。

SKILL.md
--- frontmatter
name: oracle-impact-analyzer
description: Analyze Oracle database change impacts before modifying tables, columns, or procedures. Use when developers ask about dependencies, what might break, or need impact reports.

Oracle Impact Analyzer

Use this skill when developers ask about database change impacts, dependencies, or what might break when modifying Oracle database objects.

When to Use This Skill

Activate this skill when the user asks questions like:

  • "What depends on [TABLE]?"
  • "What breaks if I change/rename/drop [COLUMN]?"
  • "Who calls [PROCEDURE/FUNCTION]?"
  • "Analyze impact of changing [TABLE/COLUMN]"
  • "Generate impact report for [TABLE]"
  • "What objects reference [TABLE]?"
  • "Show me the dependencies for [OBJECT]"

Prerequisites

The oracle-impact CLI must be installed and configured:

bash
pip install -e /path/to/OracleImpactAnalyzer
oracle-impact configure  # One-time setup

CLI Commands

Analyze Table Impact

Find all objects that depend on a table:

bash
oracle-impact analyze-table TABLE_NAME [--schema SCHEMA] [--format markdown|json|excel]

Example:

bash
oracle-impact analyze-table EMPLOYEES
oracle-impact analyze-table EMPLOYEES --schema HR --format json

Analyze Column Change

Understand what breaks if a column is modified:

bash
oracle-impact analyze-column TABLE_NAME COLUMN_NAME --change-type [add|modify|rename|drop]

Examples:

bash
# What breaks if we rename this column?
oracle-impact analyze-column EMPLOYEES PHONE --change-type rename

# Impact of dropping a column
oracle-impact analyze-column ORDERS ORDER_DATE --change-type drop

# Adding a new column (usually low impact)
oracle-impact analyze-column CUSTOMERS EMAIL --change-type add

Find Procedure/Function Callers

See what objects call a procedure or function:

bash
oracle-impact analyze-procedure PROCEDURE_NAME [--type PROCEDURE|FUNCTION|PACKAGE]

Examples:

bash
oracle-impact analyze-procedure CALCULATE_BONUS
oracle-impact analyze-procedure GET_EMPLOYEE_DETAILS --type FUNCTION
oracle-impact analyze-procedure PKG_PAYROLL --type PACKAGE

Generate Reports

Export comprehensive impact analysis to files:

bash
oracle-impact report TABLE_NAME --format [markdown|excel|json] --output ./reports/

Examples:

bash
# Excel report for stakeholders
oracle-impact report EMPLOYEES --format excel --output ./reports/

# Markdown for documentation
oracle-impact report ORDERS --format markdown --output ./docs/

Test Connection

Verify database connectivity:

bash
oracle-impact test-connection

Risk Levels

The analyzer categorizes impacts by risk:

LevelScoreDescription
CRITICAL80-100Breaking changes to core business objects
HIGH50-79Multiple dependent objects affected
MEDIUM20-49Limited, manageable impact
LOW1-19Minimal dependencies
NONE0No dependencies found

Output Interpretation

Table Analysis Output

When analyzing a table, you'll see:

  • Dependencies: Objects that directly depend on the table (procedures, functions, packages)
  • Triggers: Database triggers on the table
  • Foreign Keys: Other tables referencing this table
  • Views: Views that query this table
  • Synonyms: Aliases pointing to this table
  • Risk Assessment: Overall risk score and recommendations

Column Analysis Output

When analyzing a column change, you'll see:

  • Source References: Where the column is used in PL/SQL code
  • Constraints: Check, unique, or foreign key constraints on the column
  • Indexes: Indexes that include the column
  • Risk Assessment: Based on change type and dependencies

Example Workflows

Workflow 1: Before Modifying a Table

User: "What depends on the EMPLOYEES table?"

Run:

bash
oracle-impact analyze-table EMPLOYEES

Workflow 2: Before Renaming a Column

User: "What breaks if I rename EMPLOYEES.PHONE to PHONE_NUMBER?"

Run:

bash
oracle-impact analyze-column EMPLOYEES PHONE --change-type rename

Workflow 3: Before Changing a Stored Procedure

User: "What calls the CALCULATE_BONUS procedure?"

Run:

bash
oracle-impact analyze-procedure CALCULATE_BONUS

Workflow 4: Generating Documentation

User: "Generate an impact report for the ORDERS table"

Run:

bash
oracle-impact report ORDERS --format excel --output ./reports/

Configuration

Environment variables (set in .env or shell):

code
ORACLE_HOST=your-db-host
ORACLE_PORT=1521
ORACLE_SERVICE_NAME=your-service
ORACLE_USERNAME=your-user

Password is stored securely in OS keyring after running oracle-impact configure.