Files
ROMFASTSQL/proxmox/vm302-oracle-test/README.md
Marius a7f4242ce3 fix(proxmox): template VM 310 sysprep-uit, VM 300 nu mai e de clonat
VM 300 `Win11-Template` nu a fost sysprep-uit: poarta numele ROACENTRAL si
SID-ul de masina al VM 201 (S-1-5-21-1850128657-3079265004-705332634).
Clonele lui mostenesc acea identitate, iar NTLM intre doua masini cu acelasi
SID de masina esueaza — de aici imposibilitatea accesarii share-urilor SMB
intre VM 303 si VM 201, in ambele sensuri.

VM 300 nu poate fi reparat in loc: e template read-only, iar VM 303 e linked
clone din el. Solutia: clona completa 300 -> 310, sysprep acolo, conversie in
template. Verificat pe o clona de proba: nume si SID noi la fiecare pornire.

- clone-vm300.sh: SOURCE_VMID 300 -> 310
- README-uri: VM 310 marcat ca template de clonare, VM 300 ca "nu clona"
- vm302-oracle-test: corectat exemplul care clona in VM 303 (deja ocupat)
- docs/handoff-smb-vm303-roacentral.md: probele, capcanele de sysprep, stare

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MoFGxftQw92PX4Sdkn94pv
2026-08-10 23:24:47 +03:00

10 KiB

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)

# 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

# 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 as Administrator
cd C:\roa-setup
.\RunAll.cmd

4. Stop VM (when done)

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

ssh root@10.0.20.201 "qm status 302"

Start VM

ssh root@10.0.20.201 "qm start 302"

Graceful Shutdown

ssh root@10.0.20.201 "qm shutdown 302"

Force Stop

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
# 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

# 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

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

# 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

# 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:

-- 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:

# 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:

$DATAFILE_DIR = "C:\app\romfast\product\21c\oradata\XE\XEPDB1"

Permission Error on C:\DMPDIR

# Grant Oracle service permissions
icacls C:\DMPDIR /grant "NT SERVICE\OracleServiceXE:(OI)(CI)F" /T

PDB Not Open

-- 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

# 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

# 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

# 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

# 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)

# 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)

# 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

# Restore to clean state
ssh root@10.0.20.201 "qm rollback 302 pre-test"

Delete Snapshot

ssh root@10.0.20.201 "qm delsnapshot 302 pre-test"

Clone VM for Parallel Testing

# Clone VM 302 to VM 304  (ATENTIE: 303 e ocupat de Win11-Adina)
ssh root@10.0.20.201 "qm clone 302 304 --name oracle-test-304 --full"

# Start new VM
ssh root@10.0.20.201 "qm start 304"

# Note: Change IP in Windows after boot (Network Settings)

Notes

  • VM 302 is cloned from template VM 300 (clean Windows + Oracle XE)
  • Pentru clone NOI foloseste template-ul VM 310 Win11-Template-Sysprep, nu VM 300. VM 300 nu e sysprep-uit: poarta numele si SID-ul de masina al VM 201, iar clonele lui nu se pot autentifica prin SMB/NTLM cu VM 201 sau intre ele. Detalii si probe in docs/handoff-smb-vm303-roacentral.md.
  • 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)