In B&R version 10 we use this simple script to restore Oracle database from PROD to TEST server with changing DB name and DB files path all was working fine:
Code: Select all
$VeeamUser = "ServiceUser"
$VeeamPassword = "Password" | ConvertTo-SecureString -AsPlainText -Force
$ORA12TSTCreds = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $VeeamUser, $VeeamPassword
$SecurePassword = "Password" | ConvertTo-SecureString -AsPlainText -Force
$RestorePoint = Get-VBRApplicationRestorePoint -Oracle -Name "AIS-ORA12-01" | ?{$_.IsCorrupted -eq $False} | Sort-Object -Property CreationTime -Descending | Select -First 1
$Session = Start-VEORRestoreSession -RestorePoint $RestorePoint[0]
$Database = Get-VEORDatabase -Session $Session[0] -Name "MAINDB.Intourist.local"
$NewDBPath = "D:\WORKCOPYDB\ORADATA\"
$NewDBPathFRA = "D:\WORKCOPYDB\FAST_RECOVERY_AREA\"
$FilesPath = Get-VEORDatabaseFile -Database $Database
$NewFilesPath = $FilesPath.Path -replace "^\w:\\.+\\(\w+\.\w+)","$NewDBPath`$1"
$NewFilesPath = $NewFilesPath -replace ".+\\(CONTROL02.CTL)","$NewDBPathFRA`$1"
Restore-VEORDatabase -Database $Database -Server "AIS-ORA12TST-01" -OracleSid "WORKCOPYDB" -GlobalDatabaseName "WORKCOPYDB.Intourist.local" -OracleHome "C:\Oracle\product\12.1.0\dbhome_1" -OracleHomePassword $SecurePassword -WindowsCredentials $ORA12TSTCreds -File $FilesPath -TargetPath $NewFilesPath -Force
Stop-VEORRestoreSession -Session $Session[0]
It looks kind a bug, in docs this part wasn`t change $NewFilesPath is TypeName: System.String but job tries to recover DB on same paths as PROD server has and because it has disks letters that not available on test server restore ends with error.
Code: Select all
Restore-VEORDatabase : Failed to create folder: u:\. The system cannot find the path specified.
At line:1 char:1
+ Restore-VEORDatabase -Database $Database -Server "AIS-ORA12TST-01" -O ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Restore-VEORDatabase], Exception
+ FullyQualifiedErrorId : System.Exception,Veeam.Oracle.PowerShell.RestoreVEORDatabaseCmdlet
Thank you.