diff --git a/proxmox/lxc108-oracle/roa-windows-setup/scripts/01-setup-database.ps1 b/proxmox/lxc108-oracle/roa-windows-setup/scripts/01-setup-database.ps1 index 643e6c9..26928de 100644 --- a/proxmox/lxc108-oracle/roa-windows-setup/scripts/01-setup-database.ps1 +++ b/proxmox/lxc108-oracle/roa-windows-setup/scripts/01-setup-database.ps1 @@ -278,9 +278,25 @@ NAMES.DIRECTORY_PATH = (TNSNAMES, EZCONNECT) $lsnrOutput = & $lsnrctl start 2>&1 Write-LogSuccess "Listener restarted successfully" - # Wait for services to register + # Wait for services to register (can take 30-60 seconds) Write-Log "Waiting for database services to register with listener..." - Start-Sleep -Seconds 10 + $maxWait = 60 + $waited = 0 + $interval = 5 + while ($waited -lt $maxWait) { + Start-Sleep -Seconds $interval + $waited += $interval + # Check if our service is registered + $lsnrStatus = & $lsnrctl status 2>&1 | Out-String + if ($lsnrStatus -match $ServiceName) { + Write-Log "Service $ServiceName registered after ${waited}s" + break + } + Write-Log "Waiting... (${waited}s/${maxWait}s)" + } + if ($waited -ge $maxWait) { + Write-LogWarning "Service may not be fully registered yet. Continuing anyway..." + } } catch { Write-LogWarning "Could not restart listener: $_"