Restore-VEORRMANDatabase

In this article

    Short Description

    Restores Oracle databases backed up with the Veeam Plug-in for Oracle RMAN.

    Applies to Veeam Backup & Replication

    Product Edition: Enterprise Plus, Veeam Universal License

    Syntax

    Restore-VEORRMANDatabase -Database <VEORRMANDatabase> [-TargetPath <String[]>] [-TargetFolder <String>] [-File <VEORDatabaseFile[]>] [-UntilSeq <BigInteger>] [-UntilScn <BigInteger>] [-UntilTime <DateTime>] [-ToCurrentPointInTime [<SwitchParameter>]] [-SshPort <Int32>] [-LinuxCredentials <VEORLinuxCredential>] [-OracleHomePassword <SecureString>] [-WindowsCredentials <PSCredential>] [-RestoreAndRecover [<SwitchParameter>]] [-Recover [<SwitchParameter>]] [-Restore [<SwitchParameter>]] [-ChangeDbId [<SwitchParameter>]] [-GlobalDatabaseName <String>] [-OracleHome <String>] [-OracleSid <String>] [-Server <String>] [-ChannelsNumber <Int32>] [-SuppressResetLog [<SwitchParameter>]] [-Force [<SwitchParameter>]] [-ManualChannelsAllocation <SwitchParameter>] [<CommonParameters>]>]

    Detailed Description

    This cmdlet restores Oracle databases backed up with the Veeam Plug-in for Oracle RMAN.

    Parameters

    Parameter

    Description

    Type

    Required

    Position

    Accept Pipeline Input

    Accept Wildcard Characters

    Database

    Specifies an Oracle database. The cmdlet will start a restore of the specified database.

    Accepts the VEORRMANDatabase object. To get this object, run the Get-VEORRMANDatabase cmdlet.

    True

    Named

    False

    False

    Server

    For restore to another location.

    Specifies a target server. The cmdlet will restore an Oracle database to that server.

    Note: You must not provide this parameter if you want to restore to original server.

    String

    False

    Named

    False

    False

    OracleSid

    For restore to another location.

    Specifies a new SID for an Oracle database. The cmdlet will restore the database with the specified SID.

    Note: You must not provide this parameter if you want to restore to original server.

    String

    False

    Named

    False

    False

    OracleHome

    For restore to another location.

    Specifies the target Oracle home path. The cmdlet will restore an Oracle database to the location specified in the Oracle home path.

    Note: You must not provide this parameter if you want to restore to original server.

    String

    False

    Named

    False

    False

    GlobalDatabaseName

    For restore to another location.

    Specifies the global database name. The cmdlet will restore an Oracle database with the specified name.

    Note: You must not provide this parameter if you want to restore to original server.

    String

    False

    Named

    False

    False

    LinuxCredentials

    Specifies credentials that the cmdlet will use to connect to the target Linux server. The cmdlet will restore the database to this server.

    Accepts the VEORLinuxCredential object. To get this object, run the New-VEORLinuxCredential cmdlet.

    False

    Named

    False

    False

    WindowsCredentials

    Specifies Windows credentials. The cmdlet will use these credentials to connect to the target Windows server.

    PSCredential

    False

    Named

    False

    False

    OracleHomePassword

    For restoring Oracle Database 12c or later on Windows server.

    Specifies Oracle home credentials. The cmdlet will use these credentials for starting Oracle Services on the VM guest OS.

    Note: This parameter is required in case you use the following types of Oracle home User:

    • Existing Windows user.
    • New Windows user.

    SecureString

    False

    Named

    False

    False

    Recover

    Defines that the cmdlet will restore Oracle databases to the latest available state.

    SwitchParameter

    False

    Named

    False

    False

    Restore

    Defines that the cmdlet will restore the data files from a specific point-in-time without applying log files.

    SwitchParameter

    False

    Named

    False

    False

    RestoreAndRecover

    Defines that the cmdlet will restore the data files from a specific point-in-time and will apply log files.

    SwitchParameter

    False

    Named

    False

    False

    ToCurrentPointInTime

    Defines that the cmdlet will restore the data from the latest available date.

    SwitchParameter

    False

    Named

    False

    False

    UntilScn

    Specifies the System Change Number (SCN). The cmdlet will restore the database from a consistent point.

    BigInteger

    False

    Named

    False

    False

    UntilSeq

    Specifies the sequence. The cmdlet will restore the database from the specified sequence.

    BigInteger

    False

    Named

    False

    False

    UntilTime

    Specifies the date and time. The cmdlet will restore the database from the specified date and time.

    DateTime

    False

    Named

    False

    False

    ChangeDbId

    For restore to another location.

    Defines that the cmdlet will generate new database ID.

    If you omit this parameter, the database will be restored with the current ID.

    Note: The command will not run if you use this parameter together with the SuppressResetLog parameter.

    SwitchParameter

    False

    Named

    False

    False

    File

    Specifies an array of Oracle database files.

    Accepts the VEORDatabaseFile[] object. To get this object, run the Get-VEORRMANDatabaseFile cmdlet.

    False

    Named

    False

    False

    ChannelsNumber

    Specifies the number of channels to restore Oracle databases.

    Default: Will use the default channel configuration, specified in the Veeam Plug-in for Oracle RMAN settings.

    Int32

    False

    Named

    False

    False

    SuppressResetLog

    Defines that Veeam Plug-in for Orace RMAN will not run the ALTER DATABASE OPEN RESETLOG command after recovery or restore operations.

    Note: You must not provide this parameter if you run the script with the following parameters:

    • OracleHome
    • OracleSid
    • GlobalDatabaseName
    • ChangeDBID

    SwitchParameter

    False

    Named

    False

    False

    SshPort

    Specifies the SSH port. The cmdlet will use this port to connect to the Linux target server.

    Int32

    False

    Named

    False

    False

    TargetPath

    Specifies the target path array. The cmdlet will restore the Oracle database files to the locations, specified in the array.

    Note: For every Oracle database file you must assign the specific file path.

    String[]

    False

    Named

    False

    False

    TargetFolder

    Specifies the target folder. The cmdlet will restore the Oracle database files to the specified folder.

    String

    False

    Named

    False

    False

    Force

    Defines that the cmdlet will overwrite the existing Oracle database with the database from the backup.

    Note: The cmdlet will show no prompt before executing the command.

    SwitchParameter

    False

    Named

    False

    False

    ManualChannelsAllocation

    This parameter is deprecated. Use the ChannelsNumber parameter instead.

    SwitchParameter

    False

    Named

    False

    False

    <CommonParameters>

    This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About Common Parameters section of Microsoft Docs.

    Examples

    Restore-VEORRMANDatabaseExample 1. Restoring Oracle Databases to Another Location

    This example shows how to restore an Oracle database backed up with the Veeam Plug-in for Oracle RMAN to the OracleSrv2049 server with the following setting:

    • The database will be assigned the ORCL Oracle SID.
    • The database will be assigned the orcl global database name.
    • The database will be restored to the E:\app\administrator\product\11.2.0\dbhome_1 Oracle home path.
    • The cmdlet will generate a new database ID.

     

    $backup = Get-VEORRMANBackup -Name "RMAN DB01"

    Start-VEORRMANRestoreSession -Backup $backup

    $session = Get-VEORRMANRestoreSession

    $database =  Get-VEORRMANDatabase -Session $session[0]

    $securepassword = Read-Host -Prompt "Enter password" -AsSecureString

    $credentials = New-VEORLinuxCredential -Account "root" -Password $securepassword

    Restore-VEORRMANDatabase -Database $database -Server "OracleSrv2049" -OracleSid ORCL -OracleHome "E:\app\administrator\product\11.2.0\dbhome_1" -GlobalDatabaseName orcl -ChangeDbId -ToCurrentpointIntime -RestoreAndRecover

    Perform the following steps:

    1. Run the Get-VEORRMANBackup cmdlet. Specify the Name parameter value. Save the result to the $backup variable.
    2. Run the Start-VEORRMANRestoreSession cmdlet. Set the $backup variable as the Backup parameter value.
    3. Run the Get-VEORRMANRestoreSession cmdlet. Save the result to the $session variable.

    The Get-VEORRMANRestoreSession cmdlet will return an array of active restore sessions. Mind the ordinal number of the necessary restore session (in our example, it is the first restore session in the array).

    1. Run the Get-VEORRMANDatabase cmdlet. Set the $session variable as the Session parameter value. Save the result to the $database variable.
    2. Run the Read-Host cmdlet to create a secure password. Enter credentials that will be used to connect to the Veeam Backup & Replication server. Define the AsSecureString parameter. Save the result to the $securepassword variable.
    3. Run the New-VEORLinuxCredential cmdlet. Specify the Account parameter value. Set the $securepassword variable as the Password parameter value. Save the result to the $credentials variable.
    4. Run the Restore-VEORRMANDatabase cmdlet. Specify the following settings:
    • Set the $database variable as the Database parameter value.
    • Specify the Server parameter value.
    • Specify the OracleSid parameter value.
    • Specify the OracleHome parameter value.
    • Specify the GlobalDatabaseName parameter value.
    • Provide the ChangeDbId parameter.
    • Provide the ToCurrentpointIntime parameter.
    • Provide the RestoreAndRecover parameter.

    Restore-VEORRMANDatabaseExample 2. Restoring Oracle Databases to Linux Server From Latest Available State

    This example shows how to restore an Oracle database backed up with the Veeam Plug-in for Oracle RMAN with the following settings:

    • The cmdlet will restore the database from the latest available state.
    • The cmdlet will restore the database to the Linux server.

     

    $backup = Get-VEORRMANBackup -Name "RMAN DB01"

    Start-VEORRMANRestoreSession -backup $backup

    $session = Get-VEORRMANRestoreSession

    $database =  Get-VEORRMANDatabase -Session $session[0]

    $securepassword = Read-Host -Prompt "Enter password" -AsSecureString

    $credentials = New-VEORLinuxCredential -Account "root" -Password $securepassword

    Restore-VEORRMANDatabase -Database $database -LinuxCredentials $credentials -ToCurrentPointInTime -Restore

    Perform the following steps:

    1. Run the Get-VEORRMANBackup cmdlet. Specify the Name parameter value. Save the result to the $backup variable.
    2. Run the Start-VEORRMANRestoreSession cmdlet. Set the $backup variable as the Backup parameter value.
    3. Run the Get-VEORRMANRestoreSession cmdlet. Save the result to the $session variable.

    The Get-VEORRMANRestoreSession cmdlet will return an array of active restore sessions. Mind the ordinal number of the necessary restore session (in our example, it is the first restore session in the array).

    1. Run the Get-VEORRMANDatabase cmdlet. Set the $session variable as the Session parameter value. Save the result to the $database variable.
    2. Run the Read-Host cmdlet to create a secure password. Enter credentials that will be used to connect to the Veeam Backup & Replication server. Define the AsSecureString parameter. Save the result to the $securepassword variable.
    3. Run the New-VEORLinuxCredential cmdlet. Specify the Account parameter value. Set the $securepassword variable as the Password parameter value. Save the result to the $credentials variable.
    4. Run the Restore-VEORRMANDatabase cmdlet. Specify the following settings:
    • Set the $database variable as the Database parameter value.
    • Set the $credentials variable as the LinuxCredentials parameter value.
    • Define the ToCurrentPointInTime and Restore parameters.

    Related Commands

    I want to report a typo

    There is a misspelling right here:

     

    I want to let the Veeam Documentation Team know about that.