Oracle DR: Complete Windows VM implementation and cleanup

Major changes:
- Implemented Windows VM 109 as DR target (replaces Linux LXC)
- Tested RMAN restore successfully (12-15 min RTO, 24h RPO)
- Added comprehensive DR documentation:
  * DR_WINDOWS_VM_STATUS_2025-10-09.md - Current implementation status
  * DR_UPGRADE_TO_CUMULATIVE_PLAN.md - Plan for cumulative incremental backups
  * DR_VM_MIGRATION_GUIDE.md - Guide for VM migration between Proxmox nodes
- Updated DR_WINDOWS_VM_IMPLEMENTATION_PLAN.md with completed phases

New scripts:
- add_system_key_dr.ps1 - SSH key setup for automated transfers
- configure_listener_dr.ps1 - Oracle Listener configuration
- fix_ssh_via_service.ps1 - SSH authentication fix
- rman_restore_final.cmd - Working RMAN restore script (tested)
- transfer_to_dr.ps1 - FULL backup transfer (renamed from 02_*)
- transfer_incremental.ps1 - Incremental backup transfer (renamed from 02b_*)

Cleanup:
- Removed 19 obsolete scripts for Linux LXC DR
- Removed 8 outdated documentation files
- Organized project structure

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Marius
2025-10-09 18:54:08 +03:00
parent 6a6ffe84af
commit ac2340c967
26 changed files with 2309 additions and 6208 deletions

View File

@@ -0,0 +1,80 @@
# Fix SSH Keys by recreating through SSH service
# Run as Administrator on DR VM (10.0.20.37)
$ErrorActionPreference = "Stop"
Write-Host "=== Fix SSH Keys via Service Method ===" -ForegroundColor Cyan
Write-Host ""
# Step 1: Stop SSH service
Write-Host "[1/4] Stopping SSH service..." -ForegroundColor Yellow
Stop-Service sshd
Start-Sleep -Seconds 2
Write-Host " SSH service stopped" -ForegroundColor Green
# Step 2: Delete the problematic file while service is stopped
Write-Host "[2/4] Deleting old authorized_keys file..." -ForegroundColor Yellow
$authKeysFile = "C:\ProgramData\ssh\administrators_authorized_keys"
if (Test-Path $authKeysFile) {
# Try to take ownership first
takeown /F $authKeysFile /A
icacls $authKeysFile /grant Administrators:F
Remove-Item $authKeysFile -Force
Write-Host " Old file deleted" -ForegroundColor Green
} else {
Write-Host " File doesn't exist" -ForegroundColor Gray
}
# Step 3: Create new file with both keys
Write-Host "[3/4] Creating new authorized_keys file..." -ForegroundColor Yellow
$bothKeys = @"
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC88mX/oQnAoU54kazp6iYmmg91IR8pbnYV3aw5aJfSsiSBUjqo+XbvrWRvq//lli48k2kuNfq8olKrPvqKHcIccbcbgFrES5k2ErSyXjvbUlxuyHFRIfBoXvAhMMX6LZR+4Qc0i3VThQ1PgY0tYDbf2XQBAyrog5EU9H/q2NzJEulTs7kSR0FIt1goWXqKJYLA9Pn7Ardt7doPzR8EH/spB8hXctO0BaAorX3p3rd4bvOZoOcht4pTmyJBRzoZRRlscCZRCOxjQDk+y4v9eOPzwMc0dRlVxIbqt8Sua5khGTlmeQTmDqxCmdtgrTNWT4hwPVG1L4Jfw2bgX3IqCGKB4juDUF+Eh6hrQeuTIF7xbCIGGy9N/lKIKO3vr4sTf51gVM9CWJ0bE/CTKbiRPfWbUXIUA4yZ96gJf0QAqcIcutnntomdtkdV8G1RYVKSQEE4oxF3mCRxR+1d5Fn/UXGlms9Q2u/QAq7n5BYLPczUFSkdBdfITOqiCIzlX8WpPD7v/vt8Wsbyf24B/FSYvp+X0AcX5qQbNeljChAxqRy6VNhmh5ucUkMFxfUSTWij+AVqmCPvxVVFKPw32G6jN59BmwirmIxd0i6wTRj3rrUuyO/6+kjErjthkYKFIDBAgdCnV0rrkrPRNKmbS0DtgRcID3ILq2UqR3AYmDf2azf8hQ== mmarius28@gmail.com
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQD3EdHswdNDuDC9kJdUli2zGGPVlEWJjmqtb4eABYWwjQnWqjGp8oAFbQ+r2TxR544WtEyhDL9BU6oO3EFH957DBGQJHJvfRgx2VnkNZEzN/XX/7HK6Cp5rlINGGp26PjHulKkZjARmjC3YK0aUFEkiyNyUBqhtQpmcYP4+wjUfiiO2xUkF9mzGplbWGK3ZmEdkWNd5BNddqxmxyLvd2KHAo8F7Vux9SyPWqZ8bwiDyidAMDU7kCXS/RabUMl2LGajzFbRnR87YA7cIaVFl/IWExO/fsYlgkwmmmIAMdjINp0IWDdydnmG1XNNhM8h/BKY/eK3uile8CvyEbmbuf0+ePm3Ex9vTjn4jYN2vFE148FgQGGTibibJ+sXFoQ87VFNGEuog/V0aajVk/xcOihszsEvzD2IV/tSKJFdI6klnYLuieuMZf7Dvs/6sC1l3dnsBtcpvjnU48altRRZvQzaJf3gIkG1lRGBgyW1n+WHe/7StIveYTVNFtx+fcnqB8gm9fZQxBp2WRbLNFpY/Qj+6BF66b1A2ZxH/3F9Z/6VT91EActOf+AMxjsI+09d7IRYIvzr8OxMPYOHU2bglp3o86xZEMUXfcjB8Sw/8KMsCjBp3ABEN9/bwv1496aw9IC67ZBQ2cDDfgdBej5DAkT4NS2XIx7wbM7sBtLYjcXMi7w== administrator@ROA-CARAPETRU2
"@
# Create the file
$bothKeys | Out-File -FilePath $authKeysFile -Encoding ASCII -NoNewline -Force
# Set permissions using icacls (more reliable than PowerShell ACL)
icacls $authKeysFile /inheritance:r
icacls $authKeysFile /grant "NT AUTHORITY\SYSTEM:(F)"
icacls $authKeysFile /grant "BUILTIN\Administrators:(R)"
Write-Host " New file created with correct permissions" -ForegroundColor Green
# Step 4: Start SSH service
Write-Host "[4/4] Starting SSH service..." -ForegroundColor Yellow
Start-Service sshd
Start-Sleep -Seconds 2
Write-Host " SSH service started" -ForegroundColor Green
# Verification
Write-Host ""
Write-Host "=== Verification ===" -ForegroundColor Cyan
Write-Host ""
Write-Host "File permissions:" -ForegroundColor Yellow
icacls $authKeysFile
Write-Host ""
Write-Host "File content (number of lines):" -ForegroundColor Yellow
$lines = Get-Content $authKeysFile
Write-Host " Total keys: $($lines.Count)" -ForegroundColor White
foreach ($line in $lines) {
if ($line -match "ssh-rsa .+ (.+)$") {
Write-Host "$($matches[1])" -ForegroundColor Green
}
}
Write-Host ""
Write-Host "SSH service status:" -ForegroundColor Yellow
Get-Service sshd | Format-Table Name, Status, StartType -AutoSize
Write-Host ""
Write-Host "=== Setup Complete ===" -ForegroundColor Green
Write-Host ""
Write-Host "Next: Test SSH connection from PRIMARY server" -ForegroundColor Cyan
Write-Host ""