PowerShell script exchange
Post Reply
Alien
Novice
Posts: 3
Liked: never
Joined: Mar 02, 2018 9:57 am
Full Name: Petr Kuncik
Contact:

Oracle DB restore to another server script

Post by Alien »

Hello, we will need restore Oracle DB to another server every day. I created PS script, but I have a proble with one error code. User ct\OracleHome has admin permisson on target server and Oracle services run under this account. Manualy restore from a console works fine.

Code: Select all

asnp veeampssnapin
Connect-VBRServer -server veeam-oracle.ct.czech-tv.cz
$pvproDB = Get-VBRApplicationRestorePoint -Oracle -Name "vmo10.ct.czech-tv.cz" | Sort-Object CreationTime -Descending | Select -First 1
$locations = Get-VBROracleDatabase -ApplicationRestorePoint $pvproDB -Name "PV2PRO"
$guestcreds = Get-VBRCredentials -Name "ct\OracleHome"
Start-VBROracleDatabaseRestore -Database $locations -ServerName "vmo09.ct.czech-tv.cz" -GuestCredentials $guestcreds -OracleCredentials $guestcreds
Error code is

Code: Select all

Start-VBROracleDatabaseRestore : Specify credentials for the Oracle service account CT\OracleHome
At line:1 char:1
+ Start-VBROracleDatabaseRestore -Database $locations -ServerName "vmo0 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Start-VBROracleDatabaseRestore], Exception
    + FullyQualifiedErrorId : System.Exception,Veeam.Backup.PowerShell.Cmdlets.StartVBROracleDatabaseRestore
tdewin
Veeam Software
Posts: 1818
Liked: 655 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: Oracle DB restore to another server script

Post by tdewin »

Not sure of course, but I think you need to supply credentials to login into oracle itself like for example sys (sysdba). So not OS credentials but Oracle authentication

Have you tried restoring via the GUI with the same credentials to see if that works
Alien
Novice
Posts: 3
Liked: never
Joined: Mar 02, 2018 9:57 am
Full Name: Petr Kuncik
Contact:

Re: Oracle DB restore to another server script

Post by Alien »

Hello, script is function. Problem was in account credential. Script is case sensitive and error was in account "ct\OracleHome" where must be "CT\OracleHome". It is a crazy, uffff.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests