# domdanrtsey/orawatch architecture

> Architecture diagram of the GitHub repository domdanrtsey/orawatch, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/domdanrtsey/orawatch
- Repository: https://github.com/domdanrtsey/orawatch

## Overview

#### Purpose and Entry Points

This repository is a standalone Oracle Database health-check utility. It is intended to run under the Oracle OS account against the instance selected by `ORACLE_SID`, using a supplied `system/password` login. The executable entry point is `orawatch.sh`; its generated example/report artifact is `192.168.35.244os_oracle_summary.html`.

#### Execution Model

The operator exports the target instance identifier, makes the shell script executable, and invokes it with Oracle SYSTEM credentials. The script is therefore coupled to the local Oracle client/runtime environment and the selected local database instance rather than being a network service.

- `orawatch.sh`
- `README.md`

#### Credential and Database Boundary

`orawatch.sh` accepts credentials from the command line or can use credentials embedded in the script. It connects as the Oracle `system` user to run inspection SQL. Credentials must correspond to the active `ORACLE_SID`; repeated invalid attempts can lock the SYSTEM account. Oracle authentication and SQL execution are the primary external-system boundary.

- `orawatch.sh`

#### Oracle Inspection Stages

The script collects database and host-facing operational information, including:

1. Host/IP identification for the report.
2. Oracle database version.
3. Archive-log mode, archive destination/path, and archive filesystem usage.
4. Database memory state, including memory/SGA/PGA information.
5. Tablespace autoextend configuration.
6. Allocated tablespace utilization.

These checks form the main monitoring pipeline implemented by the shell script.

- `orawatch.sh`
- `README.md`

#### Report Generation

Inspection results are formatted into an HTML summary written in the script’s working directory. The output name incorporates the host IP and follows the `*os_oracle_summary.html` convention. The checked-in HTML file demonstrates the expected report artifact and likely serves as a sample generated result rather than an application runtime dependency.

- `orawatch.sh`
- `192.168.35.244os_oracle_summary.html`

#### Runtime and Infrastructure Dependencies

The runtime is a Unix-like shell environment with Oracle installed/configured for the executing Oracle user. Required operational context includes `ORACLE_SID`, access to Oracle command-line SQL tooling, local archive-log filesystem visibility, and permission to write the HTML report. No application server, package manager, or persistent service infrastructure is represented.

- `orawatch.sh`

#### Extension Boundary

Additional inspection metrics are expected to be added by extending the SQL/shell collection and HTML rendering logic in `orawatch.sh`. New checks should preserve the existing sequence: obtain database/host state, convert results into report sections, and emit the consolidated HTML artifact.

- `orawatch.sh`

Main entry points: [`orawatch.sh`](https://github.com/domdanrtsey/orawatch/blob/master/orawatch.sh) (orawatch.sh), [`README.md`](https://github.com/domdanrtsey/orawatch/blob/master/README.md) (README usage guide), [`192.168.35.244os_oracle_summary.html`](https://github.com/domdanrtsey/orawatch/blob/master/192.168.35.244os_oracle_summary.html) (Example HTML report)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Local Runtime"]
  node_operator(("Oracle OS operator<br/>user"))
  node_oracle_env{{"Oracle local environment<br/>runtime"}}
  node_script["orawatch.sh<br/>shell entry point<br/>[orawatch.sh]"]
  node_credentials["SYSTEM credentials<br/>credential input<br/>[orawatch.sh]"]
  node_oracle_db[("Selected Oracle instance<br/>external database")]
  node_usage_guide["README usage guide<br/>documentation<br/>[README.md]"]
end

subgraph group_inspection["Inspection Pipeline"]
  node_host_identity["Host and IP discovery<br/>collection stage<br/>[orawatch.sh]"]
  node_db_version["Database version<br/>collection stage<br/>[orawatch.sh]"]
  node_archive_status["Archive-log status<br/>collection stage<br/>[orawatch.sh]"]
  node_memory_state["Memory state<br/>collection stage<br/>[orawatch.sh]"]
  node_autoextend["Tablespace autoextend<br/>collection stage<br/>[orawatch.sh]"]
  node_tablespace_usage["Tablespace utilization<br/>collection stage<br/>[orawatch.sh]"]
end

subgraph group_output["Report Output"]
  node_html_renderer["HTML report assembly<br/>rendering stage<br/>[orawatch.sh]"]
  node_html_report["IP-based HTML summary<br/>generated artifact"]
  node_sample_report["Example HTML report<br/>checked-in artifact"]
end

node_operator -->|"prepares"| node_oracle_env
node_operator -->|"invokes"| node_script
node_usage_guide -.->|"documents"| node_operator
node_oracle_env -->|"provides runtime"| node_script
node_credentials -->|"authenticates"| node_script
node_script -->|"runs inspection SQL"| node_oracle_db
node_script -->|"collects"| node_host_identity
node_script -->|"collects"| node_db_version
node_script -->|"collects"| node_archive_status
node_script -->|"collects"| node_memory_state
node_script -->|"collects"| node_autoextend
node_script -->|"collects"| node_tablespace_usage
node_oracle_db -->|"returns state"| node_db_version
node_oracle_db -->|"returns state"| node_archive_status
node_oracle_db -->|"returns state"| node_memory_state
node_oracle_db -->|"returns state"| node_autoextend
node_oracle_db -->|"returns state"| node_tablespace_usage
node_host_identity -->|"report section"| node_html_renderer
node_db_version -->|"report section"| node_html_renderer
node_archive_status -->|"report section"| node_html_renderer
node_memory_state -->|"report section"| node_html_renderer
node_autoextend -->|"report section"| node_html_renderer
node_tablespace_usage -->|"report section"| node_html_renderer
node_html_renderer -->|"writes"| node_html_report
node_sample_report -.->|"illustrates format"| node_html_report

click node_script "https://github.com/domdanrtsey/orawatch/blob/master/orawatch.sh"
click node_credentials "https://github.com/domdanrtsey/orawatch/blob/master/orawatch.sh"
click node_host_identity "https://github.com/domdanrtsey/orawatch/blob/master/orawatch.sh"
click node_db_version "https://github.com/domdanrtsey/orawatch/blob/master/orawatch.sh"
click node_archive_status "https://github.com/domdanrtsey/orawatch/blob/master/orawatch.sh"
click node_memory_state "https://github.com/domdanrtsey/orawatch/blob/master/orawatch.sh"
click node_autoextend "https://github.com/domdanrtsey/orawatch/blob/master/orawatch.sh"
click node_tablespace_usage "https://github.com/domdanrtsey/orawatch/blob/master/orawatch.sh"
click node_html_renderer "https://github.com/domdanrtsey/orawatch/blob/master/orawatch.sh"
click node_sample_report "https://github.com/domdanrtsey/orawatch/blob/master/192.168.35.244os_oracle_summary.html"
click node_usage_guide "https://github.com/domdanrtsey/orawatch/blob/master/README.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_operator,node_oracle_env,node_script,node_credentials,node_oracle_db,node_usage_guide toneBlue
class node_host_identity,node_db_version,node_archive_status,node_memory_state,node_autoextend,node_tablespace_usage toneAmber
class node_html_renderer,node_html_report,node_sample_report toneMint
```

## Components

### Local Runtime

- **Oracle OS operator**: user · Exports the target SID and invokes the utility.
- **Oracle local environment**: runtime · Provides ORACLE_SID, Oracle client tooling, and filesystem access.
- [orawatch.sh](https://github.com/domdanrtsey/orawatch/blob/master/orawatch.sh): shell entry point · Collects health data and emits the HTML summary. · `orawatch.sh`
- [SYSTEM credentials](https://github.com/domdanrtsey/orawatch/blob/master/orawatch.sh): credential input · Supplied on the command line or embedded in the script. · `orawatch.sh`
- **Selected Oracle instance**: external database · The local instance selected by ORACLE_SID.
- [README usage guide](https://github.com/domdanrtsey/orawatch/blob/master/README.md): documentation · Documents invocation and runtime prerequisites. · `README.md`

### Inspection Pipeline

- [Host and IP discovery](https://github.com/domdanrtsey/orawatch/blob/master/orawatch.sh): collection stage · `orawatch.sh`
- [Database version](https://github.com/domdanrtsey/orawatch/blob/master/orawatch.sh): collection stage · `orawatch.sh`
- [Archive-log status](https://github.com/domdanrtsey/orawatch/blob/master/orawatch.sh): collection stage · Collects log mode, destination, and archive filesystem usage. · `orawatch.sh`
- [Memory state](https://github.com/domdanrtsey/orawatch/blob/master/orawatch.sh): collection stage · Collects memory, SGA, and PGA information. · `orawatch.sh`
- [Tablespace autoextend](https://github.com/domdanrtsey/orawatch/blob/master/orawatch.sh): collection stage · `orawatch.sh`
- [Tablespace utilization](https://github.com/domdanrtsey/orawatch/blob/master/orawatch.sh): collection stage · Collects allocated tablespace usage. · `orawatch.sh`

### Report Output

- [HTML report assembly](https://github.com/domdanrtsey/orawatch/blob/master/orawatch.sh): rendering stage · Converts collected results into report sections. · `orawatch.sh`
- **IP-based HTML summary**: generated artifact · Written in the working directory using the os_oracle_summary.html convention.
- [Example HTML report](https://github.com/domdanrtsey/orawatch/blob/master/192.168.35.244os_oracle_summary.html): checked-in artifact · Demonstrates expected generated output. · `192.168.35.244os_oracle_summary.html`

## Connections

- Oracle OS operator → Oracle local environment: prepares
- Oracle OS operator → orawatch.sh: invokes
- README usage guide → Oracle OS operator: documents
- Oracle local environment → orawatch.sh: provides runtime
- SYSTEM credentials → orawatch.sh: authenticates
- orawatch.sh → Selected Oracle instance: runs inspection SQL
- orawatch.sh → Host and IP discovery: collects
- orawatch.sh → Database version: collects
- orawatch.sh → Archive-log status: collects
- orawatch.sh → Memory state: collects
- orawatch.sh → Tablespace autoextend: collects
- orawatch.sh → Tablespace utilization: collects
- Selected Oracle instance → Database version: returns state
- Selected Oracle instance → Archive-log status: returns state
- Selected Oracle instance → Memory state: returns state
- Selected Oracle instance → Tablespace autoextend: returns state
- Selected Oracle instance → Tablespace utilization: returns state
- Host and IP discovery → HTML report assembly: report section
- Database version → HTML report assembly: report section
- Archive-log status → HTML report assembly: report section
- Memory state → HTML report assembly: report section
- Tablespace autoextend → HTML report assembly: report section
- Tablespace utilization → HTML report assembly: report section
- HTML report assembly → IP-based HTML summary: writes
- Example HTML report → IP-based HTML summary: illustrates format
