Compare commits

..

2 Commits

Author SHA1 Message Date
Marius
c4504cac70 Oracle DR: Increase recovery area size to 50G
Adjust db_recovery_file_dest_size in auto-generated PFILE:
- Previous: 20G
- New: 50G
- Reason: Provide more space for RMAN restore operations and backups

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2025-10-11 11:06:33 +03:00
Marius
eade344f28 Oracle DR: Auto-create PFILE if missing using tested configuration
Enhancement to rman_restore_from_zero.ps1:
- Auto-generate initROA.ora if not found at service creation
- Uses exact tested configuration from initROA.ora:
  - memory_target=1024M (tested DR VM allocation)
  - _allow_resetlogs_corruption=TRUE (critical for DR restore!)
  - control_files in oradata + recovery_area
  - Standard Oracle 19c parameters for DR environment

Benefits:
- Script is now fully self-sufficient
- No manual PFILE setup required
- DR VM can be restored from completely clean state
- Uses battle-tested configuration

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2025-10-11 11:05:17 +03:00

View File

@@ -91,13 +91,65 @@ if ($service) {
} else {
Write-Host " Oracle service not found, creating from PFILE..."
if (-not (Test-Path "C:\Users\oracle\admin\ROA\pfile\initROA.ora")) {
Write-Host "ERROR: PFILE not found at C:\Users\oracle\admin\ROA\pfile\initROA.ora" -ForegroundColor Red
Write-Host "Cannot create Oracle service without PFILE!"
exit 1
# Check if PFILE exists, create if missing
$pfilePath = "C:\Users\oracle\admin\ROA\pfile\initROA.ora"
if (-not (Test-Path $pfilePath)) {
Write-Host " PFILE not found, creating default initROA.ora..." -ForegroundColor Yellow
# Create directory if needed
$pfileDir = Split-Path $pfilePath -Parent
if (-not (Test-Path $pfileDir)) {
New-Item -ItemType Directory -Path $pfileDir -Force | Out-Null
}
& oradim -new -sid ROA -startmode auto -pfile "C:\Users\oracle\admin\ROA\pfile\initROA.ora" 2>&1 | Out-Null
# Create PFILE with tested configuration
$pfileContent = @"
# Initialization Parameters for ROA Database - DR VM
# Auto-generated by rman_restore_from_zero.ps1 - $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')
# Database Identification
db_name=ROA
db_unique_name=ROA
# Memory Configuration
memory_target=1024M
memory_max_target=1024M
# File Locations
control_files=('C:\Users\oracle\oradata\ROA\control01.ctl', 'C:\Users\oracle\recovery_area\ROA\control02.ctl')
db_recovery_file_dest='C:\Users\oracle\recovery_area'
db_recovery_file_dest_size=50G
audit_file_dest='C:\Users\oracle\admin\ROA\adump'
# Redo and Archive Log
log_archive_format=%t_%s_%r.dbf
# Compatibility
compatible=19.0.0
# Character Set
nls_language=AMERICAN
nls_territory=AMERICA
# Processes and Sessions
processes=300
sessions=472
# Miscellaneous
diagnostic_dest='C:\Users\oracle'
_allow_resetlogs_corruption=TRUE
"@
try {
$pfileContent | Out-File -FilePath $pfilePath -Encoding ASCII -ErrorAction Stop
Write-Host " [OK] Created PFILE: $pfilePath" -ForegroundColor Green
} catch {
Write-Host "ERROR: Failed to create PFILE: $_" -ForegroundColor Red
exit 1
}
}
& oradim -new -sid ROA -startmode auto -pfile $pfilePath 2>&1 | Out-Null
if ($LASTEXITCODE -ne 0) {
Write-Host "ERROR: Failed to create Oracle service" -ForegroundColor Red
exit 1