Fix ROA Windows setup scripts for Oracle XE deployment

Key fixes:
- Add Run.cmd/RunAll.cmd wrappers with ExecutionPolicy Bypass
- Add Get-ListenerHost() to auto-detect listener IP address
- Fix impdp connection using EZConnect format (host:port/service)
- Add parallel=1 for Oracle XE compatibility
- Fix Write-Log to accept empty strings with [AllowEmptyString()]
- Fix Get-SchemaObjectCount regex for Windows line endings (\r\n)
- Fix path comparison for DMP file copy operation
- Add GRANT EXECUTE ON SYS.AUTH_PACK TO PUBLIC for PACK_DREPTURI
- Fix VAUTH_SERII view to use SYN_NOM_PROGRAME (has DENUMIRE column)
- Add sections 10-11 to grants-public.sql for SYS object grants

Tested on VM 302 (10.0.20.130) with Oracle XE 21c.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Marius
2026-01-28 20:56:58 +02:00
parent 75a5daab6f
commit bcb558f1dc
9 changed files with 503 additions and 68 deletions

View File

@@ -66,7 +66,7 @@ param(
[string]$TableExistsAction = "REPLACE",
[Parameter(Mandatory = $false)]
[int]$Parallel = 2
[int]$Parallel = 1
)
$ErrorActionPreference = 'Stop'
@@ -117,7 +117,11 @@ try {
$dumpFileName = Split-Path -Path $DumpFile -Leaf
$targetDumpPath = Join-Path $DmpDir $dumpFileName
if ($DumpFile -ne $targetDumpPath) {
# Resolve paths for accurate comparison (handles casing and path format differences)
$resolvedSource = (Resolve-Path -Path $DumpFile -ErrorAction SilentlyContinue).Path
$resolvedTarget = if (Test-Path $targetDumpPath) { (Resolve-Path -Path $targetDumpPath).Path } else { $null }
if ($resolvedSource -ne $resolvedTarget) {
Write-Log "Copying dump file to DMPDIR..."
Copy-Item -Path $DumpFile -Destination $targetDumpPath -Force
Write-LogSuccess "Dump file copied to: $targetDumpPath"
@@ -149,8 +153,12 @@ try {
$importLogFile = "CONTAFIN_ORACLE_import_$(Get-Date -Format 'yyyyMMdd_HHmmss').log"
# Build impdp command
$connString = "SYSTEM/`"$SystemPassword`"@$ServiceName"
# Get listener host for connection (handles listener bound to specific IP)
$dbHost = Get-ListenerHost -OracleHome $oraHome
$dbPort = 1521
# Build impdp command with EZConnect format
$connString = "SYSTEM/`"$SystemPassword`"@${dbHost}:${dbPort}/${ServiceName}"
$impdpParams = @(
"`"$connString`"",
@@ -158,13 +166,10 @@ try {
"dumpfile=$dumpFileName",
"logfile=$importLogFile",
"schemas=CONTAFIN_ORACLE",
"table_exists_action=$TableExistsAction"
"table_exists_action=$TableExistsAction",
"parallel=$Parallel" # Always specify to override DMP metadata (XE requires parallel=1)
)
if ($Parallel -gt 1) {
$impdpParams += "parallel=$Parallel"
}
$arguments = $impdpParams -join " "
Write-Log "Executing impdp..."