# axiUm PostgreSQL Migration

Tools and configurations for migrating axiUm from Oracle to EDB PostgreSQL.

## Migration Toolkit (`tools/hs1-port`)

PowerShell-based migration toolkit that automates the full Oracle-to-PostgreSQL migration workflow. It handles database creation, schema migration via EDB Migration Toolkit (MTK), data transfer, sequence reimport, and post-migration validation. The toolkit compares source and target databases to verify object parity and row counts, and supports incremental re-runs for handling customizations and upgrades.

Requires administrator privileges, Oracle client tools, the Npgsql PowerShell module, and EDB MTK.

See [`tools/hs1-port/readme.md`](tools/hs1-port/readme.md) for full usage instructions.

## Performance Benchmarking

### HammerDB (`tools/hs1-hammerdb`)

Automated database benchmarking powered by HammerDB 5.0, bundled with Oracle Instant Client. Runs TPROC-C (OLTP) and TPROC-H (Analytics) benchmarks against PostgreSQL and Oracle databases with a fully automated build-schema, run-test, cleanup workflow. Results are exported as CSV, HTML, and text reports.

See [`tools/hs1-hammerdb/README.md`](tools/hs1-hammerdb/README.md) for setup and configuration.

### JMeter (`tools/hs1-jmeter`)

Max-user benchmark that ramps concurrent database connections (50 to 400 users) to find the capacity ceiling of a database. Each iteration runs a 2-minute JMeter test and stops early if error rate exceeds 5%, P95 response time exceeds 10 seconds, or connection pool errors occur. Includes pre-built `.jmx` test plans for both Oracle and PostgreSQL.

See [`tools/hs1-jmeter/README.md`](tools/hs1-jmeter/README.md) for setup and configuration.

## Cluster Configurations (`cluster`)

TPA (Trusted Postgres Architect) configuration files, Ansible hooks, and shell scripts for provisioning and managing EDB PostgreSQL clusters. Includes:

- **TPA configs** — Patroni and EFM cluster templates (`cluster/tpa/`)
- **Ansible hooks** — pre-deploy, post-deploy, cert fixes, PgBouncer settings, VIP setup (`cluster/tpa/hooks/`)
- **Shell scripts** — Patroni REST API cert fixes, TPA bug workarounds, certificate permission fixes (`cluster/scripts/`)
- **Ubuntu autoinstall** — preseed YAML templates for automated OS provisioning (`cluster/ubuntu/`)

## DDL Extractor (`extract-base-ddl`)

PowerShell script that generates a diffable DDL extract from an axiUm PostgreSQL database. Produces a normalized, stripped-down DDL (without site-specific customizations) suitable for comparing schema differences between database versions or environments.

Requires PowerShell 7 and the EDB version of `psql`.

See [`extract-base-ddl/README.md`](extract-base-ddl/README.md) for usage and parameters.
