From e4df4c11d8c2b0e4f0d8388701e56c81667d5416 Mon Sep 17 00:00:00 2001 From: Marius Date: Sat, 11 Oct 2025 15:12:21 +0300 Subject: [PATCH] Oracle DR: Fix service start hang - don't start stopped service MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Critical fix for service preservation: Problem: - After cleanup, Oracle service is stopped - Start-Service attempts to start the instance automatically - Without database files, service startup hangs indefinitely - PowerShell Start-Service blocks waiting for service to start Root Cause: - Oracle service on Windows tries to auto-start the instance - With no controlfile/database files, it cannot start - Start-Service waits forever (user reported 25+ warnings) Solution: - Do NOT attempt to start the stopped service - SQL*Plus can connect '/ as sysdba' even if service is stopped - STARTUP NOMOUNT will manually start the instance - This is the correct Oracle workflow for restore from zero Windows SQL*Plus requirements: ✓ ORACLE_SID set (we set this) ✓ Service exists in registry (preserved after cleanup) ✓ ORACLE_HOME set (we set this) ✗ Service running NOT required for NOMOUNT startup The service will naturally transition to Running state when STARTUP NOMOUNT successfully starts the instance. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- oracle/standby-server-scripts/rman_restore_from_zero.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/oracle/standby-server-scripts/rman_restore_from_zero.ps1 b/oracle/standby-server-scripts/rman_restore_from_zero.ps1 index f8b6579..f89808f 100644 --- a/oracle/standby-server-scripts/rman_restore_from_zero.ps1 +++ b/oracle/standby-server-scripts/rman_restore_from_zero.ps1 @@ -88,6 +88,7 @@ $service = Get-Service -Name "OracleServiceROA" -ErrorAction SilentlyContinue if ($service) { Write-Host "[OK] Oracle service already exists, skipping creation (15s saved!)" -ForegroundColor Green Write-Host " Service will be reused for this restore" + Write-Host " Note: Service status is $($service.Status) (OK - will be started by NOMOUNT)" } else { Write-Host " Oracle service not found, creating from PFILE..."