Difference between revisions of "RecoverOracle"

From Tranzman Documentation
Jump to: navigation, search
(Step 4)
 
(27 intermediate revisions by the same user not shown)
Line 1: Line 1:
==='''Step 1'''===
+
The restore of Oracle data can be done from within '''RMAN''' and we restore the backup files from NetBackup to a temporary location on the Oracle server.
  
Set the DBID for the database to be restored.
+
To log in to '''RMAN''', type the command below into a Command Line window.  
  
:'''''SET DBID 1490584423;'''''
+
{| class="wikitable" style="padding-left: 20px; color:#FFFFFF; background-color: black; width: 900px; FONT-FAMILY:monospace,monospace; LINE-HEIGHT:15px; white-space: pre-wrap; "
 +
|
 +
rman target /
 +
|}
 +
As soon as you log in to the database, the DBID currently in use will be displayed.
  
==='''Step 2'''===
+
{| class="wikitable" style="padding-left: 20px; color:#FFFFFF; background-color: black; width: 900px; FONT-FAMILY:monospace,monospace; LINE-HEIGHT:15px; white-space: pre-wrap; "
 +
|
 +
Recovery Manager: Release 11.2.0.1.0 - Production on Fri Nov 9 11:53:46 2018
  
:'''''STARTUP NOMOUNT;'''''
+
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
  
==='''Step 3'''===
+
connected to target database: ORCL (DBID=1490584423)
  
Restore the control file.
+
RMAN>
 +
|}
 +
__NOTOC__
 +
===Step 1===
 +
Login to the NetBackup GUI and navigate to Backup, Archive and Restore.
  
:'''''RESTORE THE CONTROL FILE FROM "C:\Backup\Oracle\C\ProgramData\OmniBack\tmp\ctrl_ORCL_2924.dbf";'''''
+
[[File:BD2-RestoreFiles.jpg]]
  
==='''Step 4'''===
+
==='''Step 2'''===
 +
From Netbackup restore the Oracle backup as files, and then copy them to a temporary location on the Oracle server.
  
Mount the database.
+
[[File:Restore_Oracle_Files.jpg]]
  
:'''''ALTER DATABASE MOUNT;'''''
+
In our example, we have copied them to the location of '''"C:\Backup\Oracle"'''.
  
==='''Step 5'''===
+
==='''Step 3'''===
 +
{| class="wikitable" style="padding-left: 20px; color:#FFFFFF; background-color: black; width: 900px; FONT-FAMILY:monospace,monospace; LINE-HEIGHT:15px; white-space: pre-wrap; "
 +
|
 +
RMAN> STARTUP NOMOUNT;
 +
|}
  
Configure sbt device.
+
==='''Step 4'''===
 +
Restore the control file.
  
:'''''CONFIGURE DEVICE TYPE sbt_tape PARALLELISM 1;'''''
+
{| class="wikitable" style="padding-left: 20px; color:#FFFFFF; background-color: black; width: 900px; FONT-FAMILY:monospace,monospace; LINE-HEIGHT:15px; white-space: pre-wrap; "
:'''''CONFIGURE CHANNEL DEVICE TYPE sbt_tape  PARMS='SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=C:\Backup\new)';'''''
+
|
 +
RMAN> REPLICATE CONTROLFILE FROM "C:\Backup\Oracle\ctrl_ORCL_2924.dbf";
 +
|}
  
==='''Step 6'''===
+
Restore of control file changes the DBID to the target DBID. Run a select DBID from v$database; from SQL to verify that.
  
Catalog the dbf files.
+
==='''Step 5'''===
 +
Mount the database.
  
:'''''catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_10%3A962806106%3A1%3E.dbf';'''''
+
{| class="wikitable" style="padding-left: 20px; color:#FFFFFF; background-color: black; width: 900px; FONT-FAMILY:monospace,monospace; LINE-HEIGHT:15px; white-space: pre-wrap; "
 +
|
 +
RMAN> ALTER DATABASE MOUNT;
 +
|}
  
:'''''catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_11%3A977481621%3A1%3E.dbf';'''''
+
==='''Step 6'''===
 +
Configure sbt device.
  
:'''''catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_12%3A977481656%3A1%3E.dbf';'''''
+
{| class="wikitable" style="padding-left: 20px; color:#FFFFFF; background-color: black; width: 900px; FONT-FAMILY:monospace,monospace; LINE-HEIGHT:15px; white-space: pre-wrap; "
 +
|
 +
RMAN> CONFIGURE DEVICE TYPE sbt_tape PARALLELISM 1;
 +
RMAN> CONFIGURE CHANNEL DEVICE TYPE sbt_tape  PARMS='SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=C:\Backup\Oracle)';
 +
|}
  
:'''''catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_16%3A977491557%3A1%3E.dbf';'''''
+
==='''Step 7'''===
 
+
Catalog each of the dbf files in turn.
:'''''catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_17%3A977491557%3A1%3E.dbf';'''''
 
  
:'''''catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_18%3A977491557%3A1%3E.dbf';'''''
+
{| class="wikitable" style="padding-left: 20px; color:#FFFFFF; background-color: black; width: 900px; FONT-FAMILY:monospace,monospace; LINE-HEIGHT:15px; white-space: pre-wrap; "
 
+
|
:'''''catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_19%3A977491557%3A1%3E.dbf';'''''
+
RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_10%3A962806106%3A1%3E.dbf';
 
+
RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_11%3A977481621%3A1%3E.dbf';
:'''''catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_2%3A962805087%3A1%3E.dbf';'''''
+
RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_12%3A977481656%3A1%3E.dbf';
 
+
RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_16%3A977491557%3A1%3E.dbf';
:'''''catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_20%3A977491575%3A1%3E.dbf';'''''
+
RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_17%3A977491557%3A1%3E.dbf';
 
+
RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_18%3A977491557%3A1%3E.dbf';
:'''''catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_21%3A977491602%3A1%3E.dbf';'''''
+
RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_19%3A977491557%3A1%3E.dbf';
 
+
RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_2%3A962805087%3A1%3E.dbf';
:'''''catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_22%3A977491602%3A1%3E.dbf';'''''
+
RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_20%3A977491575%3A1%3E.dbf';
 
+
RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_21%3A977491602%3A1%3E.dbf';
:'''''catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_23%3A977492038%3A1%3E.dbf';'''''
+
RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_22%3A977491602%3A1%3E.dbf';
 
+
RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_23%3A977492038%3A1%3E.dbf';
:'''''catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_24%3A977492038%3A1%3E.dbf';'''''
+
RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_24%3A977492038%3A1%3E.dbf';
 
+
RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_25%3A977492038%3A1%3E.dbf';
:'''''catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_25%3A977492038%3A1%3E.dbf';'''''
+
RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_26%3A977492046%3A1%3E.dbf';
 
+
RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_27%3A977492058%3A1%3E.dbf';
:'''''catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_26%3A977492046%3A1%3E.dbf';'''''
+
RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_9%3A962806071%3A1%3E.dbf';
 
+
|}
:'''''catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_27%3A977492058%3A1%3E.dbf';'''''
 
 
 
:'''''catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_9%3A962806071%3A1%3E.dbf';'''''
 
 
 
==='''Step 5'''===
 
  
 +
==='''Step 8'''===
 
Do a crosscheck  backup files on disk with entries in the catalog or controlfile.
 
Do a crosscheck  backup files on disk with entries in the catalog or controlfile.
  
:'''''CROSSCHECK BACKUP;'''''
+
{| class="wikitable" style="padding-left: 20px; color:#FFFFFF; background-color: black; width: 900px; FONT-FAMILY:monospace,monospace; LINE-HEIGHT:15px; white-space: pre-wrap; "
 
+
|
==='''Step 6'''===
+
RMAN> CROSSCHECK BACKUP;
 +
|}
  
 +
==='''Step 9'''===
 
Restore the database.
 
Restore the database.
  
:'''''RESTORE DATABASE;'''''
+
{| class="wikitable" style="padding-left: 20px; color:#FFFFFF; background-color: black; width: 900px; FONT-FAMILY:monospace,monospace; LINE-HEIGHT:15px; white-space: pre-wrap; "
 +
|
 +
RMAN> RESTORE DATABASE;
 +
|}
  
==='''Step 7'''===
+
==='''Step 10'''===
 +
Perform this step if redo of all online datafiles needs to be applied.
  
Now recover the database.
+
{| class="wikitable" style="padding-left: 20px; color:#FFFFFF; background-color: black; width: 900px; FONT-FAMILY:monospace,monospace; LINE-HEIGHT:15px; white-space: pre-wrap; "
 +
|
 +
RMAN> RECOVER DATABASE;
 +
|}
  
:'''''RECOVER DATABASE;'''''
+
----
 +
Use this link to go back to the main [[recoverydocs]] Page.

Latest revision as of 10:49, 16 May 2019

The restore of Oracle data can be done from within RMAN and we restore the backup files from NetBackup to a temporary location on the Oracle server.

To log in to RMAN, type the command below into a Command Line window.

rman target /

As soon as you log in to the database, the DBID currently in use will be displayed.

Recovery Manager: Release 11.2.0.1.0 - Production on Fri Nov 9 11:53:46 2018

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

connected to target database: ORCL (DBID=1490584423)

RMAN>

Step 1

Login to the NetBackup GUI and navigate to Backup, Archive and Restore.

BD2-RestoreFiles.jpg

Step 2

From Netbackup restore the Oracle backup as files, and then copy them to a temporary location on the Oracle server.

Restore Oracle Files.jpg

In our example, we have copied them to the location of "C:\Backup\Oracle".

Step 3

RMAN> STARTUP NOMOUNT;

Step 4

Restore the control file.

RMAN> REPLICATE CONTROLFILE FROM "C:\Backup\Oracle\ctrl_ORCL_2924.dbf";

Restore of control file changes the DBID to the target DBID. Run a select DBID from v$database; from SQL to verify that.

Step 5

Mount the database.

RMAN> ALTER DATABASE MOUNT;

Step 6

Configure sbt device.

RMAN> CONFIGURE DEVICE TYPE sbt_tape PARALLELISM 1; RMAN> CONFIGURE CHANNEL DEVICE TYPE sbt_tape PARMS='SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=C:\Backup\Oracle)';

Step 7

Catalog each of the dbf files in turn.

RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_10%3A962806106%3A1%3E.dbf'; RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_11%3A977481621%3A1%3E.dbf'; RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_12%3A977481656%3A1%3E.dbf'; RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_16%3A977491557%3A1%3E.dbf'; RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_17%3A977491557%3A1%3E.dbf'; RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_18%3A977491557%3A1%3E.dbf'; RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_19%3A977491557%3A1%3E.dbf'; RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_2%3A962805087%3A1%3E.dbf'; RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_20%3A977491575%3A1%3E.dbf'; RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_21%3A977491602%3A1%3E.dbf'; RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_22%3A977491602%3A1%3E.dbf'; RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_23%3A977492038%3A1%3E.dbf'; RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_24%3A977492038%3A1%3E.dbf'; RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_25%3A977492038%3A1%3E.dbf'; RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_26%3A977492046%3A1%3E.dbf'; RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_27%3A977492058%3A1%3E.dbf'; RMAN> catalog device type 'SBT_TAPE' backuppiece 'B_ORA_All_Full_BS068%3CORCL_9%3A962806071%3A1%3E.dbf';

Step 8

Do a crosscheck backup files on disk with entries in the catalog or controlfile.

RMAN> CROSSCHECK BACKUP;

Step 9

Restore the database.

RMAN> RESTORE DATABASE;

Step 10

Perform this step if redo of all online datafiles needs to be applied.

RMAN> RECOVER DATABASE;


Use this link to go back to the main recoverydocs Page.