Add ROA Oracle Database Windows setup scripts with old client support

PowerShell scripts for setting up Oracle 21c/XE with ROA application:
- Automated tablespace, user creation and imports
- sqlnet.ora config for Instant Client 11g/ODBC compatibility
- Oracle 21c read-only Home path handling (homes/OraDB21Home1)
- Listener restart + 10G password verifier for legacy auth
- Tested on VM 302 with CONTAFIN_ORACLE schema import

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Marius
2026-01-28 17:08:02 +02:00
parent 665c2b5d37
commit 989477f7a4
26 changed files with 8972 additions and 0 deletions

View File

@@ -0,0 +1,212 @@
#!/bin/bash
# =============================================================================
# Clone VM 300 (Windows 11 Template) for Oracle Testing
# =============================================================================
#
# Purpose: Create a test VM for Oracle installation testing
#
# Usage:
# ./clone-vm300.sh [TARGET_VMID] [TARGET_NAME]
#
# Examples:
# ./clone-vm300.sh # Creates VM 301 named oracle-test-301
# ./clone-vm300.sh 305 # Creates VM 305 named oracle-test-305
# ./clone-vm300.sh 310 roa-prod # Creates VM 310 named roa-prod
#
# Prerequisites:
# - Run on Proxmox host (pvemini, pve1, or pveelite)
# - VM 300 exists as Windows 11 template
# - Sufficient storage space (~50GB per clone)
#
# =============================================================================
set -e
# -----------------------------------------------------------------------------
# Configuration
# -----------------------------------------------------------------------------
SOURCE_VMID=300
TARGET_VMID=${1:-301}
TARGET_NAME=${2:-"oracle-test-${TARGET_VMID}"}
# Storage for new VM (change if needed)
TARGET_STORAGE="local-zfs"
# Node where to create the VM (empty = same as source)
TARGET_NODE=""
# Full clone (true) or linked clone (false)
FULL_CLONE=true
# Start VM after creation
AUTO_START=true
# Description for the new VM
DESCRIPTION="Oracle 21c Test VM - Created $(date '+%Y-%m-%d %H:%M')"
# -----------------------------------------------------------------------------
# Validation
# -----------------------------------------------------------------------------
echo "=============================================="
echo "Proxmox VM Clone Script"
echo "=============================================="
echo ""
echo "Source VM: $SOURCE_VMID"
echo "Target VM: $TARGET_VMID"
echo "Target Name: $TARGET_NAME"
echo "Full Clone: $FULL_CLONE"
echo "Auto Start: $AUTO_START"
echo ""
# Check if running on Proxmox
if ! command -v qm &> /dev/null; then
echo "ERROR: This script must be run on a Proxmox host"
echo " (qm command not found)"
exit 1
fi
# Check if source VM exists
if ! qm status $SOURCE_VMID &> /dev/null; then
echo "ERROR: Source VM $SOURCE_VMID does not exist"
exit 1
fi
# Check if target VMID is already in use
if qm status $TARGET_VMID &> /dev/null 2>&1; then
echo "ERROR: Target VMID $TARGET_VMID already exists"
echo " Choose a different VMID or remove existing VM:"
echo " qm destroy $TARGET_VMID"
exit 1
fi
# Confirm before proceeding
read -p "Proceed with cloning? [y/N] " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Aborted."
exit 0
fi
# -----------------------------------------------------------------------------
# Clone VM
# -----------------------------------------------------------------------------
echo ""
echo "Creating clone..."
CLONE_CMD="qm clone $SOURCE_VMID $TARGET_VMID --name $TARGET_NAME"
if [ "$FULL_CLONE" = true ]; then
CLONE_CMD="$CLONE_CMD --full"
fi
if [ -n "$TARGET_STORAGE" ]; then
CLONE_CMD="$CLONE_CMD --storage $TARGET_STORAGE"
fi
if [ -n "$TARGET_NODE" ]; then
CLONE_CMD="$CLONE_CMD --target $TARGET_NODE"
fi
echo "Running: $CLONE_CMD"
eval $CLONE_CMD
echo "Clone created successfully"
# -----------------------------------------------------------------------------
# Configure VM
# -----------------------------------------------------------------------------
echo ""
echo "Configuring VM..."
# Set description
qm set $TARGET_VMID --description "$DESCRIPTION"
# Optionally increase resources for Oracle
# qm set $TARGET_VMID --memory 8192 --cores 4
echo "VM configured"
# -----------------------------------------------------------------------------
# Start VM
# -----------------------------------------------------------------------------
if [ "$AUTO_START" = true ]; then
echo ""
echo "Starting VM..."
qm start $TARGET_VMID
# Wait for VM to start
sleep 5
# Check status
STATUS=$(qm status $TARGET_VMID | awk '{print $2}')
echo "VM Status: $STATUS"
fi
# -----------------------------------------------------------------------------
# Output Summary
# -----------------------------------------------------------------------------
echo ""
echo "=============================================="
echo "VM Clone Complete"
echo "=============================================="
echo ""
echo "VMID: $TARGET_VMID"
echo "Name: $TARGET_NAME"
echo "Status: $(qm status $TARGET_VMID | awk '{print $2}')"
echo ""
echo "Console URL: https://$(hostname -I | awk '{print $1}'):8006/#v1:0:=qemu%2F${TARGET_VMID}:4::::::"
echo ""
echo "Next steps:"
echo " 1. Connect to VM console"
echo " 2. Complete Windows OOBE if needed"
echo " 3. Install Oracle 21c XE or SE"
echo " 4. Run ROA setup scripts"
echo ""
echo "To delete this VM when done:"
echo " qm stop $TARGET_VMID"
echo " qm destroy $TARGET_VMID"
echo ""
# -----------------------------------------------------------------------------
# Helper Commands
# -----------------------------------------------------------------------------
# Print helpful commands
cat << 'COMMANDS'
# Useful Proxmox commands:
# List all VMs
qm list
# VM status
qm status TARGET_VMID
# Start/Stop/Restart VM
qm start TARGET_VMID
qm stop TARGET_VMID
qm restart TARGET_VMID
# Access VM console
qm terminal TARGET_VMID
# Clone with different storage
qm clone 300 TARGET_VMID --name NAME --full --storage local-lvm
# Snapshot before testing
qm snapshot TARGET_VMID snap-before-oracle --description "Before Oracle install"
# Rollback to snapshot
qm rollback TARGET_VMID snap-before-oracle
# Delete VM
qm stop TARGET_VMID && qm destroy TARGET_VMID
COMMANDS
exit 0