- Rename $Host parameter to $DbHost in oracle-functions.ps1 (Invoke-SqlPlus,
Test-OracleConnection, Get-OracleVersion, Test-PDB, Get-ServiceName)
- Update all function calls in 01-setup-database.ps1 to use -DbHost instead of -Host
- Fix ${Host} -> ${DbHost} in log message (line 147)
- Fix Write-Log "" -> Write-Host "" to avoid empty string parameter error
- Add DbHost/Port parameters and config.ps1 support to setup script
- Update sys-updates/README.md to clarify folder is for future patches only
Tested successfully on ROACENTRAL (10.0.20.130) with Oracle XE 21c.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
62 lines
1.9 KiB
Markdown
62 lines
1.9 KiB
Markdown
# SYS Updates Folder
|
|
|
|
This folder is for **future patches and updates only**, not for initial setup.
|
|
|
|
## Important Note
|
|
|
|
The initial SYS objects (AUTH_PACK, NEWSCHEMA, EXECUTESCRIPTOS, etc.) are already
|
|
consolidated in `../sys-objects.sql`. You do NOT need to copy the old individual
|
|
scripts (`sys_2006_*.sql` through `sys_2026_*.sql`) here.
|
|
|
|
**Initial setup order:**
|
|
1. `sys-objects.sql` - Creates all SYS objects (tables, packages, procedures, views)
|
|
2. Import `CONTAFIN_ORACLE.dmp` - Application schema
|
|
3. `sys-grants.sql` - Grants and public synonyms
|
|
4. `sys-updates/*.sql` - (Optional) Post-install patches
|
|
|
|
## When to Use This Folder
|
|
|
|
Place scripts here when you need to:
|
|
- Add new grants or privileges after initial setup
|
|
- Patch AUTH_PACK or other SYS objects
|
|
- Add new SYS procedures/functions
|
|
- Fix issues discovered after deployment
|
|
|
|
## Naming Convention
|
|
|
|
Use date-based naming for proper ordering:
|
|
```
|
|
YYYY_MM_DD_##_DESCRIPTION.sql
|
|
```
|
|
|
|
Examples:
|
|
- `2026_02_15_01_AUTH_PACK_FIX.sql`
|
|
- `2026_03_01_01_NEW_GRANT.sql`
|
|
|
|
## How Scripts Are Executed
|
|
|
|
1. The `run-sys-updates.sql` master script executes all `.sql` files in this folder
|
|
2. Scripts run in alphabetical order (hence the date prefix)
|
|
3. Each script should be idempotent (safe to run multiple times)
|
|
|
|
## Template
|
|
|
|
```sql
|
|
-- ============================================================================
|
|
-- YYYY_MM_DD_##_DESCRIPTION
|
|
-- ============================================================================
|
|
-- Author: Your Name
|
|
-- Date: YYYY-MM-DD
|
|
-- Description: What this script does
|
|
-- ============================================================================
|
|
|
|
SET SERVEROUTPUT ON
|
|
WHENEVER SQLERROR CONTINUE
|
|
|
|
-- Your SQL here
|
|
|
|
-- Update version tracking (optional)
|
|
-- EXEC CONTAFIN_ORACLE.PACK_MIGRARE.UpdateVersiune('sys_YYYY_MM_DD_##_DESCRIPTION','','SYS');
|
|
-- COMMIT;
|
|
```
|