Professional Documents
Culture Documents
Oracle RMAN Generic Backup
Oracle RMAN Generic Backup
The Cisco implementation of TCP header compression is an adaptation of a program developed by the
University of California, Berkeley (UCB) as part of UCB's public domain version of the UNIX operating
system. All rights reserved. Copyright 1981, Regents of the University of California.
NOTWITHSTANDING ANY OTHER WARRANTY HEREIN, ALL DOCUMENT FILES AND SOFTWARE
OF THESE SUPPLIERS ARE PROVIDED "AS IS" WITH ALL FAULTS. CISCO AND THE ABOVE-
NAMED SUPPLIERS DISCLAIM ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING,
WITHOUT LIMITATION, THOSE OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
AND NONINFRINGEMENT OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE
PRACTICE.
IN NO EVENT SHALL CISCO OR ITS SUPPLIERS BE LIABLE FOR ANY INDIRECT, SPECIAL,
CONSEQUENTIAL, OR INCIDENTAL DAMAGES, INCLUDING, WITHOUT LIMITATION, LOST
PROFITS OR LOSS OR DAMAGE TO DATA ARISING OUT OF THE USE OR INABILITY TO USE
THIS MANUAL, EVEN IF CISCO OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY
OF SUCH DAMAGES.
Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and
other countries. To view a list of Cisco trademarks, go to this URL: http:// www.cisco.com/go/trademarks.
Third-party trademarks mentioned are the property of their respective owners. The use of the word partner
does not imply a partnership relationship between Cisco and any other company. (1110R)
Any Internet Protocol (IP) addresses used in this document are not intended to be actual addresses. Any
examples, command display output, and figures included in the document are shown for illustrative purposes
only. Any use of actual IP addresses in illustrative content is unintentional and coincidental.
Oracle
Copyright 2012, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of
their respective owners.
Red Hat and Red Hat Enterprise Linux are trademarks of Red Hat, Inc., registered in the United States and
other countries. Other product names, symbols, and phrases used throughout this document (if any) are
property of their respective owners.
Contents
1 Preface ................................................................................................................... 4
1.1 Purpose of this Document .................................................................................... 4
1.2 Using this Document ............................................................................................ 4
1.3 Applicability ........................................................................................................... 4
1.4 Terminology ........................................................................................................... 5
2 Installing Oracle RMAN Backup Generic ..................................................... 6
2.1 Prerequisites ........................................................................................................... 6
2.1.1 Verifying that the Oracle Database Is in Archive Mode ................. 6
2.2 RPM Installation .................................................................................................... 7
2.3 Configuration Files to Run RMAN Generic Backup. ....................................... 8
2.3.1 Directory Tree after RPM Installation ............................................... 8
2.3.2 Configuration File ................................................................................ 8
2.3.3 RMAN Generic Script ........................................................................ 10
2.3.4 Backup Directory Tree after RMAN Generic Scripts Has
Been Run .............................................................................................. 10
3 Full and Differential Backup .......................................................................... 11
3.1 Creating a Full Backup Job ................................................................................. 11
3.1.1 Full Manual Backup ........................................................................... 11
3.1.2 Creating a Full Backup Job as UNIX User oracle ....................... 11
3.1.3 Creating a Full Backup Job as UNIX User root .......................... 12
3.2 Creating a Differential Backup Job ................................................................... 12
3.2.1 Manual Differential Backup .............................................................. 12
3.2.2 Creating a Differential Backup Job as UNIX User oracle ......... 12
3.2.3 Creating a Differential Backup Job as UNIX User root ............. 13
4 Full Restore ......................................................................................................... 14
4.1 Full Restore Procedure........................................................................................ 14
4.2 Success or Failure of Full Restore ...................................................................... 16
4.2.1 Success .................................................................................................. 16
4.2.2 Failure................................................................................................... 16
5 Until Time Restore ............................................................................................ 17
5.1 Until Time Restore Procedure ........................................................................... 17
5.2 Success or Failure of until time Restore ........................................................... 20
5.2.1 Success .................................................................................................. 20
5.2.2 Failure................................................................................................... 21
List of Tables
Table 1 Terminology ........................................................................................................... 5
Table 2 Configuration File Parameters......................... Error! Bookmark not defined.
1 Preface
IMPORTANT!
This Oracle RMAN Backup Generic Installation, Configuration, and Invocation
Guide is an internal document, and must not be shared with customers.
1.3 Applicability
This document is intended for NDS engineers and customer support personnel
involved with the installation, configuration, and ongoing engineering support for
Oracle RMAN Backup Generic.
The version of Oracle RMAN discussed in this document is available only for
Oracle 11g installations.
It is expected that the reader has a good understanding of the target Oracle
Database system.
Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4
Preface
1.4 Terminology
Table 1 Terminology
Term Definition
Oracle Instance A shared memory and group of Oracle server processes that
operate against an Oracle database.
An instanceidentified persistently by an instantiation
number (or activation id: SYS.V$DATABASE.ACTIVATION#)
comprises a set of operating-system processes and memory-
structures that interact with the storage.
Typical processes include PMON (the process monitor) and
SMON (the system monitor).
Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 5
Installing Oracle RMAN Backup Generic
2.1 Prerequisites
Before RMAN Generic is installed, the following conditions must be met:
! Oracle Database 11g must be installed
! The database must be in Archive mode.
If Database log mode shows as No Archive Mode, the database is not in Archive
mode.
Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 6
Installing Oracle RMAN Backup Generic
IMPORTANT!
If you are working on a production database, get permission from the company
database administrator (DBA) before running the following procedure.
10. Change configuration of the database point Directory location for all archives.
Alter system set log_archive_dest_1='LOCATION=
/oraback/<SID>/archive/';
Note This procedure will establish the Archive location. Take into
consideration the amount of space you might need in the future to hold
all Archive logs.
Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 7
Installing Oracle RMAN Backup Generic
Note RMAN Generic files are included on the VGH installation DVDs.
Installation and launch must be manual.
The directory structure under the link ora_rman will appear as follows.
|-- bin
|-- docs
| `-- sample
| `-- CABHE.rman.config
|-- etc
|-- licenses
|-- log
| `-- ora_rman -> /var/log/nds/ora_rman
|-- sql
`-- utils
|-- run_diff_backup.sh
|-- run_full_backup.sh
|-- run_full_restore.sh
|-- set_db_to_NO_archive_log_mode.sh
`-- set_db_to_archive_log_mode.sh
The following four files are required for running RMAN Generic backup.
! sample.rman.config
! run_diff_backup.sh
! run_full_backup.sh
! run_full_restore.sh
Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 8
Installing Oracle RMAN Backup Generic
DIRECTORY_LOC_LOG Sets a location for the backup logs. All logs DIRECTORY_LOC_LOG
made at backup and restore time, will be saved ="/opt/nds/ora_rman/log
in this directory.
Directory path should end with directory
name. Do not add / at end of the directory
path.
Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 9
Installing Oracle RMAN Backup Generic
CAUTION!
Do not run run_full_restore.sh on a production database. Restore should be
performed on a production database only by a company DBA.
2.3.4 Backup Directory Tree after RMAN Generic Scripts Has Been Run
After the run_full_backup.sh has run for the first time, the directory structure,
under DIRECTORY_LOC_BACKUP (backup location parameter in the configuration
file) appears as follows:
|-- archivelog
|-- controlfile
|-- diff_backup
`-- full_backup
Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 10
Full and Differential Backup
In this case, a full backup will run every Sunday at 2:00 AM. The number 2
represents the hour of the day to run this job, and the second 0 represents
Sunday. You can change the 0 to 1 for Monday, to 2 for Tuesday and so forth,
where 6 represents Saturday.
Note The best strategy is to make one full backup and 6 differential backups
each week.
Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 11
Full and Differential Backup
In this case, a full backup will be run every Sunday at 2:00 AM. The number 2
represents the hour of day to run this job. The second 0 represents Sunday (for
further details, see the procedure in section 3.1.2).
3. Create differential backup job using the CRONTAB utility from UNIX.
Crontab e
In this case, a differential backup will run at 2:00 AM each day from Monday
through Saturday. The number 2 represents the hour of the day to run this job.
The numbers 1-6 represent from Monday through Saturday.
Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 12
Full and Differential Backup
In this case, a differential backup will run at 2:00 AM each day from Monday
through Saturday. The number 2 represents the hour of the day to run this job.
The numbers 1-6 represent from Monday through Saturday.
Note As mentioned, the best strategy is to make one full backup and 6
differential backups each week.
Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 13
Full Restore
4 Full Restore
This section describes how to perform a complete restoration of a database.
CAUTION!
Note Complete restoration of a production database should be performed
only by a company DBA.
Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 14
Full Restore
===============================================================================
CAUTION: On this server Red Hat Cluster Services are installed.
Before proceeding the Red Hat Cluster Service for
nds_oracle_$DATABASE_NAME
must be frozen:
----------------
If the Red Hat Cluster Service for nds_oracle_$DATABASE_NAME
requires freezing, in a different window, logon as the OS user root
and issue the following command:
clusvcadm -Z nds_oracle_$DATABASE_NAME \(to FREEZE the Red Hat Cluster
Service\)
----------------
After the restoration process has completed successfully, in a different
window
as the OS user root issue the following command
clusvcadm U nds_oracle_$DATABASE_NAME \(to UNFREEZE Cluster Service\)
-------------------------------------------------------------------------------
Note: Press Control C to exit
Press ENTER to continue
===============================================================================
Note This procedure will overwrite any database on the system with same
name.
11. When you receive the second message, press ENTER again to continue.
If you receive the foregoing message, your database is still up and running OR
part of Oracle has not stopped running. Stop Oracle completely with the
following procedure.
Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 15
Full Restore
If you receive the foregoing message, your restore has succeeded. For Oracle RAC
use the following procedure to re-start your database on the other node.
To start the Oracle database:
1. Run sqlplus, and log on to Oracle
Sqlplus / as sysdba
4.2.2 Failure
===============================================================================
ERROR: The Database Restoration procedure has FAILED!
Action: Contact your Oracle DBA Oracle
===============================================================================
If you receive the foregoing message, your restore was not successful. You should
contact your DBA.
1. Contact your company DBA.
Note Do not unfreeze Oracle Server Service until the Database has been
properly restored.
Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 16
Until Time Restore
CAUTION!
Note Until Time restoration of a production database should be performed
only by a company DBA.
Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 17
Until Time Restore
===============================================================================
CAUTION: On this server Red Hat Cluster Services are installed.
Before proceeding the Red Hat Cluster Service for
nds_oracle_$DATABASE_NAME
must be frozen:
----------------
If the Red Hat Cluster Service for nds_oracle_$DATABASE_NAME
requires freezing, in a different window, logon as the OS user root
and issue the following command:
clusvcadm -Z nds_oracle_$DATABASE_NAME \(to FREEZE the Red Hat Cluster
Service\)
----------------
After the restoration process has completed successfully, in a different
window
as the OS user root issue the following command
clusvcadm U nds_oracle_$DATABASE_NAME \(to UNFREEZE Cluster Service\)
-------------------------------------------------------------------------------
Note: Press Control C to exit
Press ENTER to continue
===============================================================================
Note This procedure will overwrite any database on the system with same
name.
11. When you receive the second message, press ENTER again to continue.
If you receive the foregoing message, your database is still up and running OR
part of Oracle has not stopped running. Stop Oracle completely with the
following procedure.
Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 18
Until Time Restore
16. Specified until what hour to restore (24 hour format Two digits).
Until what minute to restore? (two digits):
Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 19
Until Time Restore
5.2.1 Success
===============================================================================
The Database Restoration has completed successfully!
""
Important:
----------
Run FULL BACKUP before start working with Database.
=====================================================================
For Oracle RAC databases it is now necessary to startup all
additional Instances.
===============================================================================
If you receive the foregoing message, your restore has succeeded. For Oracle RAC
use the following procedure to re-start your database on the other node.
To start the Oracle database:
1. Run sqlplus, and log on to Oracle
Sqlplus / as sysdba
Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 20
Until Time Restore
5.2.2 Failure
===============================================================================
ERROR: The restoration process has failed
If you receive the foregoing message, your restore was not successful. There are
no backup files prior to date specified. Please check you backup files and specified
a date covered by an existing backup files.
===============================================================================
ERROR: The Database Restoration procedure has FAILED!
Action: Contact your Oracle DBA Oracle
===============================================================================
If you receive the foregoing message, your restore was not successful. You should
contact your DBA.
4. Contact your company DBA.
Note Do not unfreeze Oracle Server Service until the Database has been
properly restored.
Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 21