docs(vm302): split test env into dedicated dir, mark SE 21c as TODO

Move VM302-TESTING.md from lxc108-oracle/roa-windows-setup/test/ into a
new proxmox/vm302-oracle-test/ directory (sibling of vm109/vm201) so the
test environment is documented separately from the setup scripts. Add a
dual-edition test plan (XE validated / SE TODO) and a stub for capturing
the production SE errors next time they reproduce.

Cross-link from roa-windows-setup/README.md, proxmox/README.md master
index and CLAUDE.md entry points. Setup scripts stay in lxc108-oracle —
they are not VM-specific.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-04-25 19:40:38 +00:00
parent 1d67f0705b
commit 44b3c0da60
6 changed files with 259 additions and 8 deletions

View File

@@ -0,0 +1,425 @@
# VM 302 - oracle-test-302 (ROA Windows Setup Test VM)
VM-ul de test pentru scripturile de instalare ROA pe Windows + Oracle 21c.
Scripturile efective trăiesc în `proxmox/lxc108-oracle/roa-windows-setup/`
(generale, nu legate de VM 302). Acest director documentează **mediul de test**
și planul de validare.
## Status testare
| Ediție Oracle | Status | Note |
|---------------|--------|------|
| **21c XE (CDB/PDB)** | OK | Validat pe VM 302, `RunAll.cmd` rulează complet |
| **21c Standard Edition (non-CDB)** | TODO | NETESTAT pe VM 302. În producție au apărut erori — vezi `docs/issues-se-prod.md` |
> Scripturile `roa-windows-setup` au fost testate doar pe XE. La rularea în
> producție pe Oracle 21c SE au apărut erori. Înainte de următorul deployment
> SE trebuie reprodus scenariul SE pe VM 302 (sau clonă VM 303). Vezi
> `docs/dual-edition-test-plan.md`.
---
## VM Information
| Property | Value |
|----------|-------|
| VM ID | 302 |
| Name | oracle-test-302 |
| Hostname | ROACENTRAL |
| IP Address | 10.0.20.130 |
| RAM | 4 GB |
| Disk | 500 GB |
| OS | Windows 11 |
| Oracle | 21c XE (CDB/PDB) — instalat curent |
| Proxmox Host | pvemini (10.0.20.201) |
| Scripturi setup | `../lxc108-oracle/roa-windows-setup/` |
---
## Quick Start
### 1. Start VM (if stopped)
```bash
# From any machine with SSH access to Proxmox
ssh root@10.0.20.201 "qm start 302"
# Wait for boot (~2-3 minutes)
ssh root@10.0.20.201 "qm status 302"
```
### 2. Connect to VM
```bash
# SSH (if OpenSSH installed)
ssh romfast@10.0.20.130
# Or use RDP
mstsc /v:10.0.20.130
# User: romfast
```
### 3. Run Tests
```powershell
# PowerShell as Administrator
cd C:\roa-setup
.\RunAll.cmd
```
### 4. Stop VM (when done)
```bash
ssh root@10.0.20.201 "qm shutdown 302"
# Or force stop:
ssh root@10.0.20.201 "qm stop 302"
```
---
## Proxmox VM Management
### Check Status
```bash
ssh root@10.0.20.201 "qm status 302"
```
### Start VM
```bash
ssh root@10.0.20.201 "qm start 302"
```
### Graceful Shutdown
```bash
ssh root@10.0.20.201 "qm shutdown 302"
```
### Force Stop
```bash
ssh root@10.0.20.201 "qm stop 302"
```
### Access Console (via Proxmox GUI)
```
https://10.0.20.201:8006 → VM 302 → Console
```
---
## Current Configuration
### Oracle Connection
| Property | Value |
|----------|-------|
| Host | 10.0.20.130 |
| Port | 1521 |
| Service | XEPDB1 |
| SYS Password | romfastsoft |
| SYSTEM Password | romfastsoft |
```bash
# SQL*Plus connection
sqlplus sys/romfastsoft@10.0.20.130:1521/XEPDB1 as sysdba
sqlplus system/romfastsoft@10.0.20.130:1521/XEPDB1
sqlplus CONTAFIN_ORACLE/ROMFASTSOFT@10.0.20.130:1521/XEPDB1
```
### ROA Users (after installation)
| User | Password | Purpose |
|------|----------|---------|
| CONTAFIN_ORACLE | ROMFASTSOFT | Common schema |
| CAPIDAVATOUR | ROMFASTSOFT | Test company |
### DMP Files Available
```
C:\DMPDIR\
├── contafin_oracle_72001.dmp (276 MB)
└── capidavatour_72001.dmp (76 MB)
```
### Setup Directory
```
C:\roa-setup\
├── config.ps1 # Current configuration
├── scripts\ # PowerShell setup scripts
├── sql\ # SQL scripts
├── par\ # Import parameters
└── logs\ # Execution logs
```
---
## Testing Workflow
### Full Installation Test
```powershell
# 1. Uninstall existing ROA (if any)
cd C:\roa-setup
.\scripts\99-uninstall-roa.ps1 -SystemPassword "romfastsoft" -Force
# 2. Run full installation
.\RunAll.cmd
# 3. Verify
.\scripts\07-verify-installation.ps1
```
### Individual Script Test
```powershell
cd C:\roa-setup
# Use Run.cmd wrapper (handles ExecutionPolicy)
.\Run.cmd 01-setup-database.ps1
.\Run.cmd 02-create-sys-objects.ps1
.\Run.cmd 03-import-contafin.ps1
.\Run.cmd 04-create-synonyms-grants.ps1
.\Run.cmd 05-import-companies.ps1
.\Run.cmd 08-post-install-config.ps1
.\Run.cmd 07-verify-installation.ps1
```
### Reset for Fresh Test
```powershell
# Complete uninstall (drops all ROA objects)
.\scripts\99-uninstall-roa.ps1 -SystemPassword "romfastsoft" -Force
# This removes:
# - CONTAFIN_ORACLE user
# - CAPIDAVATOUR user (and any other company users)
# - ROA tablespace
# - Public synonyms
# - SYS objects (AUTH_PACK, NEWSCHEMA, etc.)
```
---
## Script Execution Order
| # | Script | Duration | Purpose |
|---|--------|----------|---------|
| 1 | 01-setup-database.ps1 | ~30s | Tablespace, profile, CONTAFIN_ORACLE user |
| 2 | 02-create-sys-objects.ps1 | ~15s | AUTH_PACK, NEWSCHEMA, UTL_MAIL config |
| 3 | 03-import-contafin.ps1 | ~2 min | Import CONTAFIN_ORACLE schema (344 objects) |
| 4 | 04-create-synonyms-grants.ps1 | ~30s | 81 public synonyms + grants |
| 5 | 05-import-companies.ps1 | ~3 min | Import CAPIDAVATOUR (3418 objects) |
| 6 | 08-post-install-config.ps1 | ~1 min | 54 directories, SERVER_INFO |
| 7 | 07-verify-installation.ps1 | ~15s | Verification report |
**Total: ~8 minutes for full installation**
---
## Expected Results
### After Successful Installation
```
07-verify-installation.ps1 output:
=== ROA Installation Verification ===
Tablespace ROA: OK
User CONTAFIN_ORACLE: OK (344 objects)
User CAPIDAVATOUR: OK (3418 objects)
Public Synonyms: OK (81 synonyms)
SYS Objects: OK (AUTH_PACK, NEWSCHEMA, etc.)
ROAUPDATE Directories: OK (54 directories)
SERVER_INFO: OK (configured)
```
### Object Counts
| Schema | Objects | Tables | Procedures | Packages |
|--------|---------|--------|------------|----------|
| CONTAFIN_ORACLE | 344 | ~80 | ~50 | ~20 |
| CAPIDAVATOUR | 3418 | ~150 | ~100 | ~30 |
---
## Troubleshooting
### Oracle Service Not Running
```powershell
# Check service
Get-Service OracleServiceXE
# Start service
Start-Service OracleServiceXE
# Check listener
lsnrctl status
```
### DMPDIR Points to Wrong Path
Oracle XE has a pre-existing DMPDIR that points to `D:\Oracle\admin\ORCL\dpdump`.
The setup scripts should now handle this automatically, but to verify/fix manually:
```sql
-- Check existing directories
SELECT directory_name, directory_path FROM dba_directories WHERE directory_name = 'DMPDIR';
-- If pointing to wrong path, recreate
DROP DIRECTORY DMPDIR;
CREATE OR REPLACE DIRECTORY DMPDIR AS 'C:\DMPDIR';
GRANT READ, WRITE ON DIRECTORY DMPDIR TO PUBLIC;
```
**Note:** The `New-OracleDirectory` function in `oracle-functions.ps1` now automatically
detects and corrects this issue (drops and recreates if path differs).
### DATAFILE_DIR Wrong Path
If tablespace creation fails with ORA-01119, check the datafile path in config.ps1:
```powershell
# Check actual datafile location
sqlplus -S sys/romfastsoft@10.0.20.130:1521/XEPDB1 "as sysdba" <<< "SELECT file_name FROM dba_data_files WHERE ROWNUM = 1;"
# Common paths:
# Oracle XE typical: C:\app\<user>\product\21c\oradata\XE\XEPDB1
# Not: C:\app\<user>\oradata\XE\XEPDB1 (missing 'product\21c')
```
Fix in config.ps1:
```powershell
$DATAFILE_DIR = "C:\app\romfast\product\21c\oradata\XE\XEPDB1"
```
### Permission Error on C:\DMPDIR
```powershell
# Grant Oracle service permissions
icacls C:\DMPDIR /grant "NT SERVICE\OracleServiceXE:(OI)(CI)F" /T
```
### PDB Not Open
```sql
-- Connect as SYSDBA to CDB
sqlplus sys/romfastsoft@localhost:1521/XE as sysdba
-- Open PDB
ALTER PLUGGABLE DATABASE XEPDB1 OPEN;
ALTER PLUGGABLE DATABASE XEPDB1 SAVE STATE;
```
### Script Execution Policy Error
```powershell
# Use Run.cmd wrapper instead of direct execution
.\Run.cmd 01-setup-database.ps1
# Or set policy manually (Admin PowerShell)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```
### Check Logs
```powershell
# View latest log
Get-ChildItem C:\roa-setup\logs\ | Sort-Object LastWriteTime -Descending | Select-Object -First 5
# Read specific log
Get-Content C:\roa-setup\logs\01-setup-database_*.log
```
---
## Deploying Updated Scripts
### From WSL/Linux
```bash
# Copy all scripts to VM
scp -r /mnt/e/proiecte/ROMFASTSQL/proxmox/lxc108-oracle/roa-windows-setup/* romfast@10.0.20.130:C:/roa-setup/
```
### From Windows
```powershell
# Copy from network share or local path
Copy-Item -Recurse E:\proiecte\ROMFASTSQL\proxmox\lxc108-oracle\roa-windows-setup\* C:\roa-setup\ -Force
```
### Quick Script Update (single file)
```bash
# Update specific script
scp /mnt/e/proiecte/ROMFASTSQL/proxmox/lxc108-oracle/roa-windows-setup/scripts/03-import-contafin.ps1 romfast@10.0.20.130:C:/roa-setup/scripts/
```
---
## VM Snapshots
### Create Snapshot (for quick restore)
```bash
# Before testing
ssh root@10.0.20.201 "qm snapshot 302 pre-test --description 'Before ROA test'"
# List snapshots
ssh root@10.0.20.201 "qm listsnapshot 302"
```
### Restore Snapshot
```bash
# Restore to clean state
ssh root@10.0.20.201 "qm rollback 302 pre-test"
```
### Delete Snapshot
```bash
ssh root@10.0.20.201 "qm delsnapshot 302 pre-test"
```
---
## Clone VM for Parallel Testing
```bash
# Clone VM 302 to VM 303
ssh root@10.0.20.201 "qm clone 302 303 --name oracle-test-303 --full"
# Start new VM
ssh root@10.0.20.201 "qm start 303"
# Note: Change IP in Windows after boot (Network Settings)
```
---
## Notes
- VM 302 is cloned from template VM 300 (clean Windows + Oracle XE)
- Oracle XE has 2GB RAM limit - sufficient for testing
- DMP files are already in C:\DMPDIR (persisted between tests)
- Uninstall script preserves DMP files
---
**Last Updated:** 2026-04-25
**Author:** Marius Mutu
**Project:** ROMFASTSQL - VM 302 (oracle-test-302) test environment
## Documente conexe
- `docs/dual-edition-test-plan.md` — plan testare XE + SE 21c
- `docs/issues-se-prod.md` — TODO: log erori întâlnite în producție pe Oracle SE 21c
- `../lxc108-oracle/roa-windows-setup/README.md` — scripturile de setup
- `../lxc108-oracle/roa-windows-setup/test/clone-vm300.sh` — clonare VM template 300 (utilizat pentru a crea VM 302)

View File

@@ -0,0 +1,118 @@
# Plan de testare dual-edition: Oracle 21c XE + SE
## Context
Scripturile `roa-windows-setup` (din `lxc108-oracle/roa-windows-setup/`) susțin
două ținte:
- **Oracle 21c XE** — CDB/PDB, free, limită 12 GB date / 2 GB RAM
- **Oracle 21c Standard Edition** — non-CDB, licență, fără limite
Diferențe care contează la setup (vezi `roa-windows-setup/README.md`
"Architecture Differences"):
| Element | XE | SE |
|---------|----|----|
| Arhitectură | CDB + PDB (XEPDB1) | non-CDB (single DB: ROA) |
| Service name | XEPDB1 | ROA |
| ORACLE_HOME | `...\dbhomeXE` | `...\dbhome_1` |
| Datafile dir | `...\oradata\XE\XEPDB1` | `...\oradata\ROA` |
| Service Windows | OracleServiceXE | OracleServiceROA |
| Conectare ca SYS | `sys/...@XEPDB1 as sysdba` | `sys/...@ROA as sysdba` |
Aceste diferențe sunt ascunse în `config.ps1`. Riscul: o ramură de cod care
presupune CDB/PDB (de ex. `ALTER SESSION SET CONTAINER`) va eșua pe SE non-CDB.
**Acesta e cazul real care a produs erori în producție** — vezi `issues-se-prod.md`.
## Status curent
| Scenariu | Mediu | Status |
|----------|-------|--------|
| XE — install fresh | VM 302 (Windows 11 + XE) | OK |
| XE — uninstall/reinstall | VM 302 | OK |
| XE — add company | VM 302 | OK |
| **SE — install fresh** | — | **TODO** |
| **SE — uninstall/reinstall** | — | **TODO** |
| **SE — add company** | — | **TODO** |
| SE — în producție | server prod Windows | EȘUAT (erori — TODO de capturat) |
## Plan testare SE pe VM 302
### Variantă A — reconfigurare VM 302 pentru SE
Risc: pierdem mediul XE deja validat. Necesar snapshot înainte.
```bash
# Snapshot XE state
ssh root@10.0.20.201 "qm snapshot 302 xe-validated --description 'Pre-SE-test, XE installation validated'"
```
Pași pe VM:
1. Uninstall Oracle XE complet (Programs and Features + manual cleanup)
2. Install Oracle 21c SE conform `roa-windows-setup/docs/00-INSTALL-ORACLE-SE.md`
- Wizard: "Create and configure a single instance database"
- Global database name: `ROA`
- **Debifează** "Create as Container database"
3. Copy `config.example.ps1``config.ps1`, ajustează valorile pentru SE:
```powershell
$ORACLE_HOME = "C:\app\oracle\product\21c\dbhome_1"
$SERVICE_NAME = "ROA"
$DATAFILE_DIR = "C:\app\oracle\oradata\ROA"
```
4. `RunAll.cmd` și capturează toate erorile
5. Snapshot SE state:
```bash
ssh root@10.0.20.201 "qm snapshot 302 se-validated --description 'SE installation validated'"
```
### Variantă B — clonă VM 303 dedicată SE
Recomandată dacă vrem să păstrăm ambele medii live pentru regresie.
```bash
# Clone VM 302 → 303 (template state, înainte de Oracle XE — TODO: identifică snapshot)
ssh root@10.0.20.201 "qm clone 302 303 --name oracle-test-303-se --full"
ssh root@10.0.20.201 "qm start 303"
# Schimbă IP-ul Windows: 10.0.20.130 → 10.0.20.131 (sau altul liber)
```
Apoi pași 1-5 din varianta A pe VM 303.
> **Cost spațiu:** clonă full pe local-zfs ≈ 500 GB. Verifică spațiu pvemini
> înainte (`zfs list local-zfs`).
## Checklist validare per ediție
Pentru fiecare ediție (XE și SE), bifează după rulare reușită:
### Install fresh
- [ ] `01-setup-database.ps1` — tablespace ROA + CONTAFIN_ORACLE user
- [ ] `02-create-sys-objects.ps1` — AUTH_PACK, NEWSCHEMA, EXECUTESCRIPTOS, UTL_MAIL
- [ ] `03-import-contafin.ps1` — import CONTAFIN_ORACLE (~344 obiecte)
- [ ] `04-create-synonyms-grants.ps1` — 81 synonyms publice + grants
- [ ] `05-import-companies.ps1` — minim 1 firmă (CAPIDAVATOUR ~3418 obiecte)
- [ ] `08-post-install-config.ps1` — 54 directories, SERVER_INFO, scheduler jobs
- [ ] `07-verify-installation.ps1` — toate verificările OK
### Add company
- [ ] `06-add-company.ps1` — adaugă firmă nouă pe instalare existentă
### Uninstall
- [ ] `99-uninstall-roa.ps1` — curăță tot, lasă DB-ul gata pentru reinstall
## Ce trebuie urmărit specific pentru SE
Locuri unde scripturile pot face presupuneri CDB-only:
- `ALTER PLUGGABLE DATABASE` — nu există pe non-CDB
- `ALTER SESSION SET CONTAINER` — nu se aplică pe non-CDB
- Path-uri datafile hardcodate `XE\XEPDB1`
- Service name `XEPDB1` în connection strings
- DBMS_AUTO_TASK_ADMIN tweaks (XE 12 GB workaround) — irelevante pe SE
`grep -rn "XEPDB1\|XE\b\|SET CONTAINER\|PLUGGABLE DATABASE" lxc108-oracle/roa-windows-setup/scripts lxc108-oracle/roa-windows-setup/sql`
înainte de testul SE — orice match e candidat la breakaj.
---
**Last Updated:** 2026-04-25
**Author:** Marius Mutu

View File

@@ -0,0 +1,44 @@
# Erori producție — Oracle 21c Standard Edition
> **Status: TODO — de completat cu detalii concrete.**
>
> Scripturile `roa-windows-setup` au fost validate pe VM 302 doar pe Oracle 21c
> XE. La rularea în producție pe Oracle 21c Standard Edition au apărut erori,
> dar logurile nu au fost capturate la momentul incidentului.
## Ce trebuie capturat (la următoarea apariție a erorilor)
Pentru fiecare eroare:
1. **Scriptul care a eșuat** (ex. `03-import-contafin.ps1`, pasul exact)
2. **Mesajul de eroare complet** — ORA-XXXXX, stack trace PowerShell, output sqlplus
3. **Comanda care a generat-o** — copiat exact din log
4. **Versiunea Oracle SE**`select banner from v$version;`
5. **Configurația activă**`config.ps1` folosit (fără parole)
6. **Mediul** — Windows version, ORACLE_HOME, service name, dacă e CDB sau non-CDB
## Suspiciuni inițiale (de verificat)
Pe baza diferențelor SE vs XE (vezi `dual-edition-test-plan.md`):
- Connection strings hardcodate cu `XEPDB1` în loc de `ROA`
- Comenzi `ALTER PLUGGABLE DATABASE` care eșuează pe non-CDB
- Path-uri datafile presupunând structura `XE\XEPDB1`
- Tweaks specifice XE (DBMS_AUTO_TASK_ADMIN, audit policy) care nu există /
se comportă diferit pe SE
- Numele serviciului Windows: `OracleServiceXE` vs `OracleServiceROA`
- ORACLE_HOME diferit (`dbhomeXE` vs `dbhome_1`) — variabile de mediu
## Acțiuni
- [ ] La următoarea instalare prod SE, capturează toate logurile din
`C:\roa-setup\logs\` și atașează aici
- [ ] Reproducere pe VM 302 sau clonă VM 303 (vezi `dual-edition-test-plan.md`)
- [ ] Fix scripturi pe baza erorilor reale
- [ ] Re-test fresh install SE până trece complet
- [ ] Update `roa-windows-setup/README.md` — marchează SE ca "tested OK"
---
**Last Updated:** 2026-04-25
**Author:** Marius Mutu