Skip to content

Latest commit

 

History

History
83 lines (54 loc) · 2.31 KB

Module_5_3.md

File metadata and controls

83 lines (54 loc) · 2.31 KB

MODULE 5 - PROTECT & RESTORE ORACLE DATABASE FROM POWERSHELL

LESSON 3 - PERFORM CENTRALIZED ORACLE DATABASE RESTORE

IMPORTANT FOLLLOW THE LAB GUIDE TO PREPARE THE ORACLE Server:

  • click on the Royal TS icon located on the Desktop
  • Connect to oracle01.demo.local
  • Double-click on oracle01 to connect to oracle01.demo.local
  • 'su - oracle' to switch to oracle use wirh Password123!
  • 'sqlplus "/as sysdba" and wait for the SQL> prompt
  • select status from v$instance;
  • shutdown immediate;
  • startup nomount;

Identify our Asset

DatabaseName: oracl

$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

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

We need to read our Oracle Host

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

Run the Restore

Restore-PPDMOracle_copies -copyobject $CopyObject -appServerID $Asset.details.database.appServerId -HostID $OraHost.id  -Verbose -crossCheckBackup -OraCredObject $OraCreds

run the restore

Restore-PPDMOracle_copies -copyobject $CopyObject -appServerID $Asset.details.database.appServerId -HostID $OraHost.id -crossCheckBackup -OraCredObject $OraCreds

Get the Status of the Activity from Restore

Get-PPDMactivities -id a03216f0-a833-479f-9aec-1119efe395d0

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)

Get-PPDMactivities -id a03216f0-a833-479f-9aec-1119efe395d0

Alt text

<<Module 5 Lesson 2 This Concludes Module 5 Lesson 3 Module 5 Lesson 4>>