dell-democenter

MODULE 5 - PROTECT & RESTORE ORACLE DATABASE FROM POWERSHELL

LESSON 5 - PERFORM INSTANT RECOVERY USING OIM BACKUP COPY

IMPORTANT ! FOLLLOW THE LAB GUIDE TO PREPARE THE ORACLE Server:

As we are reusing the Production server, we have to Shutdown the Database and remove it from the OraTab:

Identify our Asset

DatabaseName: orcl

$Asset=Get-PPDMassets -type ORACLE_DATABASE -filter 'name eq "orcl"'
$Asset
# Note you can also add the Server name if you have multiple DB Assets with te same Name...
# $Asset=Get-PPDMassets -type ORACLE_DATABASE -filter 'details.database.clusterName eq "oracle01.demo.local" and name eq "orcl"'

Alt text

Credentials

we will need the oracle Credenitials from Lesson 5.1 If you fva enot done, follow te instructions to create Create Oracle Credentials

If you have created the Credentials but the are not scoped to a Variable, do

$OraCreds=Get-PPDMcredentials -filter 'name eq "oracle"'

Get your Asset Copies

To get all Copies of an asset, or use custom filters, use Get-PPDMassetcopies

$Asset | Get-PPDMassetcopies | ft

Alt text

For the latest copy of an asset, use

$copyObject=$Asset | Get-PPDMlatest_copies

Alt text

We need to read our Oracle Host

$OraHost=Get-PPDMhosts -type APP_HOST -filter 'name eq "oracle01.demo.local"'

Run the Restore

$Parameter = @{
    'copyobject'            = $CopyObject 
    'appServerID'           = $Asset.details.database.appServerId 
    'HostID'                = $OraHost.id
    'crossCheckBackup'      = $true
    'OraCredObject'         = $OraCreds
    'targetSid'             = "orcl"
    'targetInstallLocation' = "/opt/oracle/product/18c/dbhomeXE"
}
Restore-PPDMOracle_OIM_copies @Parameter

Alt text

Get the Status of the Activity from Restore

Get-PPDMactivities -PredefinedFilter PROTECTION_JOBS -pageSize 5

Once you identified you activity, do

(Get-PPDMactivities -ID <your activity id> ).steps

Alt text

you may want to repeat the Command or create a loop that monitors the activities ( will be handled in an Advanced Session later)

To view the Restored Copy State (Instant Access Session), do

Get-PPDMexported_copies

Alt text

You can modify the exported copy expiration using

Get-PPDMexported_copies | Set-PPDMexported_copies -days 6

Alt text

Get-PPDMexported_copies | Remove-PPDMexported_copies
Get-PPDMactivities <task from remove job>

Alt text

«Module 5 Lesson 4 This Concludes Module 5 Lesson 5 Module 5 Lesson 3»