installation, configuration and invocation · pdf filepreface oracle rman backup generic:...

21
Oracle RMAN Backup Generic Installation, Configuration and Invocation Guide For software version: 4.0.1

Upload: dangkhuong

Post on 06-Mar-2018

235 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

Oracle RMAN Backup Generic

Installation, Configuration and Invocation Guide For software version: 4.0.1

Page 2: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

THE SPECIFICATIONS AND INFORMATION REGARDING THE PRODUCTS IN THIS MANUAL ARE SUBJECT TO CHANGE WITHOUT NOTICE. ALL STATEMENTS, INFORMATION, AND RECOMMENDATIONS IN THIS MANUAL ARE BELIEVED TO BE ACCURATE BUT ARE PRESENTED WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. USERS MUST TAKE FULL RESPONSIBILITY FOR THEIR APPLICATION OF ANY PRODUCTS. THE SOFTWARE LICENSE AND LIMITED WARRANTY FOR THE ACCOMPANYING PRODUCT ARE SET FORTH IN THE INFORMATION PACKET THAT SHIPPED WITH THE PRODUCT AND ARE INCORPORATED HEREIN BY THIS REFERENCE. IF YOU ARE UNABLE TO LOCATE THE SOFTWARE LICENSE OR LIMITED WARRANTY, CONTACT YOUR CISCO REPRESENTATIVE FOR A COPY. 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. Adobe Systems, Inc. Adobe LiveCycle Data Services ES2.5, Copyright © 2010, Adobe Systems, Inc. All Rights Reserved 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.

© 2016 Cisco Systems, Inc. All rights reserved.

Page 3: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

Contents

Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 3

Contents 1 Preface ................................................................................................................... 4

1.1 Purpose of this Document .................................................................................... 41.2 Using this Document ............................................................................................ 41.3 Applicability ........................................................................................................... 41.4 Terminology ........................................................................................................... 5

2 Installing Oracle RMAN Backup Generic ..................................................... 62.1 Prerequisites ........................................................................................................... 6

2.1.1 Verifying that the Oracle Database Is in Archive Mode ................. 62.2 RPM Installation .................................................................................................... 72.3 Configuration Files to Run RMAN Generic Backup. ....................................... 8

2.3.1 Directory Tree after RPM Installation ............................................... 82.3.2 Configuration File ................................................................................ 82.3.3 RMAN Generic Script ........................................................................ 102.3.4 Backup Directory Tree after RMAN Generic Scripts Has

Been Run .............................................................................................. 103 Full and Differential Backup .......................................................................... 11

3.1 Creating a Full Backup Job ................................................................................. 113.1.1 Full Manual Backup ........................................................................... 113.1.2 Creating a Full Backup Job as UNIX User “oracle” ....................... 113.1.3 Creating a Full Backup Job as UNIX User “root” .......................... 12

3.2 Creating a Differential Backup Job ................................................................... 123.2.1 Manual Differential Backup .............................................................. 123.2.2 Creating a Differential Backup Job as UNIX User “oracle” ......... 123.2.3 Creating a Differential Backup Job as UNIX User “root” ............. 13

4 Full Restore ......................................................................................................... 144.1 Full Restore Procedure ........................................................................................ 144.2 Success or Failure of Full Restore ...................................................................... 16

4.2.1 Success .................................................................................................. 164.2.2 Failure ................................................................................................... 16

5 Until Time Restore ............................................................................................ 175.1 Until Time Restore Procedure ........................................................................... 175.2 Success or Failure of until time Restore ........................................................... 20

5.2.1 Success .................................................................................................. 205.2.2 Failure ................................................................................................... 21

List of Tables

Table 1 Terminology ........................................................................................................... 5Table 2 Configuration File Parameters ......................... Error! Bookmark not defined.

Page 4: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

Preface

Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4

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.1 Purpose of this Document This is the Installation, Configuration and Installation guide for Oracle RMAN.

RMAN is the Oracle 11g database backup management package.

This document explains how to install and configure Oracle RMAN Backup Generic.

1.2 Using this Document The process for installing Oracle RMAN Backup Generic, including all prerequisites, is explained in section 2.

Procedures for launching Oracle RMAN are explained in section 3.

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.

Page 5: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

Preface

Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 5

1.4 Terminology

Table 1 Terminology

Term Definition

Oracle Database An Oracle database system (commonly referred to as Oracle RDBMS or simply Oracle) is a relational database management system (RDBMS).

The database is identified by an alphanumeric system identifier or SID. The Oracle database comprises at least one instance of the Oracle application, along with data storage.

The Oracle database stores data logically in the form of tablespaces and physically in the form of data files. Tablespaces can contain various types of memory segments.

Oracle Instance A shared memory and group of Oracle server processes that operate against an Oracle database.

An instance—identified 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 SID The Oracle system identifier. The System Identifier automatically defaults to the database name portion of the global database name (e.g., sales in the example sales.us.example.com) until you reach eight characters or enter a period. You can accept or change the default value."

RHEL 5 Red Hat Enterprise Linux (version) 5

Page 6: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

Installing Oracle RMAN Backup Generic

Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 6

2 Installing Oracle RMAN Backup Generic This section describes how to install 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.

2.1.1 Verifying that the Oracle Database Is in Archive Mode

To Verify that the Oracle Database is in Archive mode:

1. Log on to the server using UNIX user “oracle”.

2. Run environment for this Oracle Server Source /opt/oracle/<SID>.env

3. Run sqlplus, and log on to Oracle Sqlplus “/ as sysdba”

4. Check if Oracle is in Archive mode Archive log list;

The response should be as follows with Database log mode showing as Archive Mode.

Database log mode Archive Mode

Automatic archival Enabled

Archive destination USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence 137

Next log sequence to archive 140

If the database is not in Archive mode, the response will be as follows:

Database log mode No Archive Mode

Automatic archival Disabled

Archive destination USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence 137

Current log sequence 140

If Database log mode shows as No Archive Mode, the database is not in Archive mode.

Page 7: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

Installing Oracle RMAN Backup Generic

Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 7

2.1.1.1 Changing an Oracle Database to Archive Mode

Use the following procedure if the database is not in Archive mode.

IMPORTANT!

If you are working on a production database, get permission from the company database administrator (DBA) before running the following procedure.

To change an Oracle database to Archive mode:

1. Log on to the Server using UNIX user “root”.

2. Locate Oracle Server Service in the Linux RH5 cluster. clustat

3. Freeze Oracle Server Service on one any cluster node. clusvcadm -Z nds_oracle_<SID>

4. Log on to the Server using UNIX user “oracle”.

5. Run environment for this Oracle Server. Source /opt/oracle/<SID>.env

6. Run sqlplus, and log on to Oracle. Sqlplus “/ as sysdba”

7. Stop the Oracle Server. Shutdown immediate;

8. Start the Oracle server at a Mount point. Startup mount;

9. Change Database to Archive mode. Alter database archivelog;

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.

11. Start the Oracle server. Alter database open;

12. Unfreeze Oracle Server Service on one any cluster node. clusvcadm -U nds_oracle_<SID>

2.2 RPM Installation Use the Red Hat Package Manager (RPM) to install Oracle RMAN Backup Generic on the Linux platform. The RPM files are located in /opt/nds/rpms.

Rpm –ivh nds_ora_rman-1.0.2-2_el5_11g.x86_64.rpm

Page 8: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

Installing Oracle RMAN Backup Generic

Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 8

Note RMAN Generic files are included on the VGH installation DVDs. Installation and launch must be manual.

2.3 Configuration Files to Run RMAN Generic Backup. The following sections show how to create a configuration file to run RMAN Generic backup.

2.3.1 Directory Tree after RPM Installation

Under /opt/nds/, a link to ora_rman will be created.

ora_rman -> /opt/nds/installed/ora_rman-1.0.2-2

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

2.3.2 Configuration File

Before running RMAN Generic, you must copy, rename, and edit the CABHE.rman.config configuration file as follows.

2.3.2.1 Copy CABHE.rman.config

Copy CABHE.rman.config to Directory /opt/nds/ora_rman/etc/

Page 9: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

Installing Oracle RMAN Backup Generic

Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 9

2.3.2.2 Renaming CABHE.rman.config

Rename file CABHE.rman.config to <DATABASE>. rman.config.

Note In the configuration file name, DATABASE name should be all UPPER CASE. For example: UPC.rman.config

2.3.2.3 Editing the File’s Parameters

Edit the renamed file’s parameters as shown in table Error! Reference source not found.

Remove < >

Keep double quotes “ “

Table 2 Configuration File Parameters

Parameter Explanation Example

SID_NAME Refers to the Oracle SID Name. Replace <SID_NAME> with the original Sid name.

SID_NAME=”UPC”

BACKUP_VERSIONS Refers to the number of full backups that Oracle RMAN will reserve on disk or tape. By default, Oracle RMAN deletes obsolete backups. This parameter will reserve any number of full backups and all differential backups made between the full backups.

BACKUP_VERSIONS=”3”

DIRECTORY_LOC_BACKUP Sets the location of the Backups directory that all backups will be point to.

Directory path should end with directory name. Do not add “/” at end of the directory path.

DIRECTORY_LOC_BACKUP=" /oraback/<SID>/rman”

SECOND_DIRECTORY Setting this parameter to “Y” will cause a second backup of the database to be generated. The default setting is “N”—second backup not created.

SECOND_DIRECTORY="N"

DIRECTORY_LOC_BACKUP2 This parameter sets a second Backups directory location for an additional backup copy of the database.

DIRECTORY_LOC_BACKUP2="<SECOND_DIRECTORY_LOCATION>”

DIRECTORY_LOC_LOG Sets a location for the backup logs. All logs made at backup and restore time, will be saved in this directory.

Directory path should end with directory name. Do not add “/” at end of the directory path.

DIRECTORY_LOC_LOG ="/opt/nds/ora_rman/log”

Page 10: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

Installing Oracle RMAN Backup Generic

Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 10

Parameter Explanation Example

USE_CATALOg Determines whether to use Catalog. Catalog is a database where all information regarding backups is deposited. This database should be different than the local database. The schema where Catalog is deposited should be a new one. Configuration of Catalog Schema should be prepared by the company DBA.

USE_CATALOG="N"

CATALOG_RMAN_CONT Sets the connection string to connect to the Catalog Database.

Catalog use should be confirmed with the company DBA.

CATALOG_RMAN_CONT="UPC_USER/UER_PASSWORD@RMAN_CATALOG”

2.3.3 RMAN Generic Script

! run_full_backup.sh is a script that produces a full backup.

! run_diff_backup.sh is a script that produces a differential backup .

! run_full_restore.sh is a script that produces a full restore of DATABASE.

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

Four directories were created:

! Directory archivelog will hold, all archivelog backups made by full backups or diff backups.

! Directory controlfile will hold, Controlfile backup and Spfile backup made by full backups or diff backups.

! Directory diff_backup will hold, all differential backups made by diff backups.

! Directory full_backup will hold, all full backups made by full backups.

Page 11: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

Full and Differential Backup

Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 11

3 Full and Differential Backup This section describes how to create full and differential backup jobs.

3.1 Creating a Full Backup Job The following sections show how to create a full backup job or run a full manual backup.

3.1.1 Full Manual Backup

To perform a full manual backup:

1. Log on to a server using UNIX user “oracle”.

2. Run environment for this Oracle server. Source /opt/oracle/<SID>.env

3. Run the full backup script. /opt/nds/ora_rman/utils/run_full_backup.sh <DATABASE>

3.1.2 Creating a Full Backup Job as UNIX User “oracle”

To create a full backup job as UNIX user “oracle”:

1. Log on to a server using UNIX user “oracle”.

2. Run environment for this Oracle server. Source /opt/oracle/<SID>.env

3. Create full backup Job using CRONTAB utility from UNIX. Crontab –e

4. Edit CRONTAB Add this line. 0 2 * * 0 /opt/nds/ora_rman/utils/run_full_backup.sh <DATABASE>

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.

Page 12: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

Full and Differential Backup

Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 12

3.1.3 Creating a Full Backup Job as UNIX User “root”

1. Log on to a server using UNIX user “root”.

2. Create a full backup Job using the Unix CRONTAB utility. Crontab –e

3. Edit CRONTAB Add the following line: 0 2 * * 0

su –c ‘/opt/nds/ora_rman/utils/run_full_backup.sh <DATABASE>’ oracle

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.2 Creating a Differential Backup Job The following sections show how to create a differential backup job or run a differential backup manually.

Differential backup will back up all the blocks that have been changed since the last full backup. This means that, to restore a database, you will need only one full backup, the most recent differential backup, the archived redo logs since the differential backup, and the current online redo logs.

3.2.1 Manual Differential Backup

To run a differential backup manually:

1. Log on to a server using UNIX user “oracle”.

2. Run environment for this Oracle server. Source /opt/oracle/<SID>.env

3. Run the differential backup script: /opt/nds/ora_rman/utils/run_diff_backup.sh <DATABASE>

3.2.2 Creating a Differential Backup Job as UNIX User “oracle”

1. Log on to a Server using UNIX user “oracle”.

2. Run environment for this Oracle server. Source /opt/oracle/<SID>.env

3. Create differential backup job using the CRONTAB utility from UNIX. Crontab –e

4. Edit CRONTAB Add the following line. 0 2 * * 1-6 /opt/nds/ora_rman/utils/run_diff_backup.sh <DATABASE>

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.

Page 13: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

Full and Differential Backup

Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 13

3.2.3 Creating a Differential Backup Job as UNIX User “root”

1. Log on to a server using UNIX user “root”.

2. Create a differential backup job using the UNIX CRONTAB utility. Crontab –e

3. Edit CRONTAB Add the following line: 0 2 * * 1-6

su –c ‘/opt/nds/ora_rman/utils/run_diff_backup.sh <DATABASE>’ oracle

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.

Page 14: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

Full Restore

Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 14

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.

4.1 Full Restore Procedure To perform a full restoration of an Oracle database:

1. Log on to the server using UNIX user “root”.

2. Locate Oracle Server Service in the Linux RH5 cluster. clustat

3. Freeze Oracle Server Service on one any cluster node. clusvcadm -Z nds_oracle_<SID>

4. Log on to the server using UNIX user “oracle”.

5. Run environment for this Oracle server. Source /opt/oracle/<SID>.env

6. Run sqlplus, and log on to Oracle. Sqlplus “/ as sysdba”

7. Stop the Oracle Server. Shutdown immediate;

8. Run the full restore script. /opt/nds/ora_rman/utils/run_full_restore.sh <DATABASE>

9. If you receive the following message, press ENTER to continue.

Page 15: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

Full Restore

Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 15

===============================================================================

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

===============================================================================

10. If the Red Hat Cluster Service for nds_oracle_$DATABASE_NAME is frozen, when you press ENTER, you will receive the following message:

===============================================================================

WARNING: Be Careful! This script will override all existing Database files

that may exist.

If the database is an Oracle RAC database, then first verify that all

of its instances on its nodes are DOWN

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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.

Force Database Shut Down.

===============================================================================

Error: The Oracle Instance $SID_NAME is running

Action: Please Stop the Oracle Instance and then rerun this script

===============================================================================

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.

Page 16: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

Full Restore

Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 16

To stop Oracle completely:

1. Run sqlplus, and logon to Oracle Sqlplus “/ as sysdba”

2. Shutdown Oracle Server. Shutdown abort;

3. Rerun full restore script like again. /opt/nds/ora_rman/utils/run_full_restore.sh <DATABASE>

4.2 Success or Failure of Full Restore 4.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”

2. Start the Oracle server. startup;

3. Unfreeze Oracle Server Service on any cluster node. clusvcadm -U nds_oracle_<SID>

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.

Page 17: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

Until Time Restore

Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 17

5 Until Time Restore This section describes how to perform a until time restoration of a database.

CAUTION!

Note Until Time restoration of a production database should be performed only by a company DBA.

5.1 Until Time Restore Procedure To perform a until time restoration of an Oracle database:

1. Log on to the server using UNIX user “root”.

2. Locate Oracle Server Service in the Linux RH5 cluster. clustat

3. Freeze Oracle Server Service on one any cluster node. clusvcadm -Z nds_oracle_<SID>

4. Log on to the server using UNIX user “oracle”.

5. Run environment for this Oracle server. Source /opt/oracle/<SID>.env

6. Run sqlplus, and log on to Oracle. Sqlplus “/ as sysdba”

7. Stop the Oracle Server. Shutdown immediate;

8. Run the full restore script. /opt/nds/ora_rman/utils/run_full_restore.sh –t <DATABASE>

9. If you receive the following message, press ENTER to continue.

Page 18: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

Until Time Restore

Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 18

===============================================================================

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

===============================================================================

10. If the Red Hat Cluster Service for nds_oracle_$DATABASE_NAME is frozen, when you press ENTER, you will receive the following message:

===============================================================================

WARNING: Be Careful! This script will override all existing Database files

that may exist.

If the database is an Oracle RAC database, then first verify that all

of its instances on its nodes are DOWN

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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.

Force Database Shut Down.

===============================================================================

Error: The Oracle Instance $SID_NAME is running

Action: Please Stop the Oracle Instance and then rerun this script

===============================================================================

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.

Page 19: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

Until Time Restore

Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 19

To stop Oracle completely:

1. Run sqlplus, and logon to Oracle Sqlplus “/ as sysdba”

2. Shutdown Oracle Server. Shutdown abort;

3. Rerun full restore script like again. /opt/nds/ora_rman/utils/run_full_restore.sh <DATABASE>

Until time Parameters:

12. For until time restore, you have to specify until what time to restore database.

===============================================================================

Important:

----------

When inputting a Date and Time for Database Restoration always specify exactly

4 digits for the year

2 digits for the month

2 digits for the day

2 digits for the hour, based upon a 24 hour clock

2 digits for the minute

2 digits for the second

Use leading zeros as required

===============================================================================

Please enter the year for the restoration (YYYY):

13. Specified until what year to restore (Four digits).

Please enter the month for the restoration (MM):

14. Specified until what month to restore (Two digits).

Please enter the day for the restoration (DD):

15. Specified until what day to restore (Two digits).

Until what hour to restore? (two digits 24 hour format):

16. Specified until what hour to restore (24 hour format – Two digits).

Until what minute to restore? (two digits):

17. Specified until what minute to restore (Two digits).

Until what second to restore? (two digits):

18. Specified until what second to restore (Two digits).

===============================================================================

Verification:

-------------

The restoration process will start restoring the database UPC until

20/03/2012 22:10:10

DD/MM/YYYY HH:MI:SS

Page 20: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

Until Time Restore

Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 20

In order to EXIT from this script, press Control C

In order to continue with the restoration, press ENTER

19. If everything is correct, press ENTER again to continue.

5.2 Success or Failure of 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”

2. Start the Oracle server. startup;

3. Unfreeze Oracle Server Service on one any cluster node. clusvcadm -U nds_oracle_<SID>

Page 21: Installation, Configuration and Invocation · PDF filePreface Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 4 1 Preface IMPORTANT! This Oracle RMAN

Until Time Restore

Oracle RMAN Backup Generic: Installation, Configuration and Invocation Guide Page 21

5.2.2 Failure ===============================================================================

ERROR: The restoration process has failed

CAUSE: No backup files prior to DD/MM/YYYY HH:MI:SS have been found

ACTION: Specify a date which is covered by the existing backup files or

Place the appropriate backup files in the location specified

by the parameter DIRECTORY_LOC_BACKUP which is found in the

configuration file

$ETC_DIR/$DATABASE_NAME.rman.config

===============================================================================

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.