Table of Contents
Executive summary............................................................................................................................... 2
Target audience .................................................................................................................................. 2
Overview............................................................................................................................................ 2
Environment Configuration.................................................................................................................... 3
Target System Preparation................................................................................................................. 4
Media export/media import.............................................................................................................. 5
Oracle Recovery Manager Settings........................................................................................................ 8
Control File Autobackup ................................................................................................................... 8
RMAN Recovery Catalog.................................................................................................................. 9
Data Protector Settings ....................................................................................................................... 10
Data Protector-managed Control File backup..................................................................................... 10
Recovery Catalog export................................................................................................................. 11
Restore Scenarios .............................................................................................................................. 11
Procedure Details ........................................................................................................................... 11
Validating RMAN Backups.............................................................................................................. 12
I. Restore with Control File autobackup ON and using Recovery Catalog ......................................... 13
II. Restore without Control File autobackup and using Recovery Catalog ........................................... 16
III. Restore without Control File autobackup and No Recovery Catalog ............................................. 19
Recommendations.............................................................................................................................. 22
Limitations......................................................................................................................................... 22
Summary .......................................................................................................................................... 22
Appendix A: Session Reports .............................................................................................................. 23
Session 1: Control File autobackup on and Recovery Catalog ............................................................. 23
Session 2: Control File autobackup off and Recovery Catalog ............................................................. 27
Session 3: Control File autobackup off and NO Recovery Catalog....................................................... 31
Appendix B: How to restore the DP Managed Control File...................................................................... 34
Appendix C: Sample RMAN script to duplicate the Database ..................................................................... 35
Appendix D: How to import the Recovery Catalog in the new cell ........................................................... 36
Appendix E: Script to restore the SPFILE and Control File providing the Backupset. .................................... 38
Appendix F: Restore scenario: RAC Database to a Single instance .......................................................... 39
Appendix G: Reference documentation ................................................................................................ 41
For more information.......................................................................................................................... 42
HP Data Protector Software
HP Data Protector 6.0 and Oracle 10g Database:
Oracle Database migration to a remote Data Protector cell—Best practices
2
Executive summary
This paper provides in-depth information on how to migrate an Oracle Database from one Data
Protector cell to a different one.
Target audience
This paper is mainly aimed at system integrators and anyone trying to migrate an Oracle Database
using Data Protector. Good understanding of Oracle Recovery Manager (RMAN) and Data Protector
is recommended to follow this white paper.
Overview
The Data Protector Architecture organizes clients in cells. Each cell has its own cell Manager, which is
the central point for managing the whole cell and storing the Data Protector Internal Database (IDB).
In an Enterprise environment with large number of clients dispersed over different geographical areas,
it maybe advisable to split the environment in multiple cells. Listed below are some aspects to be
taken into account when planning your environment:
Geographical location of the clients
Network connections available among the clients
Organizational grouping
For disaster recovery purposes or due to enterprise reorganizations (that is, Data center
consolidations), you may be required to host an application on a different Data Protector cell. On the
other side, backup information for an Oracle Database is stored in the Data Protector IDB and the
Oracle Control files (and Oracle Recovery Catalog, if configured).
While the Data Protector IDB stores media information, devices and channels used, and session
information, the Oracle Control files (and Recovery Catalog) store information about the objects itself,
the Oracle objects are included in every Oracle Backup set and the media contains the Backup set.
When planning to move an Oracle Database to a different Data Protector cell, the backup
information contained in both, the IDB and in the Oracle Control File, is needed to perform a
successful restore. While we can get the IDB information by importing the media in the target cell, we
need to restore the original Oracle Control File to be able to start the restore of the database.
This white paper discusses the fundamentals of Oracle Control Files, Oracle Recovery Catalog, and
Data Protector Media import. Finally, it will also cover different Oracle RMAN configuration scenarios
providing step-by-step guidance.
This paper is not intended to replace the Oracle RMAN documentation nor the Data Protector Oracle
integration documentation, but complement them.
3
Environment Configuration
The environment used for our testing contains two Data Protector cells, (cell 1 and cell 2), each on a
different location (data center A and data center B).
Each cell has its own cell Manager and one Oracle Database server:
Cell 1 (data center A):
Ita017:
(HP-UX) Data Protector cell Manager in cell1.
Oracle Server 10.2.0.3
Recovery Catalog RCVCAT.
Ita022:
(HP-UX) Oracle Server running 10.2.0.3.
Oracle Database DB10g.
Data Protector File Library.
Cell 2 (data center B):
hpu016:
(HP-UX) Data Protector cell Manager in cell2.
Oracle Server 10.2.0.3
Recovery Catalog RCAT
hpu015
(HP-UX) Oracle Server running 10.2.0.3
Data Protector Jukebox.
Note:
hpu015 will host the target database DB10g after the migration.
Originally, only the Oracle Server software is installed on the server.
For the purpose of the testing, we need a database on hpu016 were we
can import the source Recovery Catalog. We could use either an empty
database or an existing Recovery Catalog. If we use an existing Recovery
Catalog, then the source RCVCAT should be imported under a different
user schema than the RCAT owner.
On hpu015 we use a Jukebox to be able to import the media from the File
Library. See the Media export/import section for more information
The distance and network connection between both data centers plays only a role in case we decide to
copy the media from the file library over the network link. While it maybe feasible for small databases,
it is not an option for larger ones. In such cases, the media should be shipped to the target data center.
4
Figure 1. Test Environment
As mentioned in the opening summary, there maybe different reasons why we need to move a database
to a different data center, different cell, and different location. We mention below the two key ones:
Data center consolidation
Disaster Recovery Plan (DRP)
In a data center consolidation scenario, normally downtime and migration time has been agreed
ahead. In case of a disaster, all preparation steps for the DRP need to be done ahead.
Moreover, as the target database, cell and even data center may have been lost, we need to rely on
our existing backups and our target system for the recovery. For this reason, a DRP scenario may
require some more configuration steps.
Target System Preparation
The following subsections list a number of preparation steps that should to be filled up before starting
with the migration procedure. These steps are to be followed on the target system.
In case of a Disaster Recovery scenario, it is highly advised to have these steps done in advance.
Install the Oracle Software on the target System
While it is not necessary, it is recommended to install the Oracle software under the same path and
the same Operating system user and group.
Use the same Operating System user for the oracle software installation
Install the Oracle Server Release on same location
Apply the same Patch set level and patches as on the original system
Prepare the oracle user environment (profile and needed environment variables)
5
Create the needed directories and password file
Since we are not installing the database on the target server but performing a migration, we have
to create the required directories manually before we mount the database. The following figure
shows a listing:
Figure 2: Needed Oracle directories on the target system
oracle@hpu015[DB10g]:/opt/oracle/admin/DB10g$ ll
total 176
drwxrwxrwx 2 oracle dba 16384 May 14 10:53 adump
drwxrwxrwx 2 oracle dba 57344 May 26 07:30 bdump
drwxrwxrwx 2 oracle dba 96 Mar 13 12:23 cdump
drwxrwxrwx 2 oracle dba 16384 May 14 10:53 udump
The Oracle password file can be created using the orapwd Oracle utility. The new created file has to
be located under $ORACLE_HOME/dbs (on UNIX platforms)
Windows platforms:
Oracle password location is $ORACLE_HOME/database. Moreover, a service has to be created for
the instance using the ORADIM Oracle utility. See Oracle documentation for more information.
Create listener configuration
Using the oracle utilities Network Configuration Assistant (netca) or Network Manager (netmgr),
create the listener configuration and required tnsnames.ora entries.
Media export/media import
Transferring the media from data center A to data center B can be the most challenging part of the
migration. While the export and import of the required media should not cause any major issues, the
shipping of the physical media devices to the target location is normally the most time-consuming
action of the whole process.
Note:
At this point, we assume a Full Backup (Database and Archive logs) has
been taken successfully. This makes the migration easier as only one set of
tapes needs to be located and there is no need to search for incremental
backups.
We describe below two different scenarios, one using a SAN-attached tape library and the other one
a file library.
For both cases, tape library and file library, the main difference is the copying/moving and importing
of the media on the target cell manager.
1. Find out which tapes were used in the backup session.
You can use any one of the following three methods:
a. Data Protector GUI:
i. Internal Database Æ Sessions Æ Select a Session Æ Properties Æ Media TAB
ii. The following figure shows the media label and medium ID.
6
Figure 3. Media labels and medium ID
b. Data Protector CLI:
i. Select the backup session and execute the following command:
omnidb –session SESSION_ID -media
oracle@ita022[DB10g]:/opt/oracle $ omnidb -session 2008/05/26-5 -media
Medium Label Medium ID Free Blocks
==========================================================================
ita022_file_lib_MediaPool_37 10394b75:483aad2a:5c7d:0073 52428800
ita022_file_lib_MediaPool_38 10394b75:483aad2a:5c7d:0074 52428800
ita022_file_lib_MediaPool_39 10394b75:483aad2a:5c7d:0075 52428800
ita022_file_lib_MediaPool_40 10394b75:483aad89:5c7d:0078 52428800
c. Oracle RMAN
i. Connected to the target database and recovery catalog
ii. List the full backups of the database in a specific time window
iii. List the backupsets containing your backup to the get the medium ID.
RMAN> list backup of database completed after 'SYSDATE -1 ';
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
43875 Incr 0 239.25M SBT_TAPE 00:00:30 2008-05-26
BP Key: 43879 Status: AVAILABLE Compressed: NO Tag: TAG20080526T142913
Handle: DB10g_online_FL<DB10g_196:655741754:1>.dbf Media:
List of Datafiles in backup set 43875
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
2 0 Incr 8387511 2008-05-26 /opt/oracle/oradata/DB10g/undotbs01.dbf
5 0 Incr 8387511 2008-05-26 /opt/oracle/oradata/DB10g/example01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
43876 Incr 0 339.75M SBT_TAPE 00:00:38 2008-05-26
BP Key: 43880 Status: AVAILABLE Compressed: NO Tag: TAG20080526T142913
Handle: DB10g_online_FL<DB10g_195:655741753:1>.dbf Media:
List of Datafiles in backup set 43876
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
3 0 Incr 8387510 2008-05-26 /opt/oracle/oradata/DB10g/sysaux01.dbf
4 0 Incr 8387510 2008-05-26 /opt/oracle/oradata/DB10g/users01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
43877 Incr 0 369.50M SBT_TAPE 00:00:39 2008-05-26
BP Key: 43881 Status: AVAILABLE Compressed: NO Tag: TAG20080526T142913
7
Handle: DB10g_online_FL<DB10g_194:655741753:1>.dbf Media:
List of Datafiles in backup set 43877
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
1 0 Incr 8387509 2008-05-26 /opt/oracle/oradata/DB10g/system01.dbf
RMAN> list backupset 43877 ; (#repeat for every backupset you need#)
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
43877 Incr 0 369.50M SBT_TAPE 00:00:39 2008-05-26
BP Key: 43881 Status: AVAILABLE Compressed: NO Tag: TAG20080526T142913
Handle: DB10g_online_FL<DB10g_194:655741753:1>.dbf Media:
10394b75:483aad2a:5c7d:0075[ita022_file_lib_MediaPool_39]
List of Datafiles in backup set 43877
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
1 0 Incr 8387509 2008-05-26 /opt/oracle/oradata/DB10g/system01.dbf
RMAN>
Important Note
In case of object copies or device mirroring, RMAN will always store the media ID that belongs to the
original tape. RMAN is not aware of object copies. If the original media expired or was exported, it
does not exist in the IDB anymore, but only the COPY. In this case, the Media ID shown by RMAN
may refer to an empty tape or to a tape that contains other backup.
2. Export media
a. A media export, removes the information about the media and its content from the Internal
Data Protector Database. However, its content remains intact.
b. Before been able to export a media, the media protection has to be removed by recycling
the media.
c. The media export has to be done for all media used in the Backup.
Note:
It is not strictly necessary to export the media on the Source cell Manager.
While this step can be done in a data center Consolidation scenario, it
obviously cannot be performed in a Disaster Recovery, when the Source
cell Manager is not available.
3. Make the media available to target cell manager.
In our testing, we used a tape-based library and a disk-based library:
a. Tape Library: The tape or tapes used for the backup need to be inserted in the target
library slots
b. File Library: If a File Library was used for the backups:
i. Create a directory on the target system (our case hpu015) to allocate the file
library files (for example, /dp_jukebox)
ii. Copy/Transfer the file depots from the source system to the target one, under the
new created directory
Note
Exported file library media can only be imported into a Jukebox. This is a
DP limitation
8
Figure 4. Jukebox configuration on hpu015
iii. Add a device type Jukebox on the target system.
iv. ADD the files in the repository window
4. Import the media into the target cell.
An import will re-read all the backup session information in the media into the internal database.
a. Scan the devices and import all media
b. Verify after the import that you can see the session imported in the Internal Database.
Oracle Recovery Manager Settings
Control File Autobackup
Oracle Control Files backup should be a key element of every Oracle backup procedure. Starting
with Oracle 9i, Oracle introduced the Control File Autobackup functionality.
Among other things, it enables to restore the Control File from a backup, although your current
SPFILE Control File and recovery catalog are not available.
Every time the Control File autobackup is performed, it will be logged in the instance alert log file:
Figure 5: Alert log entry for the control file autobackup. Below the explanation for the red boxes
Starting control autobackup
Tue May 6 15:00:39 2008
Control autobackup written to SBT_TAPE device
comment 'API Version 2.0,MMS Version 65.6.0.0',
media '10394b75:48205542:5c7d:0053[ita022_file_lib_MediaPool_27]' (1)
handle 'c-38758237-20080506-01'
(2) (3)
From in the above figure, we can gather the following information:
1. Data Protector media ID and media label
2. Database DBID
3. Data Protector Session ID (Backup Date - Session number)
9
As the Control File autobackup is stored in a well-known format and path, it can be restored with the
following command:
RMAN> restore controlfile from autobackup;
While Oracle’s recommendation is to have autobackup Control File set to ON, the default is
currently set to OFF.
You can verify the current settings with the following RMAN command:
RMAN> show all;
To enable autobackup Control File, using RMAN, connect to the target database and recovery
catalog (if used) and execute the following command:
RMAN> configure controlfile autobackup on;
Note:
Unless you have an explicit reason not to do it, set controlfile
autobackup always to ON. It will definitely ease your restores.
In case controlfile autobackup if OFF (default), RMAN will backup
the Control File and SPFILE if the backup statement includes the system
tablespace.
RMAN Recovery Catalog
The Recovery Catalog is a set of tables and views working as a repository for RMAN to store its data.
While it is optional to use it, it is highly recommended to do it.
One of the main advantages using a Recovery Catalog in a Disaster Recovery is that, in case we
have lost our control files, the Recovery Catalog will provide you the needed information to perform
the restore.
Using the RMAN Recovery Catalog does not replace the usage of the control file autobackup, but it
complements it.
As we will see in the following scenarios, once we have lost the Control File, if we have the recovery
catalog available, we can perform the control file restore without further issues.
How to determine the Database DBID
In disaster situations where the restore of the Oracle SPFILE and/or Control Files is required, we need
to provide the DBID of the Database we want to restore. Depending on the recovery scenario, there
are different ways to find out the DBID:
1. Check the Data Protector Backup Session report of the Oracle Database, it should be displayed
there:
[Normal] From: ob2rman@ita022 "DB10g" Time: 05/08/08 08:38:58
Starting backup of target database.
Net service name: DB10g.
Instance status: OPEN.
Instance name: DB10g.
Database DBID = 38758237.
Database control file type: CURRENT
10
2. the Recovery Catalog (if available); connect to the recovery catalog database with the RMAN
user:
oracle@ita022[DB10g]:/home/oracle$ sqlplus rman/xxx@rcvcat
SQL*Plus: Release 10.2.0.3.0 - Production on Wed May 21 14:28:20 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from rc_database ;
DB_KEY DBINC_KEY DBID NAME RESETLOGS_CHANGE# RESETLOGS
---------- ---------- ---------- -------- ----------------- ---------
1 2 2216826430 RAC 547422 25-JUL-07
41601 41602 38758237 DB10G 3181685 17-MAR-08
Data Protector Settings
Data Protector-managed Control File backup
If enabled (default), Data Protector performs a Control File backup at the end of every Oracle backup
session. This is a file system backup and no RMAN is used for it.
Figure 6. DP Managed Control File Backup
root@ita022:/.root# omnidb -session 2008/05/26-5
Object Name Object Type Object Status CopyID
===============================================================================
ita022:DB10g_online_FL<DB10g_196:655741754:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_195:655741753:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_194:655741753:1>.dbf Oracle8 Completed
ita022:c-38758237-20080526-00 Oracle8 Completed 148 (O)
ita022:DB10g_online_FL<DB10g_198:655741857:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_199:655741857:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_200:655741857:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_201:655741857:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_202:655742056:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_203:655742078:1>.dbf Oracle8 Completed
ita022:c-38758237-20080526-01 Oracle8 Completed 141 (O)
ita022:DB10g DP Managed Control File Oracle8 Completed 91 (O)
ita022:Oracle Recovery Backup Catalog Oracle8 Completed 95 (O)
The restore of the DP-managed Control File can be done through the Data Protector GUI. See the Data
Protector Integration guide for Oracle for more information.
11
Recovery Catalog export
As for the Oracle Control File, Data Protector performs a backup of the Oracle Recovery Catalog at
the end of every Oracle backup session by default. This functionality can be disabled in the
Application Specific Options window, inside the Oracle backup specification.
First, the Oracle Recovery Catalog is exported to the file system and then, by means of a file system
backup, copied to the target device.
For restore purposes, the DP GUI and the CLI can be used. Both are documented in the Oracle
Integration Manual.
See Appendix D for more information on how to import the Recovery Catalog on the target system.
Restore Scenarios
Procedure Details
This section gives a step-by-step description of performing a restore and recovery of the Oracle
database on the target system. We cover the procedure for three different scenarios:
1. Control File autobackup and Recovery Catalog are used
2. Recovery Catalog is used but no Control File autobackup
3. No Control File autobackup nor Recovery Catalog are used
We assume the following for all three scenarios:
A full online backup (plus archive logs) from the DB10g database on ita022 was taken successfully
The original tapes/media have already been imported into the target cell manager
The source data center is not available
The target system preparation has already been performed
The RCVCAT recovery catalog, if used, has been imported in the target environment (RCAT)
The DBID of the database to be restored is known. (Refer to the Appendix for more information.)
The ORACLE_SID is set in the user environment
Within the RMAN configuration, SBT_TAPE is set to default TYPE.
In the following scripts, no channel allocation command is used. The reason is, in the default RMAN
configuration, SBT_TAPE is configured as the default type, thus, RMAN will allocate, if needed, TAPE
channels in the scripts.
To activate it, (default TYPE is DISK), connect in RMAN to your target database (and Recovery
Catalog if used) and issue the command:
RMAN> CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
There is no need to set any OB2BARTYPE, OB2APPNAME, nor OB2BARLIST variables to be able to
perform the restore.
For all cases, we will follow the next restore and recovery sequence:
1. Connect to the Recovery Catalog using RMAN
2. Set the DBID
3. Startup nomount: as no SPFILE is available at this time, Oracle will startup the
instance with a default SPFILE
4. Restore the SPFILE from the backup.
12
5. Startup nomount force: at this point, we want to have the instance running with the previously
restored SPFILE. If you wish, you could also specify the SPFILE location in the startup
command.
6. Restore the control files using RMAN
7. Mount the database: using the previously restored control files.
8. Query the control files for available backup information; decide on the Point In Time Recovery
9. Restore and Recover the database until the Point in Time (PITR)
10. Open the database with the Reset logs option
Important Note:
When performing a SPFILE or Control File restore from autobackup, in
cases where the search of the backup set seems to take longer than
expected, it is recommended to use the following omnirc variable on the
server performing the restore:
OB2RETRYCOUNT=1
This variable reduces the loop iterations when searching for the
autobackup.
All sessions reports are in the Appendix fully listed
Validating RMAN Backups
Oracle RMAN offers two powerful commands to help us detecting physical block corruption on
our backups:
BACKUP […] VALIDATE
RMAN will read the specified datafiles and ensure there is no corruption
RESTORE […] VALIDATE
As for the Backup validate, RMAN will read the content of the backup (from disk or tape) and verify
there is no corruption.
It is also a method to verify the backup performance in our environment. While a backup validate will
read the blocks into memory, it will not write the Backupset to disk or tape. This can help us to
compare the time with a streaming backup to tape and verify where the time is spent.
When planning a restore of your database, remember to include a RESTORE VALIDATE in your
restore procedure. This way, you can verify in advance, if the media to be shipped/copied is valid
Under some circumstances, it may happen that your backup data on tape or disk is corrupted. This
can be caused by bad tape library firmware, network/SAN issues or even defect tapes. It is very
uncommon but possible.
During backup, RMAN cannot verify the integrity of every single block written to the backup device. Thus,
it may happen that an RMAN successful backup is not usable as one or more data blocks are corrupt.
In this case, the RESTORE VALIDATE option may help you identify the usability of the backup before
performing the actual restore.
13
I. Restore with Control File autobackup ON and using Recovery
Catalog
In this case, when the backup was taken, Control File autobackup was enabled, and the Recovery
Catalog was used.
First, we start RMAN and connect to the RCAT recovery catalog on cell 2. Note that we do not
connect to target yet.
Next, we set the database DBID (which is known in the recovery catalog) and then we can connect to
the target.
oracle@hpu015[DB10g]:/opt/oracle$ rman catalog rman/xxx@rcat
Recovery Manager: Release 10.2.0.3.0 - Production on Wed May 7 08:27:15 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to recovery catalog database
RMAN> set dbid=38758237 ;
executing command: SET DBID
database name is "DB10G" and DBID is 38758237
RMAN> connect target /
connected to target database (not started)
As no SPFILE is available yet, Oracle will be started with a default SPFILE.
Once the instance is in NOMOUNT status, we can start the restore of the SPFILE from autobackup.
Notice that if nothing is specified, RMAN looks for the autobackup starting in the current day.
RMAN> startup nomount;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/opt/oracle/product/10.2.0/db_1/dbs/initDB10g.ora'
starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started
Total System Global Area 159383552 bytes
Fixed Size 2056752 bytes
Variable Size 67112400 bytes
Database Buffers 88080384 bytes
Redo Buffers 2134016 bytes
RMAN>
RMAN> run {
restore spfile from autobackup;
}
Starting restore at 2008-05-07
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=36 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protector A.06.00/PHSS_37147/PHSS_37148/DPSOL_00306/DPLNX_
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=35 devtype=DISK
channel ORA_SBT_TAPE_1: looking for autobackup on day: 20080507
channel ORA_SBT_TAPE_1: looking for autobackup on day: 20080506
channel ORA_DISK_1: looking for autobackup on day: 20080507
channel ORA_DISK_1: looking for autobackup on day: 20080506
channel ORA_DISK_1: skipped, autobackup already found
channel ORA_SBT_TAPE_1: autobackup found: c-38758237-20080506-01
[Normal] From: [email protected] "" Time: 05/07/08 09:42:59
Starting OB2BAR Restore: ita022:c-38758237-20080506-01 "Oracle8"
14
[Normal] From: [email protected] "" Time: 05/07/08 09:43:00
Completed OB2BAR Restore: ita022:c-38758237-20080506-01 "Oracle8"
channel ORA_SBT_TAPE_1: SPFILE restore from autobackup complete
Finished restore at 2008-05-07
Once the SPFILE is restored, we decide to restart the instance with the restored SPFILE and not
leave it running with the default one.
Note:
The startup nomount force command is equivalent to first shutdown
abort the instance and then startup nomount
The same is done for the Control File autobackup restore. Note that, when the restore is finished, the
Control File is copied to the location specified in the SPFILE.
With the Control File in place, we can now mount the database.
RMAN> startup nomount force;
Oracle instance started
Total System Global Area 314572800 bytes
Fixed Size 2057944 bytes
Variable Size 100665640 bytes
Database Buffers 209715200 bytes
Redo Buffers 2134016 bytes
RMAN> run {
restore controlfile from autobackup;
}
Starting restore at 2008-05-07
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=101 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protector A.06.00/PHSS_37147/PHSS_37148/DPSOL_00306/DPLNX_
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=100 devtype=DISK
channel ORA_SBT_TAPE_1: looking for autobackup on day: 20080507
channel ORA_SBT_TAPE_1: looking for autobackup on day: 20080506
channel ORA_DISK_1: looking for autobackup on day: 20080507
channel ORA_DISK_1: looking for autobackup on day: 20080506
channel ORA_DISK_1: skipped, autobackup already found
channel ORA_SBT_TAPE_1: autobackup found: c-38758237-20080506-01
[Normal] From: [email protected] "DB10g" Time: 05/07/08 09:50:33
Starting OB2BAR Restore: ita022:c-38758237-20080506-01 "Oracle8"
[Normal] From: [email protected] "DB10g" Time: 05/07/08 09:50:36
Completed OB2BAR Restore: ita022:c-38758237-20080506-01 "Oracle8"
channel ORA_SBT_TAPE_1: control file restore from autobackup complete
output filename=/opt/oracle/oradata/DB10g/control01.ctl
output filename=/opt/oracle/oradata/DB10g/control02.ctl
output filename=/opt/oracle/oradata/DB10g/control03.ctl
Finished restore at 2008-05-07
RMAN>
RMAN> startup mount;
database is already started
database mounted
released channel: ORA_SBT_TAPE_1
released channel: ORA_DISK_1
15
At this point, we have a mounted database.
To move forward first we need to decide, from the available backups, which backup to use for our restore.
In case the number of backups is large, we can just list the backups between two specified dates.
Below we can see the different backup sets available between today and yesterday. It can seen that
all tags are the same (they belong to the same backup)
RMAN> list backup of database completed between 'SYSDATE -1' and 'SYSDATE' ;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
38975 Incr 0 191.50M SBT_TAPE 00:00:29 2008-05-06
BP Key: 38979 Status: AVAILABLE Compressed: NO Tag: TAG20080506T145513
Handle: DB10g_online_FL<DB10g_159:654015314:1>.dbf Media:
List of Datafiles in backup set 38975
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
2 0 Incr 7375108 2008-05-06 /opt/oracle/oradata/DB10g/undotbs01.dbf
5 0 Incr 7375108 2008-05-06 /opt/oracle/oradata/DB10g/example01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
38976 Incr 0 335.50M SBT_TAPE 00:00:36 2008-05-06
BP Key: 38980 Status: AVAILABLE Compressed: NO Tag: TAG20080506T145513
Handle: DB10g_online_FL<DB10g_158:654015314:1>.dbf Media:
List of Datafiles in backup set 38976
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
3 0 Incr 7375107 2008-05-06 /opt/oracle/oradata/DB10g/sysaux01.dbf
4 0 Incr 7375107 2008-05-06 /opt/oracle/oradata/DB10g/users01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
38977 Incr 0 369.50M SBT_TAPE 00:00:38 2008-05-06
BP Key: 38981 Status: AVAILABLE Compressed: NO Tag: TAG20080506T145513
Handle: DB10g_online_FL<DB10g_157:654015313:1>.dbf Media:
List of Datafiles in backup set 38977
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
1 0 Incr 7375106 2008-05-06 /opt/oracle/oradata/DB10g/system01.dbf
Next, we look for the archive logs available after the backup. It can be easily done with
the following command:
RMAN> list backup of archivelog from scn=7375106 ;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
39019 1.53G SBT_TAPE 00:02:40 2008-05-06
BP Key: 39025 Status: AVAILABLE Compressed: NO Tag: TAG20080506T145657
Handle: DB10g_online_FL<DB10g_164:654015418:1>.dbf Media:
10394b75:482055a3:5c7d:0057[ita022_file_lib_MediaPool_29]
List of Archived Logs in backup set 39019
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ---------- ---------- ---------
1 96 7347881 2008-05-06 7375215 2008-05-06
1 97 7375215 2008-05-06 7375238 2008-05-06
Finally, we can create our restore and recovery RMAN script, specifying the point in time to recover.
Note that, as sequence, we specify the last archived log available in the backup, plus one. (If we
want to recover up to sequence 97, inclusive, we need to specify the value 98 in the until sequence
statement; the restore and recovery will be executed until the value 98, not included.)
The full session report can be found in the Appendix A.
16
RMAN> run {
set until sequence = 98 thread 1;
restore database;
recover database;
alter database open resetlogs;
}
Once the recovery is finished, the Database will be opened and ready to be used.
II. Restore without Control File autobackup and using Recovery
Catalog
In this case, when the backup was taken, the Control File autobackup was disabled but the Recovery
Catalog was used. While it is very similar to the previous session, no restore from autobackup is possible.
However, as the recovery catalog is available, RMAN has the information about the backupset and
Data Protector media where the last SPFILE and Control File backups are stored.
Remember, if Control File autobackup is OFF, the SPFILE and Control File will backed up every time
the system tablespace is part of the backup.
oracle@hpu015[DB10g]:/home/oracle$ rman catalog rman/xxx@rcat
Recovery Manager: Release 10.2.0.3.0 - Production on Wed May 7 13:18:58 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to recovery catalog database
RMAN> set dbid=38758237 ;
executing command: SET DBID
database name is "DB10G" and DBID is 38758237
RMAN> connect target / ;
connected to target database (not started)
RMAN> startup nomount;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/opt/oracle/product/10.2.0/db_1/dbs/initDB10g.ora'
starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started
Total System Global Area 159383552 bytes
Fixed Size 2056752 bytes
Variable Size 67112400 bytes
Database Buffers 88080384 bytes
Redo Buffers 2134016 bytes
RMAN> restore spfile;
Starting restore at 2008-05-07
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=36 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protector A.06.00/PHSS_37147/PHSS_37148/DPSOL_00306/DPLNX_
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=35 devtype=DISK
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: restoring SPFILE
output filename=/opt/oracle/product/10.2.0/db_1/dbs/spfileDB10g.ora
channel ORA_SBT_TAPE_1: reading from backup piece DB10g_online_FL<DB10g_174:654105081:1>.dbf
[Normal] From: [email protected] "DB10g" Time: 05/07/08 13:20:27
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_174:654105081:1>.dbf "Oracle8"
[Normal] From: [email protected] "DB10g" Time: 05/07/08 13:20:30
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_174:654105081:1>.dbf
"Oracle8"
17
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=DB10g_online_FL<DB10g_174:654105081:1>.dbf tag=TAG20080507T155104
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:45
Finished restore at 2008-05-07
RMAN>
RMAN> startup nomount force;
Oracle instance started
Total System Global Area 314572800 bytes
Fixed Size 2057944 bytes
Variable Size 100665640 bytes
Database Buffers 209715200 bytes
Redo Buffers 2134016 bytes
As before, we can now proceed with the Control File restore and mount the database:
RMAN> restore controlfile;
Starting restore at 2008-05-07
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=101 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protector A.06.00/PHSS_37147/PHSS_37148/DPSOL_00306/DPLNX_
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=100 devtype=DISK
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: restoring control file
channel ORA_SBT_TAPE_1: reading from backup piece DB10g_online_FL<DB10g_180:654105439:1>.dbf
[Normal] From: [email protected] "DB10g" Time: 05/07/08 13:23:07
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_180:654105439:1>.dbf "Oracle8"
[Normal] From: [email protected] "DB10g" Time: 05/07/08 13:23:09
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_180:654105439:1>.dbf
"Oracle8"
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=DB10g_online_FL<DB10g_180:654105439:1>.dbf tag=TAG20080507T155719
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:45
output filename=/opt/oracle/oradata/DB10g/control01.ctl
output filename=/opt/oracle/oradata/DB10g/control02.ctl
output filename=/opt/oracle/oradata/DB10g/control03.ctl
Finished restore at 2008-05-07
RMAN> startup mount;
database is already started
database mounted
released channel: ORA_SBT_TAPE_1
released channel: ORA_DISK_1
In this case, we can see that more than one backup is available in the period listed:
RMAN> list backup of database completed after 'SYSDATE';
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
40321 Incr 0 896.50M SBT_TAPE 00:00:46 2008-05-07
BP Key: 40325 Status: AVAILABLE Compressed: NO Tag: TAG20080507T154635
Handle: DB10g_online_FL<DB10g_167:654104795:1>.dbf Media:
List of Datafiles in backup set 40321
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
1 0 Incr 7463277 2008-05-07 /opt/oracle/oradata/DB10g/system01.dbf
2 0 Incr 7463277 2008-05-07 /opt/oracle/oradata/DB10g/undotbs01.dbf
3 0 Incr 7463277 2008-05-07 /opt/oracle/oradata/DB10g/sysaux01.dbf
4 0 Incr 7463277 2008-05-07 /opt/oracle/oradata/DB10g/users01.dbf
5 0 Incr 7463277 2008-05-07 /opt/oracle/oradata/DB10g/example01.dbf
18
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
40354 Incr 0 191.50M SBT_TAPE 00:00:43 2008-05-07
BP Key: 40361 Status: AVAILABLE Compressed: NO Tag: TAG20080507T155104
Handle: DB10g_online_FL<DB10g_172:654105065:1>.dbf Media:
List of Datafiles in backup set 40354
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
2 0 Incr 7463627 2008-05-07 /opt/oracle/oradata/DB10g/undotbs01.dbf
5 0 Incr 7463627 2008-05-07 /opt/oracle/oradata/DB10g/example01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
40355 Incr 0 369.50M SBT_TAPE 00:00:45 2008-05-07
BP Key: 40362 Status: AVAILABLE Compressed: NO Tag: TAG20080507T155104
Handle: DB10g_online_FL<DB10g_170:654105065:1>.dbf Media:
List of Datafiles in backup set 40355
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
1 0 Incr 7463625 2008-05-07 /opt/oracle/oradata/DB10g/system01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
40356 Incr 0 335.75M SBT_TAPE 00:00:50 2008-05-07
BP Key: 40363 Status: AVAILABLE Compressed: NO Tag: TAG20080507T155104
Handle: DB10g_online_FL<DB10g_171:654105065:1>.dbf Media:
List of Datafiles in backup set 40356
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
3 0 Incr 7463626 2008-05-07 /opt/oracle/oradata/DB10g/sysaux01.dbf
4 0 Incr 7463626 2008-05-07 /opt/oracle/oradata/DB10g/users01.dbf
RMAN> list backup of archivelog from scn=7463625;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
40387 256.00K SBT_TAPE 00:00:04 2008-05-07
BP Key: 40394 Status: AVAILABLE Compressed: NO Tag: TAG20080507T155201
Handle: DB10g_online_FL<DB10g_179:654105279:1>.dbf Media:
10394b75:4821b3d4:5c7d:005f[ita022_file_lib_MediaPool_31]
List of Archived Logs in backup set 40387
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ---------- ---------- ---------
1 102 7463712 2008-05-07 7463723 2008-05-07
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
40388 1.59G SBT_TAPE 00:04:58 2008-05-07
BP Key: 40395 Status: AVAILABLE Compressed: NO Tag: TAG20080507T155201
Handle: DB10g_online_FL<DB10g_178:654105122:1>.dbf Media:
10394b75:4821b3d4:5c7d:0060[ita022_file_lib_MediaPool_32]
List of Archived Logs in backup set 40388
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ---------- ---------- ---------
1 101 7463367 2008-05-07 7463712 2008-05-07
19
As the last available archived log is the one with sequence 102, we perform our incomplete recovery
until sequence 103:
RMAN> run {
set until sequence = 103 ;
restore database ;
recover database ;
alter database open resetlogs;
}
III. Restore without Control File autobackup and No Recovery Catalog
In this case, we do not have a recovery catalog or Control File autobackup specified. This means,
RMAN has no information about where the Control File backup is located. It is not even aware if
there is even a backup of the Control File.
We also assume, no Data Protector managed Control File was taken. There is also no backup of the
Recovery Catalog available. This is one of the worst and recovery scenarios you can think about.
In this case, we need to proceed with a different approach:
Instead of relying on Oracle’s RMAN for locating the Control File backup, we need to provide RMAN
with the Backup Set holding the backup of the Control File.
As our data center A is not available, there is no way to access the Backup Session of the source
database. This would have provided us with the Backup set information where the Control File is
stored.
However, it should be relatively easy to find the session containing the Oracle Database backup from
ita022 as no more backups for this host should be available on this cell. Moreover, the Session ID of
the imported backup can also be retrieved from the Media Import Session.
We start querying the Data Protector Internal Database (IDB) for the session we just imported. There
are different ways to query the IDB to find out the session. Two of them are listed below:
Get a list of the sessions in the IDB and filter them with the source hostname
Query the IDB for backup sessions on a specific day. In our example, it just returns one.
hpu015:[/.root]# omnidb -session | grep ita022
2008/05/08-3 Backup Completed oracle.dba@ita022
hpu015:[/.root]# omnidb -session -type backup -since 2008/05/08 -detail
SessionID : 2008/05/08-3
Backup Specification: Oracle8 DB10g_online_FL
Session type : Backup (full)
Started : Thu May 8 05:39:18 2008
Finished : Thu May 8 05:43:24 2008
Status : Completed
Number of warnings : 0
Number of errors : 0
User : oracle
Group : dba
Host : ita022
Important Note:
It has to be mentioned that Data Protector has no information about which
files are contained in each of these backup objects.
Remember, RMAN is streaming the data to Data Protector’s channels, but
DP has no information about the files been sent through the channels. Only
RMAN does.
20
Once we have the imported session, we can get a list of the objects it contains using the
following command:
omnidb –session “Session_ID”
hpu015:[/.root]# omnidb -session "2008/05/08-3"
Object Name Object Type Object Status CopyID
===============================================================================
ita022:DB10g_online_FL<DB10g_184:654165548:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_181:654165548:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_182:654165548:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_183:654165548:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_185:654165575:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_187:654165598:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_186:654165598:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_188:654165598:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_189:654165598:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_190:654165764:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_191:654165773:1>.dbf Oracle8 Completed
ita022:DB10g DP Managed Control File Oracle8 Completed 508 (O)
ita022:Oracle Recovery Backup Catalog Oracle8 Completed 506 (O)
As we can see in the preceding figure, there are 11 Oracle RMAN objects and two Data Protector
objects in this session.
Next, we startup nomount the instance to be able to start the restore:
$ rman
RMAN> set dbid=38758237 ;
RMAN> connect target /
RMAN> startup nomount force;
Unfortunately, there is no process to find out in which of the objects the SPFILE and Control File are
stored. We need to create a small RMAN script and feed the restore clause with the different Object
Names until the restore finds the SPFILE.
For a large number of objects in the backup set, it may be more convenient to write a small shell
script to perform it automatically. See the Appendix for a sample script to run the restore.
Below, we see a successful restore session with the object that contains the SPFILE:
RMAN> run { allocate channel dev_0 type sbt_tape;
restore spfile from 'ita022:DB10g_online_FL<DB10g_185:654165575:1>.dbf' ;
}
allocated channel: dev_0
channel dev_0: sid=36 devtype=SBT_TAPE
channel dev_0: Data Protector A.06.00/PHSS_37147/PHSS_37148/DPSOL_00306/DPLNX_
Starting restore at 2008-05-08
channel dev_0: autobackup found: ita022:DB10g_online_FL<DB10g_185:654165575:1>.dbf
[Normal] From: [email protected] "" Time: 05/08/08 11:16:21
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_185:654165575:1>.dbf "Oracle8"
[Normal] From: [email protected] "" Time: 05/08/08 11:16:25
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_185:654165575:1>.dbf
"Oracle8"
channel dev_0: SPFILE restore from autobackup complete
Finished restore at 2008-05-08
released channel: dev_0
21
As in the preceding case, we have to provide the right object that contains the Control File backup.
Again, below the session with the restore of the Control File:
RMAN> run { allocate channel dev_0 type sbt_tape;
restore controlfile from 'ita022:DB10g_online_FL<DB10g_191:654165773:1>.dbf'
;
}
allocated channel: dev_0
channel dev_0: sid=101 devtype=SBT_TAPE
channel dev_0: Data Protector A.06.00/PHSS_37147/PHSS_37148/DPSOL_00306/DPLNX_
Starting restore at 2008-05-08
channel dev_0: restoring control file
[Normal] From: [email protected] "" Time: 05/08/08 11:33:29
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_191:654165773:1>.dbf "Oracle8"
[Normal] From: [email protected] "" Time: 05/08/08 11:33:32
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_191:654165773:1>.dbf
"Oracle8"
channel dev_0: restore complete, elapsed time: 00:00:46
output filename=/opt/oracle/oradata/DB10g/control01.ctl
output filename=/opt/oracle/oradata/DB10g/control02.ctl
output filename=/opt/oracle/oradata/DB10g/control03.ctl
Finished restore at 2008-05-08
released channel: dev_0
RMAN> alter database mount;
database mounted
As for the other scenarios, we perform a Point in Time restore and recovery of the database:
RMAN> list backup of database completed after 'SYSDATE -1';
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
172 Incr 0 369.50M SBT_TAPE 00:00:42 2008-05-08
BP Key: 172 Status: AVAILABLE Compressed: NO Tag: TAG20080508T083907
Handle: DB10g_online_FL<DB10g_181:654165548:1>.dbf Media:
List of Datafiles in backup set 172
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
1 0 Incr 7525243 2008-05-08 /opt/oracle/oradata/DB10g/system01.dbf
RMAN> list backup of archivelog from scn=7525243 ;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
177 113.75M SBT_TAPE 00:00:06 2008-05-08
BP Key: 177 Status: AVAILABLE Compressed: NO Tag: TAG20080508T083957
Handle: DB10g_online_FL<DB10g_190:654165764:1>.dbf Media:
10394b75:4822a021:5c7d:006a[ita022_file_lib_MediaPool_34]
List of Archived Logs in backup set 177
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ---------- ---------- ---------
1 104 7511046 2008-05-08 7525289 2008-05-08
1 105 7525289 2008-05-08 7525300 2008-05-08
RMAN> run
{
set until sequence = 106 ;
restore database ;
recover database;
alter database open resetlogs;
}
22
Recommendations
This is a summary of the recommendations described along this paper:
Verify and document your Recovery Plan regularly
Always enable CONTROL FILE AUTOBACKUP
Use a Recovery Catalog in your environment
Plan a RESTORE VALIDATE on a regular basis.
Limitations
This is a summary of the issues that were discovered during the white paper investigation:
Currently, it is not possible to restore the DP-managed Control File to a server where the Oracle
integration has not been configured previously
The current Oracle integration requires the instance to be configured, although it is a file system
restore. By default, the Oracle instance configuration files on the cell manager are accessed to
retrieve instance specific information, as login, ORACLE_HOME and so on.
For the disaster/migration scenarios discussed here, it means, the DP managed Control File
cannot be used for the initial restore, but we need to rely on the RMAN Control File backup.
The problem has been addressed to the LAB and has been investigated. The fix will be released
in the next future.
Exported media from a File Library can only be imported into a Jukebox, and not on a file library.
This needs to be taken into account when planning a migration.
Only RMAN knows which Oracle objects are stored on which backup sets. This limitation becomes
critical in the situation where neither Control File autobackup nor Recovery Catalog is used.
When using Object Copy or Device Mirroring be aware that, if the original tape expired or was
exported, the media ID stored by RMAN (original) may point to a tape that contains other backups.
This needs to be taken into account when selecting the media to be used in the migration. RMAN
stores in its catalog the media ID of the original tape, and does not know about object copies.
Summary
Disaster recovery involving Oracle databases is a task that requires careful planning. Data Protector
Catalog information and Oracle control files availability are crucial to have a successful restore.
On the other hand, if the required configuration steps have been followed, the whole process can be
achieved very smoothly.
HP Software Data Protector jointly with Oracle databases is your best bet for a successful
database migration.
23
Appendix A: Session Reports
Session 1: Control File autobackup ON and Recovery Catalog
oracle@hpu015[DB10g]:/opt/oracle/product/10.2.0/db_1/dbs$ rman catalog rman/xxx@rcat
Recovery Manager: Release 10.2.0.3.0 - Production on Wed May 7 08:27:15 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to recovery catalog database
RMAN> set dbid=38758237 ;
executing command: SET DBID
database name is "DB10G" and DBID is 38758237
RMAN> connect target /
connected to target database (not started)
RMAN> startup nomount;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/opt/oracle/product/10.2.0/db_1/dbs/initDB10g.ora'
starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started
Total System Global Area 159383552 bytes
Fixed Size 2056752 bytes
Variable Size 67112400 bytes
Database Buffers 88080384 bytes
Redo Buffers 2134016 bytes
RMAN>
RMAN> run {
2> restore spfile from autobackup;
3> }
Starting restore at 2008-05-07
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=36 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protector A.06.00/PHSS_37147/PHSS_37148/DPSOL_00306/DPLNX_
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=35 devtype=DISK
channel ORA_SBT_TAPE_1: looking for autobackup on day: 20080507
channel ORA_SBT_TAPE_1: looking for autobackup on day: 20080506
channel ORA_DISK_1: looking for autobackup on day: 20080507
channel ORA_DISK_1: looking for autobackup on day: 20080506
channel ORA_DISK_1: skipped, autobackup already found
channel ORA_SBT_TAPE_1: autobackup found: c-38758237-20080506-01
[Normal] From: [email protected] "" Time: 05/07/08 09:42:59
Starting OB2BAR Restore: ita022:c-38758237-20080506-01 "Oracle8"
[Normal] From: [email protected] "" Time: 05/07/08 09:43:00
Completed OB2BAR Restore: ita022:c-38758237-20080506-01 "Oracle8"
channel ORA_SBT_TAPE_1: SPFILE restore from autobackup complete
Finished restore at 2008-05-07
RMAN>
RMAN> startup nomount force;
Oracle instance started
Total System Global Area 314572800 bytes
24
Fixed Size 2057944 bytes
Variable Size 100665640 bytes
Database Buffers 209715200 bytes
Redo Buffers 2134016 bytes
RMAN> run {
2> restore controlfile from autobackup;
3> }
Starting restore at 2008-05-07
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=101 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protector A.06.00/PHSS_37147/PHSS_37148/DPSOL_00306/DPLNX_
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=100 devtype=DISK
channel ORA_SBT_TAPE_1: looking for autobackup on day: 20080507
channel ORA_SBT_TAPE_1: looking for autobackup on day: 20080506
channel ORA_DISK_1: looking for autobackup on day: 20080507
channel ORA_DISK_1: looking for autobackup on day: 20080506
channel ORA_DISK_1: skipped, autobackup already found
channel ORA_SBT_TAPE_1: autobackup found: c-38758237-20080506-01
[Normal] From: [email protected] "DB10g" Time: 05/07/08 09:50:33
Starting OB2BAR Restore: ita022:c-38758237-20080506-01 "Oracle8"
[Normal] From: [email protected] "DB10g" Time: 05/07/08 09:50:36
Completed OB2BAR Restore: ita022:c-38758237-20080506-01 "Oracle8"
channel ORA_SBT_TAPE_1: control file restore from autobackup complete
output filename=/opt/oracle/oradata/DB10g/control01.ctl
output filename=/opt/oracle/oradata/DB10g/control02.ctl
output filename=/opt/oracle/oradata/DB10g/control03.ctl
Finished restore at 2008-05-07
RMAN>
RMAN> startup mount;
database is already started
database mounted
released channel: ORA_SBT_TAPE_1
released channel: ORA_DISK_1
RMAN>
RMAN> list backup of database completed between 'SYSDATE -1' and 'SYSDATE' ;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
38975 Incr 0 191.50M SBT_TAPE 00:00:29 2008-05-06
BP Key: 38979 Status: AVAILABLE Compressed: NO Tag: TAG20080506T145513
Handle: DB10g_online_FL<DB10g_159:654015314:1>.dbf Media:
List of Datafiles in backup set 38975
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
2 0 Incr 7375108 2008-05-06 /opt/oracle/oradata/DB10g/undotbs01.dbf
5 0 Incr 7375108 2008-05-06 /opt/oracle/oradata/DB10g/example01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
38976 Incr 0 335.50M SBT_TAPE 00:00:36 2008-05-06
BP Key: 38980 Status: AVAILABLE Compressed: NO Tag: TAG20080506T145513
Handle: DB10g_online_FL<DB10g_158:654015314:1>.dbf Media:
List of Datafiles in backup set 38976
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
3 0 Incr 7375107 2008-05-06 /opt/oracle/oradata/DB10g/sysaux01.dbf
4 0 Incr 7375107 2008-05-06 /opt/oracle/oradata/DB10g/users01.dbf
25
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
38977 Incr 0 369.50M SBT_TAPE 00:00:38 2008-05-06
BP Key: 38981 Status: AVAILABLE Compressed: NO Tag: TAG20080506T145513
Handle: DB10g_online_FL<DB10g_157:654015313:1>.dbf Media:
List of Datafiles in backup set 38977
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
1 0 Incr 7375106 2008-05-06 /opt/oracle/oradata/DB10g/system01.dbf
RMAN>
RMAN> list backup of archivelog from scn=7375106 ;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
39019 1.53G SBT_TAPE 00:02:40 2008-05-06
BP Key: 39025 Status: AVAILABLE Compressed: NO Tag: TAG20080506T145657
Handle: DB10g_online_FL<DB10g_164:654015418:1>.dbf Media:
10394b75:482055a3:5c7d:0057[ita022_file_lib_MediaPool_29]
List of Archived Logs in backup set 39019
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ---------- ---------- ---------
1 96 7347881 2008-05-06 7375215 2008-05-06
1 97 7375215 2008-05-06 7375238 2008-05-06
RMAN>
RMAN> run {
2> set until sequence = 98 thread 1;
3> restore database;
4> recover database;
5> alter database open resetlogs;
6> }
executing command: SET until clause
Starting restore at 2008-05-07
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=100 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protector A.06.00/PHSS_37147/PHSS_37148/DPSOL_00306/DPLNX_
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=101 devtype=DISK
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to /opt/oracle/oradata/DB10g/undotbs01.dbf
restoring datafile 00005 to /opt/oracle/oradata/DB10g/example01.dbf
channel ORA_SBT_TAPE_1: reading from backup piece DB10g_online_FL<DB10g_159:654015314:1>.dbf
[Normal] From: [email protected] "DB10g" Time: 05/07/08 10:35:48
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_159:654015314:1>.dbf "Oracle8"
[Normal] From: [email protected] "DB10g" Time: 05/07/08 10:36:16
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_159:654015314:1>.dbf
"Oracle8"
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=DB10g_online_FL<DB10g_159:654015314:1>.dbf tag=TAG20080506T145513
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:01:15
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00003 to /opt/oracle/oradata/DB10g/sysaux01.dbf
restoring datafile 00004 to /opt/oracle/oradata/DB10g/users01.dbf
channel ORA_SBT_TAPE_1: reading from backup piece DB10g_online_FL<DB10g_158:654015314:1>.dbf
[Normal] From: [email protected] "DB10g" Time: 05/07/08 10:37:03
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_158:654015314:1>.dbf "Oracle8"
[Normal] From: [email protected] "DB10g" Time: 05/07/08 10:37:58
26
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_158:654015314:1>.dbf
"Oracle8"
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=DB10g_online_FL<DB10g_158:654015314:1>.dbf tag=TAG20080506T145513
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:01:35
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /opt/oracle/oradata/DB10g/system01.dbf
channel ORA_SBT_TAPE_1: reading from backup piece DB10g_online_FL<DB10g_157:654015313:1>.dbf
[Normal] From: [email protected] "DB10g" Time: 05/07/08 10:38:39
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_157:654015313:1>.dbf "Oracle8"
[Normal] From: [email protected] "DB10g" Time: 05/07/08 10:37:58
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_158:654015314:1>.dbf
"Oracle8"
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=DB10g_online_FL<DB10g_158:654015314:1>.dbf tag=TAG20080506T145513
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:01:35
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /opt/oracle/oradata/DB10g/system01.dbf
channel ORA_SBT_TAPE_1: reading from backup piece
DB10g_online_FL<DB10g_157:654015313:1>.dbf[Normal] From: [email protected]
"DB10g" Time: 05/07/08 10:39:42
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_157:654015313:1>.dbf
"Oracle8"
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=DB10g_online_FL<DB10g_157:654015313:1>.dbf tag=TAG20080506T145513
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:01:45
Finished restore at 2008-05-07
Starting recover at 2008-05-07
using channel ORA_SBT_TAPE_1
using channel ORA_DISK_1
starting media recovery
channel ORA_SBT_TAPE_1: starting archive log restore to default destination
channel ORA_SBT_TAPE_1: restoring archive log
archive log thread=1 sequence=96
channel ORA_SBT_TAPE_1: restoring archive log
archive log thread=1 sequence=97
channel ORA_SBT_TAPE_1: reading from backup piece DB10g_online_FL<DB10g_164:654015418:1>.dbf
[Normal] From: [email protected] "DB10g" Time: 05/07/08 10:40:33
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_164:654015418:1>.dbf "Oracle8"
[Normal] From: [email protected] "DB10g" Time: 05/07/08 10:41:24
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_164:654015418:1>.dbf
"Oracle8"
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=DB10g_online_FL<DB10g_164:654015418:1>.dbf tag=TAG20080506T145657
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:01:35
archive log filename=/opt/oracle/oradata/DB10g/arc/1_96_649590802.dbf thread=1 sequence=96
archive log filename=/opt/oracle/oradata/DB10g/arc/1_97_649590802.dbf thread=1 sequence=97
media recovery complete, elapsed time: 00:00:03
Finished recover at 2008-05-07
database opened
new incarnation of database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN>
27
Session 2: Control File autobackup OFF and Recovery Catalog
oracle@hpu015[DB10g]:/home/oracle$ rman catalog rman/xxx@rcat
Recovery Manager: Release 10.2.0.3.0 - Production on Wed May 7 13:18:58 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to recovery catalog database
RMAN> set dbid=38758237 ;
executing command: SET DBID
database name is "DB10G" and DBID is 38758237
RMAN> connect target / ;
connected to target database (not started)
RMAN> startup nomount;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/opt/oracle/product/10.2.0/db_1/dbs/initDB10g.ora'
starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started
Total System Global Area 159383552 bytes
Fixed Size 2056752 bytes
Variable Size 67112400 bytes
Database Buffers 88080384 bytes
Redo Buffers 2134016 bytes
RMAN> restore spfile;
Starting restore at 2008-05-07
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=36 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protector A.06.00/PHSS_37147/PHSS_37148/DPSOL_00306/DPLNX_
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=35 devtype=DISK
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: restoring SPFILE
output filename=/opt/oracle/product/10.2.0/db_1/dbs/spfileDB10g.ora
channel ORA_SBT_TAPE_1: reading from backup piece DB10g_online_FL<DB10g_174:654105081:1>.dbf
[Normal] From: [email protected] "DB10g" Time: 05/07/08 13:20:27
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_174:654105081:1>.dbf "Oracle8"
[Normal] From: [email protected] "DB10g" Time: 05/07/08 13:20:30
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_174:654105081:1>.dbf
"Oracle8"
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=DB10g_online_FL<DB10g_174:654105081:1>.dbf tag=TAG20080507T155104
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:45
Finished restore at 2008-05-07
RMAN>
RMAN> startup nomount force;
Oracle instance started
Total System Global Area 314572800 bytes
Fixed Size 2057944 bytes
Variable Size 100665640 bytes
Database Buffers 209715200 bytes
Redo Buffers 2134016 bytes
RMAN> restore controlfile;
Starting restore at 2008-05-07
allocated channel: ORA_SBT_TAPE_1
28
channel ORA_SBT_TAPE_1: sid=101 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protector A.06.00/PHSS_37147/PHSS_37148/DPSOL_00306/DPLNX_
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=100 devtype=DISK
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: restoring control file
channel ORA_SBT_TAPE_1: reading from backup piece DB10g_online_FL<DB10g_180:654105439:1>.dbf
[Normal] From: [email protected] "DB10g" Time: 05/07/08 13:23:07
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_180:654105439:1>.dbf "Oracle8"
[Normal] From: [email protected] "DB10g" Time: 05/07/08 13:23:09
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_180:654105439:1>.dbf
"Oracle8"
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=DB10g_online_FL<DB10g_180:654105439:1>.dbf tag=TAG20080507T155719
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:45
output filename=/opt/oracle/oradata/DB10g/control01.ctl
output filename=/opt/oracle/oradata/DB10g/control02.ctl
output filename=/opt/oracle/oradata/DB10g/control03.ctl
Finished restore at 2008-05-07
RMAN>
RMAN> startup mount;
database is already started
database mounted
released channel: ORA_SBT_TAPE_1
released channel: ORA_DISK_1
RMAN> list backup of database completed after 'SYSDATE';
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
40321 Incr 0 896.50M SBT_TAPE 00:00:46 2008-05-07
BP Key: 40325 Status: AVAILABLE Compressed: NO Tag: TAG20080507T154635
Handle: DB10g_online_FL<DB10g_167:654104795:1>.dbf Media:
List of Datafiles in backup set 40321
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
1 0 Incr 7463277 2008-05-07 /opt/oracle/oradata/DB10g/system01.dbf
2 0 Incr 7463277 2008-05-07 /opt/oracle/oradata/DB10g/undotbs01.dbf
3 0 Incr 7463277 2008-05-07 /opt/oracle/oradata/DB10g/sysaux01.dbf
4 0 Incr 7463277 2008-05-07 /opt/oracle/oradata/DB10g/users01.dbf
5 0 Incr 7463277 2008-05-07 /opt/oracle/oradata/DB10g/example01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
40354 Incr 0 191.50M SBT_TAPE 00:00:43 2008-05-07
BP Key: 40361 Status: AVAILABLE Compressed: NO Tag: TAG20080507T155104
Handle: DB10g_online_FL<DB10g_172:654105065:1>.dbf Media:
List of Datafiles in backup set 40354
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
2 0 Incr 7463627 2008-05-07 /opt/oracle/oradata/DB10g/undotbs01.dbf
5 0 Incr 7463627 2008-05-07 /opt/oracle/oradata/DB10g/example01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
40355 Incr 0 369.50M SBT_TAPE 00:00:45 2008-05-07
BP Key: 40362 Status: AVAILABLE Compressed: NO Tag: TAG20080507T155104
Handle: DB10g_online_FL<DB10g_170:654105065:1>.dbf Media:
List of Datafiles in backup set 40355
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
1 0 Incr 7463625 2008-05-07 /opt/oracle/oradata/DB10g/system01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
40356 Incr 0 335.75M SBT_TAPE 00:00:50 2008-05-07
BP Key: 40363 Status: AVAILABLE Compressed: NO Tag: TAG20080507T155104
29
Handle: DB10g_online_FL<DB10g_171:654105065:1>.dbf Media:
List of Datafiles in backup set 40356
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
3 0 Incr 7463626 2008-05-07 /opt/oracle/oradata/DB10g/sysaux01.dbf
4 0 Incr 7463626 2008-05-07 /opt/oracle/oradata/DB10g/users01.dbf
RMAN> list backup of archivelog from scn=7463625;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
40387 256.00K SBT_TAPE 00:00:04 2008-05-07
BP Key: 40394 Status: AVAILABLE Compressed: NO Tag: TAG20080507T155201
Handle: DB10g_online_FL<DB10g_179:654105279:1>.dbf Media:
10394b75:4821b3d4:5c7d:005f[ita022_file_lib_MediaPool_31]
List of Archived Logs in backup set 40387
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ---------- ---------- ---------
1 102 7463712 2008-05-07 7463723 2008-05-07
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
40388 1.59G SBT_TAPE 00:04:58 2008-05-07
BP Key: 40395 Status: AVAILABLE Compressed: NO Tag: TAG20080507T155201
Handle: DB10g_online_FL<DB10g_178:654105122:1>.dbf Media:
10394b75:4821b3d4:5c7d:0060[ita022_file_lib_MediaPool_32]
List of Archived Logs in backup set 40388
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ---------- ---------- ---------
1 101 7463367 2008-05-07 7463712 2008-05-07
RMAN> run {
2> set until sequence = 103 ;
3> restore database ;
4> recover database ;
5> alter database open resetlogs;
6> }
executing command: SET until clause
Starting restore at 2008-05-07
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=100 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protector A.06.00/PHSS_37147/PHSS_37148/DPSOL_00306/DPLNX_
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=101 devtype=DISK
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to /opt/oracle/oradata/DB10g/undotbs01.dbf
restoring datafile 00005 to /opt/oracle/oradata/DB10g/example01.dbf
channel ORA_SBT_TAPE_1: reading from backup piece DB10g_online_FL<DB10g_172:654105065:1>.dbf
[Normal] From: [email protected] "DB10g" Time: 05/07/08 13:41:26
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_172:654105065:1>.dbf "Oracle8"
[Normal] From: [email protected] "DB10g" Time: 05/07/08 13:42:00
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_172:654105065:1>.dbf
"Oracle8"
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=DB10g_online_FL<DB10g_172:654105065:1>.dbf tag=TAG20080507T155104
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:01:25
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00003 to /opt/oracle/oradata/DB10g/sysaux01.dbf
restoring datafile 00004 to /opt/oracle/oradata/DB10g/users01.dbf
channel ORA_SBT_TAPE_1: reading from backup piece DB10g_online_FL<DB10g_171:654105065:1>.dbf
[Normal] From: [email protected] "DB10g" Time: 05/07/08 13:42:51
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_171:654105065:1>.dbf "Oracle8"
30
[Normal] From: [email protected] "DB10g" Time: 05/07/08 13:43:49
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_171:654105065:1>.dbf
"Oracle8"
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=DB10g_online_FL<DB10g_171:654105065:1>.dbf tag=TAG20080507T155104
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:01:46
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /opt/oracle/oradata/DB10g/system01.dbf
channel ORA_SBT_TAPE_1: reading from backup piece DB10g_online_FL<DB10g_170:654105065:1>.dbf
[Normal] From: [email protected] "DB10g" Time: 05/07/08 13:44:36
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_170:654105065:1>.dbf "Oracle8"
[Normal] From: [email protected] "DB10g" Time: 05/07/08 13:45:40
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_170:654105065:1>.dbf
"Oracle8"
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=DB10g_online_FL<DB10g_170:654105065:1>.dbf tag=TAG20080507T155104
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:01:45
Finished restore at 2008-05-07
Starting recover at 2008-05-07
using channel ORA_SBT_TAPE_1
using channel ORA_DISK_1 1
starting media recovery
channel ORA_SBT_TAPE_1: starting archive log restore to default destination
channel ORA_SBT_TAPE_1: restoring archive log
archive log thread=1 sequence=102
channel ORA_SBT_TAPE_1: reading from backup piece DB10g_online_FL<DB10g_179:654105279:1>.dbf
[Normal] From: [email protected] "DB10g" Time: 05/07/08 13:46:31
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_179:654105279:1>.dbf "Oracle8"
[Normal] From: [email protected] "DB10g" Time: 05/07/08 13:46:31
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_179:654105279:1>.dbf
"Oracle8"
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=DB10g_online_FL<DB10g_179:654105279:1>.dbf tag=TAG20080507T155201
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:45
channel ORA_SBT_TAPE_1: starting archive log restore to default destination
channel ORA_SBT_TAPE_1: restoring archive log
archive log thread=1 sequence=101
channel ORA_SBT_TAPE_1: reading from backup piece DB10g_online_FL<DB10g_178:654105122:1>.dbf
[Normal] From: [email protected] "DB10g" Time: 05/07/08 13:47:17
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_178:654105122:1>.dbf "Oracle8"
[Normal] From: [email protected] "DB10g" Time: 05/07/08 13:49:52
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_178:654105122:1>.dbf
"Oracle8"
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=DB10g_online_FL<DB10g_178:654105122:1>.dbf tag=TAG20080507T155201
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:03:26
archive log filename=/opt/oracle/oradata/DB10g/arc/1_101_649590802.dbf thread=1 sequence=101
archive log filename=/opt/oracle/oradata/DB10g/arc/1_102_649590802.dbf thread=1 sequence=102
media recovery complete, elapsed time: 00:00:03
Finished recover at 2008-05-07
database opened
new incarnation of database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN>
31
Session 3: Control File autobackup OFF and NO Recovery Catalog
oracle@hpu015[DB10g]:/home/oracle$ omnidb -session "2008/05/08-3"
Object Name Object Type Object Status CopyID
===============================================================================
ita022:DB10g_online_FL<DB10g_184:654165548:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_181:654165548:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_182:654165548:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_183:654165548:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_185:654165575:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_187:654165598:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_186:654165598:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_188:654165598:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_189:654165598:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_190:654165764:1>.dbf Oracle8 Completed
ita022:DB10g_online_FL<DB10g_191:654165773:1>.dbf Oracle8 Completed
ita022:DB10g DP Managed Control File Oracle8 Completed 508 (O)
ita022:Oracle Recovery Backup Catalog Oracle8 Completed 506 (O)
RMAN> set dbid=38758237 ;
executing command: SET DBID
RMAN> connect target /
connected to target database: (not mounted)
RMAN> startup nomount force;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/opt/oracle/product/10.2.0/db_1/dbs/initDB10g.ora'
starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started
Total System Global Area 159383552 bytes
Fixed Size 2056752 bytes
Variable Size 67112400 bytes
Database Buffers 88080384 bytes
Redo Buffers 2134016 bytes
RMAN> run { allocate channel dev_0 type sbt_tape;
2> restore spfile from 'ita022:DB10g_online_FL<DB10g_185:654165575:1>.dbf' ; }
allocated channel: dev_0
channel dev_0: sid=36 devtype=SBT_TAPE
channel dev_0: Data Protector A.06.00/PHSS_37147/PHSS_37148/DPSOL_00306/DPLNX_
Starting restore at 2008-05-08
channel dev_0: autobackup found: ita022:DB10g_online_FL<DB10g_185:654165575:1>.dbf
[Normal] From: [email protected] "" Time: 05/08/08 11:16:21
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_185:654165575:1>.dbf "Oracle8"
[Normal] From: [email protected] "" Time: 05/08/08 11:16:25
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_185:654165575:1>.dbf
"Oracle8"
channel dev_0: SPFILE restore from autobackup complete
Finished restore at 2008-05-08
released channel: dev_0
RMAN> run { allocate channel dev_0 type sbt_tape;
2> restore controlfile from 'ita022:DB10g_online_FL<DB10g_191:654165773:1>.dbf' ; }
allocated channel: dev_0
channel dev_0: sid=101 devtype=SBT_TAPE
channel dev_0: Data Protector A.06.00/PHSS_37147/PHSS_37148/DPSOL_00306/DPLNX_
Starting restore at 2008-05-08
channel dev_0: restoring control file
[Normal] From: [email protected] "" Time: 05/08/08 11:33:29
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_191:654165773:1>.dbf "Oracle8"
32
[Normal] From: [email protected] "" Time: 05/08/08 11:33:32
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_191:654165773:1>.dbf
"Oracle8"
channel dev_0: restore complete, elapsed time: 00:00:46
output filename=/opt/oracle/oradata/DB10g/control01.ctl
output filename=/opt/oracle/oradata/DB10g/control02.ctl
output filename=/opt/oracle/oradata/DB10g/control03.ctl
Finished restore at 2008-05-08
released channel: dev_0
RMAN> alter database mount;
database mounted
RMAN> list backup of database completed after 'SYSDATE -1';
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
172 Incr 0 369.50M SBT_TAPE 00:00:42 2008-05-08
BP Key: 172 Status: AVAILABLE Compressed: NO Tag: TAG20080508T083907
Handle: DB10g_online_FL<DB10g_181:654165548:1>.dbf Media:
List of Datafiles in backup set 172
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
1 0 Incr 7525243 2008-05-08 /opt/oracle/oradata/DB10g/system01.dbf
RMAN> list backup of archivelog from scn=7525243 ;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
177 113.75M SBT_TAPE 00:00:06 2008-05-08
BP Key: 177 Status: AVAILABLE Compressed: NO Tag: TAG20080508T083957
Handle: DB10g_online_FL<DB10g_190:654165764:1>.dbf Media:
10394b75:4822a021:5c7d:006a[ita022_file_lib_MediaPool_34]
List of Archived Logs in backup set 177
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ---------- ---------- ---------
1 104 7511046 2008-05-08 7525289 2008-05-08
1 105 7525289 2008-05-08 7525300 2008-05-08
RMAN> run
2> {
3> set until sequence = 106 ;
4> restore database ;
5> recover database;
6> alter database open resetlogs;
7> }
executing command: SET until clause
Starting restore at 2008-05-08
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=101 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protector A.06.00/PHSS_37147/PHSS_37148/DPSOL_00306/DPLNX_
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=100 devtype=DISK
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to /opt/oracle/oradata/DB10g/undotbs01.dbf
restoring datafile 00005 to /opt/oracle/oradata/DB10g/example01.dbf
channel ORA_SBT_TAPE_1: reading from backup piece DB10g_online_FL<DB10g_183:654165548:1>.dbf
[Normal] From: [email protected] "DB10g" Time: 05/08/08 11:58:34
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_183:654165548:1>.dbf "Oracle8"
[Normal] From: [email protected] "DB10g" Time: 05/08/08 11:59:02
33
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_183:654165548:1>.dbf
"Oracle8"
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=DB10g_online_FL<DB10g_183:654165548:1>.dbf tag=TAG20080508T083907
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:01:15
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00003 to /opt/oracle/oradata/DB10g/sysaux01.dbf
restoring datafile 00004 to /opt/oracle/oradata/DB10g/users01.dbf
channel ORA_SBT_TAPE_1: reading from backup piece DB10g_online_FL<DB10g_182:654165548:1>.dbf
[Normal] From: [email protected] "DB10g" Time: 05/08/08 11:59:49
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_182:654165548:1>.dbf "Oracle8"
[Normal] From: [email protected] "DB10g" Time: 05/08/08 12:00:44
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_182:654165548:1>.dbf
"Oracle8"
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=DB10g_online_FL<DB10g_182:654165548:1>.dbf tag=TAG20080508T083907
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:01:46
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /opt/oracle/oradata/DB10g/system01.dbf
channel ORA_SBT_TAPE_1: reading from backup piece DB10g_online_FL<DB10g_181:654165548:1>.dbf
[Normal] From: [email protected] "DB10g" Time: 05/08/08 12:01:34
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_181:654165548:1>.dbf "Oracle8"
[Normal] From: [email protected] "DB10g" Time: 05/08/08 12:02:32
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_181:654165548:1>.dbf
"Oracle8"
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=DB10g_online_FL<DB10g_181:654165548:1>.dbf tag=TAG20080508T083907
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:01:45
Finished restore at 2008-05-08
Starting recover at 2008-05-08
using channel ORA_SBT_TAPE_1
using channel ORA_DISK_1
starting media recovery
channel ORA_SBT_TAPE_1: starting archive log restore to default destination
channel ORA_SBT_TAPE_1: restoring archive log
archive log thread=1 sequence=104
channel ORA_SBT_TAPE_1: restoring archive log
archive log thread=1 sequence=105
channel ORA_SBT_TAPE_1: reading from backup piece DB10g_online_FL<DB10g_190:654165764:1>.dbf
[Normal] From: [email protected] "DB10g" Time: 05/08/08 12:03:22
Starting OB2BAR Restore: ita022:DB10g_online_FL<DB10g_190:654165764:1>.dbf "Oracle8"
[Normal] From: [email protected] "DB10g" Time: 05/08/08 12:03:28
Completed OB2BAR Restore: ita022:DB10g_online_FL<DB10g_190:654165764:1>.dbf
"Oracle8"
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=DB10g_online_FL<DB10g_190:654165764:1>.dbf tag=TAG20080508T083957
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:55
archive log filename=/opt/oracle/oradata/DB10g/arc/1_104_649590802.dbf thread=1 sequence=104
archive log filename=/opt/oracle/oradata/DB10g/arc/1_105_649590802.dbf thread=1 sequence=105
media recovery complete, elapsed time: 00:00:03
Finished recover at 2008-05-08
database opened
RMAN>
34
Appendix B: How to restore the DP Managed Control File
root@ita022:/.root# export OB2APPNAME=DB10g
root@ita022:/.root# /opt/omni/lbin/ob2rman.pl -restore_controlfile -session 2008/03/19-1
[Normal] From: ob2rman@ita022 "DB10g" Time: 03/19/08 16:26:37
Starting restore of target database.
Net service name: DB10g.
Instance status: OPEN.
Instance name: DB10g.
Database DBID = 38758237.
Database control file type: CURRENT.
Database log mode: ARCHIVELOG.
[Normal] From: ob2rman@ita022 "DB10g" Time: 03/19/08 16:26:43
Starting restore of Data Protector managed control file backup.
[Normal] From: ob2rman@ita022 "DB10g" Time: 03/19/08 16:27:24
Restore of Data Protector managed control file backup completed.
Location: /var/opt/omni/tmp/ctrl_DB10g.dbf.
[Normal] From: ob2rman@ita022 "DB10g" Time: 03/19/08 16:27:25
Restore of target database completed.
Once the file system restore of the DP-managed Control File is finished, we can start the restore of the
Control File using RMAN.
run {
allocate channel 'dev0' type disk;
restore controlfile from '/var/opt/omni/tmp/ctrl_DB10g.dbf';
release channel 'dev0';
}
The same applies to the Recovery Catalog. In this case the option to be used is the following:
/opt/omni/lbin/ob2rman.pl -restore_catalog -session 2008/03/19-1
35
Appendix C: Sample RMAN script to duplicate the Database
In this case, we assume the backup contains a Control File autobackup and we are using a
Recovery Catalog:
Set the DBID of your database
Set the until clause (either time or sequence)
rman catalog rman/xxx@RCVCAT << EOF
set dbid = 38758237 ;
connect target / ;
startup nomount force;
run {
allocate channel dev_0 type sbt_tape;
restore spfile from autobackup;
release channel dev_0;
}
startup nomount force;
run {
allocate channel dev_0 type sbt_tape;
restore controlfile from autobackup;
}
startup mount;
run {
allocate channel dev_0 type sbt_tape;
allocate channel dev_1 type sbt_tape;
# choose one of the following:
# set until time "to_date( '19-03-2008 16:00:00', 'DD-MM-RRRR HH24:MI:SS')";
# set until sequence 6 ;
restore database;
recover database;
alter database open resetlogs;
}
EOF
36
Appendix D: How to import the Recovery Catalog in the
new cell
In this example, we export the Recovery Catalog on ita017 and import it into hpu015.
We assume no Recovery Catalog backup was taken previously with Data Protector, or this backup is
not available.
On the source system (ita017), export the recovery catalog owned by the user RMAN and copy it to
the target system:
oracle@ita017[RCVCAT]:/home/oracle$ exp rman/xxx@rcvcat file=rcvcat.dmp owner=rman
Export: Release 10.2.0.3.0 - Production on Wed Mar 19 11:34:38 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit
Production
With the Partitioning, OLAP and Data Mining options
oracle@ita017[RCVCAT]:/home/oracle$ scp rcvcat.dmp oracle@hpu015:/home/oracle/
On the target system (hpu015), create the user RMAN and grant it the needed privileges:
NOTE:
If there is a already a Recovery Catalog, then create a new recovery
catalog owner; in our case there is already an RMAN user; we create
another user called RMANI for the new recovery catalog
oracle@hpu015[RCVCAT]:/home/oracle$ sq
SQL*Plus: Release 10.2.0.3.0 - Production on Wed Mar 19 11:36:10 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> select username,default_tablespace from dba_users;
USERNAME DEFAULT_TABLESPACE
------------------------------ ------------------------------
MGMT_VIEW SYSTEM
SYS SYSTEM
SYSTEM SYSTEM
DBSNMP SYSAUX
SYSMAN SYSAUX
RMAN RCVCAT
OUTLN SYSTEM
WMSYS SYSAUX
ORDSYS SYSAUX
EXFSYS SYSAUX
XDB SYSAUX
USERNAME DEFAULT_TABLESPACE
------------------------------ ------------------------------
DMSYS SYSAUX
OLAPSYS SYSAUX
SI_INFORMTN_SCHEMA SYSAUX
ORDPLUGINS SYSAUX
MDSYS SYSAUX
37
CTXSYS SYSAUX
ANONYMOUS SYSAUX
MDDATA USERS
TSMSYS USERS
DIP USERS
SCOTT USERS
SQL> create user rmani identified by xxx default tablespace RCVCAT;
User created.
SQL> grant RECOVERY_CATALOG_OWNER TO rmani;
Grant succeeded.
SQL> alter user rmani quota unlimited on RCVCAT;
User altered.
SQL> grant connect,resource to rmani;
Grant succeeded.
SQL> connect rmani/xxx
Connected.
SQL>
Once the new RMAN user (RMANI) is created, we can start the import of the Recovery Catalog in
their schema:
oracle@hpu015[RCVCAT]:/home/oracle$ imp userid=rmani/xxx@RCVCAT file=rcvcat.dmp
fromuser=rman \ touser=rmani
Import: Release 10.2.0.3.0 - Production on Wed Mar 19 11:50:21 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Export file created by EXPORT:V10.02.01 via conventional path
oracle@hpu015[RCVCAT]:/home/oracle$ rman catalog rmani/xxx@RCVCAT
Recovery Manager: Release 10.2.0.3.0 - Production on Wed Mar 19 11:54:23 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to recovery catalog database
RMAN>
The Recovery catalog has been imported into our target system, hpu015, and is ready to be used.
38
Appendix E: Script to restore the SPFILE and Control File
providing the Backupset.
These scripts may help you to perform the restore of the SPFILE and Control File from within a Data
Protector Session, by providing the different objects to the RMAN restore command. It can be used in
the case neither recovery catalog nor Control File autobackup is available.
Assume the session we want to restore from is ‘2008/05/08-3’. It many need to be changed
based on your requirements and environment.
Restore of the SPFILE providing the session ID:
# Main script to restore the SPFILE
# Script calls restore_spfile.sh
for i in `omnidb -sess 2008/05/08-3 | awk '{print $1}' | grep dbf | sort`
do
echo ' '
echo ================================================================================
echo Running restore with Object $i
echo ================================================================================
echo ' '
if [ -f $ORACLE_HOME/dbs/spfile$ORACLE_SID.ora ]
then break 2
fi
/home/oracle/restore_spfile.sh $i
done
# restore_spfile.sh
rman << EOF
set dbid=38758237 ;
connect target / ;
startup force nomount;
run {
allocate channel dev_0 type sbt_tape;
restore spfile from "$1" ;
}
EOF
Restore of the Control File providing the session ID:
# Main script to restore the controlfile
# Script calls restore_ctl.sh
for i in `omnidb -sess 2008/05/08-3 | awk '{print $1}' | grep dbf | sort`
do
echo ' '
echo ================================================================================
echo Running restore with Object $i
echo ================================================================================
echo ' '
if [ -f $ORACLE_HOME/dbs/spfile$ORACLE_SID.ora ]
then break 2
fi
/home/oracle/restore_ctl.sh $i
done
# restore_ctl.sh
rman << EOF
set dbid=38758237 ;
connect target / ;
run {
allocate channel dev_0 type sbt_tape;
restore controlfile from "$1" ;
}
EOF
39
Appendix F: Restore scenario: RAC Database to a Single
instance
Assume a disaster scenario where we need to restore our RAC database from cell 1 to cell2.
However, in cell 2 only one host is available. In this case, we will restore a RAC database which was
running on 4 nodes into a single instance running on a different node (in a different Data Protector
cell).
We assume the following prerequisites have been fulfilled:
A full backup of the RAC database has been taken, and this backup has been made available to
the new cell. In our case, the tapes have inserted in the target library and have been imported.
For this example, Control File autobackup is ON and the recovery catalog is available on the target
cell.
The Database is called RAC and the instance on the target is called RAC1
As we can see throughout this section, the process is identical to the scenarios described in previous
sections. On the other hand, there are some RAC specific steps that need to be followed:
We need a PFILE to startup the single instance database. This PFILE has to be edited. The
PFILE can either be created on the original RAC database (if available), or once we have restored
the SPFILE from autobackup.
Once the PFILE is available and before we mount the database with it, following parameters need
to be changed/deleted:
Remove all RAC specific parameters: CLUSTER_DATABASE,
CLUSTER_DATABASE_INSTANCES, and so on.
Verify that all directories specified in the PFILE exist on the target system (do not forget the
Control Files path)
Remove all parameters related to all RAC instances other than RAC1.
On the target system, we list the objects belonging to the imported session:
oracle@hpu015[RAC1]:/home/oracle$ omnidb -sess 2008/07/01-3
Object Name Object Type Object Status CopyID
===============================================================================
ita018:RAC1_online_del<RAC_760:658944460:1>.dbf Oracle8 Completed
ita018:RAC1_online_del<RAC_759:658944460:1>.dbf Oracle8 Completed
ita018:c-2216826430-20080701-00 Oracle8 Completed 1 (O)
ita018:RAC1_online_del<RAC_762:658948786:1>.dbf Oracle8 Completed
ita018:RAC1_online_del<RAC_763:658948786:1>.dbf Oracle8 Completed
ita018:RAC1_online_del<RAC_764:658948825:1>.dbf Oracle8 Completed
ita018:RAC1_online_del<RAC_765:658948839:1>.dbf Oracle8 Completed
ita018:c-2216826430-20080701-01 Oracle8 Completed 657 (O)
Once we the database is in NOMOUNT status, we can restore the SPFILE and Control File from autobackup:
oracle@hpu015[RAC1]:/home/oracle$ rman target / catalog rman/rman@rcat
Recovery Manager: Release 10.2.0.3.0 - Production on Wed Jul 2 12:15:03 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database (not started)
connected to recovery catalog database
RMAN> startup nomount
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/opt/oracle/product/10.2.0/db_1/dbs/initRAC1.ora'
40
starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started
Total System Global Area 159383552 bytes
Fixed Size 2056752 bytes
Variable Size 67112400 bytes
Database Buffers 88080384 bytes
Redo Buffers 2134016 bytes
RMAN> restore spfile from autobackup;
Starting restore at 2008-07-02
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=40 devtype=DISK
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=35 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protector A.06.00/PHSS_37147/PHSS_37148/DPSOL_00306/DPLNX_
allocated channel: ORA_SBT_TAPE_2
channel ORA_SBT_TAPE_2: sid=34 devtype=SBT_TAPE
channel ORA_SBT_TAPE_2: Data Protector A.06.00/PHSS_37147/PHSS_37148/DPSOL_00306/DPLNX_
channel ORA_SBT_TAPE_1: looking for autobackup on day: 20080702
channel ORA_SBT_TAPE_1: looking for autobackup on day: 20080701
channel ORA_SBT_TAPE_2: looking for autobackup on day: 20080702
channel ORA_SBT_TAPE_2: looking for autobackup on day: 20080701
channel ORA_SBT_TAPE_2: skipped, autobackup already found
channel ORA_DISK_1: looking for autobackup on day: 20080702
channel ORA_DISK_1: looking for autobackup on day: 20080701
channel ORA_DISK_1: skipped, autobackup already found
channel ORA_SBT_TAPE_1: autobackup found: c-2216826430-20080701-01
[Normal] From: [email protected] "RAC1" Time: 07/02/08 12:21:23
Starting OB2BAR Restore: ita018:c-2216826430-20080701-01 "Oracle8"
[Normal] From: [email protected] "RAC1" Time: 07/02/08 12:21:29
Completed OB2BAR Restore: ita018:c-2216826430-20080701-01 "Oracle8"
channel ORA_SBT_TAPE_1: SPFILE restore from autobackup complete
Finished restore at 2008-07-02
RMAN> restore controlfile from autobackup;
Starting restore at 2008-07-02
using channel ORA_DISK_1
using channel ORA_SBT_TAPE_1
using channel ORA_SBT_TAPE_2
channel ORA_SBT_TAPE_1: looking for autobackup on day: 20080702
channel ORA_SBT_TAPE_1: looking for autobackup on day: 20080701
channel ORA_SBT_TAPE_2: looking for autobackup on day: 20080702
channel ORA_SBT_TAPE_2: looking for autobackup on day: 20080701
channel ORA_SBT_TAPE_2: skipped, autobackup already found
channel ORA_DISK_1: looking for autobackup on day: 20080702
channel ORA_DISK_1: looking for autobackup on day: 20080701
channel ORA_DISK_1: skipped, autobackup already found
channel ORA_SBT_TAPE_1: autobackup found: c-2216826430-20080701-01
[Normal] From: [email protected] "RAC1" Time: 07/02/08 12:33:47
Starting OB2BAR Restore: ita018:c-2216826430-20080701-01 "Oracle8"
[Normal] From: [email protected] "RAC1" Time: 07/02/08 12:33:52
Completed OB2BAR Restore: ita018:c-2216826430-20080701-01 "Oracle8"
channel ORA_SBT_TAPE_1: control file restore from autobackup complete
output filename=/opt/oracle/product/10.2.0/db_1/dbs/cntrlRAC1.dbf
Finished restore at 2008-07-02
In our case the Control File has been restored to $ORACLE_HOME/dbs. You may need to update the
PFILE control file location.
Before proceeding with the next step (mounting the DB), edit the PFILE as mentioned above.
41
If you are not able to create a PFILE from the original RAC database (not available), you may want
to create a file system copy of the restored SPFILE (binary file) and remove with your ASCII editor
the binary characters (officially unsupported)
RMAN> startup mount force pfile='/opt/oracle/product/10.2.0/db_1/dbs/initRAC1.ora'
Oracle instance started
database mounted
Total System Global Area 4294967296 bytes
Fixed Size 2063792 bytes
Variable Size 754975312 bytes
Database Buffers 3523215360 bytes
Redo Buffers 14712832 bytes
RMAN>
At this point, we can follow as on the other scenarios with the restore and the recovery of the
database.
In case the datafiles location has changed, remember to include the following command on your
RMAN script:
set newname for datafile 1 to ‘new datafile path’;
Appendix G: Reference documentation
HP
HP Data Protector Software Documentation and White Papers
Oracle
Oracle 10g Backup and Recovery Advanced User’s Guide
For more information
HP Data Protector Software
http://www.hp.com/go/dataprotector
© Copyright 2008 Hewlett-Packard Development Company, L.P. The information
contained herein is subject to change without notice. The only warranties for HP
products and services are set forth in the express warranty statements
accompanying such products and services. Nothing herein should be construed as
constituting an additional warranty. HP shall not be liable for technical or editorial
errors or omissions contained herein.
Linux is a U.S. registered trademark of Linus Torvalds. Microsoft and Windows are
U.S. registered trademarks of Microsoft Corporation. UNIX is a registered
trademark of The Open Group.
4AA2-1016ENW, July 2008