Oracle DR: Fix service recreation causing SSH disconnect

Remove service delete/recreate at step 3.3 that was causing 'Broken pipe' error
Service is already configured with auto-start at step 2.1 - no need to recreate

Issue: oradim -delete was killing running database and breaking SSH connection
Solution: Skip recreation, service already has correct auto-start configuration

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
Marius
2025-10-11 02:29:38 +03:00
parent 6accd1f996
commit f79331f7cc

View File

@@ -200,19 +200,9 @@ if ($LASTEXITCODE -ne 0) {
Write-Host "WARNING: Failed to create SPFILE - database may not persist after connections close" -ForegroundColor Yellow
} else {
Write-Host "[OK] SPFILE created successfully"
Write-Host "[3.3] Oracle service already configured with AUTOMATIC startup (from step 2.1)"
# Recreate service with auto-start and SPFILE
Write-Host "[3.3] Recreating Oracle service with auto-start mode..."
& oradim -delete -sid ROA 2>&1 | Out-Null
Start-Sleep -Seconds 2
& oradim -new -sid ROA -startmode auto -spfile 2>&1 | Out-Null
if ($LASTEXITCODE -ne 0) {
Write-Host "WARNING: Failed to recreate service with auto-start" -ForegroundColor Yellow
} else {
Write-Host "[OK] Service recreated with auto-start mode"
}
# Register with listener and start it
# Start Oracle Listener
Write-Host "[3.4] Starting Oracle Listener..."
# Set Listener service to AUTOMATIC and start it