6 Administering Backup and Recovery, backupandrecovery
Oracle Database 2 Day + Real Application Clusters Guide
11g Release 2 (11.2)
E17264-13
6 Administering Backup and Recovery
Overview of Oracle RAC Database Backup and Recovery
Note:
For the RMAN utility to work properly on Linux platforms, the $ ORACLE_HOME/bin directory must appear in the PATH variable before the/usr/X11R6/bin directory.
The Enterprise Manager Guided reded capability provides a Recovery Wizard that encapsulates the logic required for a wide range of file restoration and Recovery scenarios, including the following:
Complete restoration and recovery of the database
Point-in-time recovery of the database or selected tablespaces
Flashback Database
Other flashback features of Oracle Database for logical-level repair of unwanted changes to database objects
Media recovery at the block level for data files with your upt blocks
If the database files are damaged or need recovery, then Enterprise Manager can determine which parts of the database must be restored from a backup and recovered, including early detection of situations such as your upted database files. enterprise Manager guides you through the recovery process, prompting for needed information and discovery the required recovery actions.
Note: On linux, $ ORACLE_HOME/bin must be defined in PATH to ensure normal RMAN functions, and must be prior to/usr/X11R6/bin, remember !!!
About the Fast Recovery Area in Oracle RAC
Using a fast recovery area minimizes the need to manually manage disk space for your backup-related files and balance the use of space among the different types of files. oracle recommends that you enable a fast recovery area to simplify your backup management.
The larger the fast recovery area is, the more useful it becomes. Ideally, the fast recovery area shoshould be large enough to contain all the following files:
A copy of all data files
Incremental backups
Online redo logs
Archived redo log files that have not yet been backed up
Control files and control file copies
Autobackups of the control file and database initialization parameter file
The fast recovery area for an Oracle RAC database must be placed on an Oracle ASM disk group, a cluster file system, or on a shared directory that is configured through a network file system file for each Oracle RAC instance. in other words, the fast recovery area must be shared among all of the instances of an Oracle RAC database. the preferred configuration for Oracle RAC is to use Oracle Automatic Storage Management (Oracle ASM) for storing the fast recovery area, using a different disk group for your recovery set than for your data files.
The location and disk quota must be the same on all instances. oracle recommends that you place the fast recovery area on the shared Oracle ASM disks. in addition, you must set the DB_RECOVERY_FILE_DEST and DB_RECOVERY_FILE_DEST_SIZE parameters to the same values on all instances.
To use the fast recovery feature, you must first configure the fast recovery area for each instance in your Oracle RAC database.
---- Oracle strongly recommends placing the fast recovery area on the shared ASM disk and setting the same DB_RECOVERY_FILE_DEST and DB_RECOVERY_FILE_DEST_SIZE parameters for all instances.
Archiving the Oracle Real Application Clusters Database Redo Logs
To make your data highly available, it is important to configure the database so you can recover your data after a system failure. redo logs contain a record of changes that were made to datafiles. redo logs are stored in redo log groups, and you must have at least two redo log groups for your database.
After the redo log files in a group have filled up, the log writer process (LGWR) switches the writing of redo records to a new redo log group. oracle Database can automatically save the inactive group of redo log files to one or more offline destinations, known collectively as the archived redo log (also called the archive log ). the process of turning redo log files into archived redo log files is called archiving.
When you archive your redo log, you write redo log files to another location before they are overwritten. this location is called the archived redo log. these copies of redo log files extend the amount of redo data that can be saved and used for recovery. archiving can be either enabled or disabled for the database, but Oracle recommends that you enable archiving.
About Archived Redo Log Files for an Oracle RAC Database
When you use Oracle Database Configuration Assistant (DBCA) to create your Oracle Real Application Clusters (Oracle RAC) database, each instance is configured with at least two redo log files that are stored in the shared storage area. if you have a two-node Oracle RAC database, then at least four redo logs are created for the database, two for each instance.
If you use a cluster file system to store the archived redo log files for your Oracle RAC database, then the redo log files are shared file system files. if you use Oracle ASM to store the archived redo log files for your Oracle RAC database, then each instance automatically has access to all the archived redo log files generated by the database. if you use shared storage or raw devices to store the archived redo log files on each node, then you must configure the operating system to grant access to those directories for each instance of the cluster database that needs access to them.
The primary consideration when logging ing archiving is to ensure that all archived redo logs can be read from every node during recovery, and if possible during backups. during recovery, because the archived log destinations are visible from the node that performs the recovery, Oracle RAC can successfully recover the archived redo log data. for creating backups of your Oracle RAC database, the strategy that you choose depends on how you configure the archiving destinations for each node. whether only one node or all nodes perform archived redo log backups, you must ensure that the archived redo logs for every instance are backed up.
To backup the archived redo logs from a single node, that node must have access to the archived log files of the other instances. the archived redo log naming scheme that you use is important because when a node writes to a log with a specific filename on its file system, the file must be readable by any node that must access this archived redo log. for example, if node1 archives a log to/oracle/arc_dest/log_0000100_23452345.arc, then node2 can back up this archived redo log only if it can read/oracle/arc_dest/log_0000100_23452345.arc on its own file system.
About Parallelism and Backups internal SS Multiple RMAN Channels
Recovery Manager (RMAN) depends on server sessions, processes that run on the database server, to perform backup and recovery tasks. each server session in turn corresponds to an RMAN channel, representing one stream of data to or from a backup device. RMAN supports parallelism, which is the use of multiple channels and server sessions to perform the work of a single backup job or file restoration task.
Because the control file, SPFILE, and data files are accessible by any instance, the backup operation of these files is distributed guest SS all the allocated channels. for backups of the archived redo log, the actions stored med by RMAN depend on the type of archiving scheme used by your Oracle RAC database.
If you use a local archiving scheme, then each instance writes the archived redo log files to a local directory. when multiple channels are allocated that have access to the archived redo log, for each archived redo log file, RMAN determines which channels have access to that archived redo log file. then, RMAN groups the archived redo log files that can be accessed by a channel and schedules a backup job using that channel.
If each node in the cluster writes the archived redo log files to Oracle ASM, a clustered file system, or other type of shared storage, then each instance has access to all the archived redo log files. in this case, the backup of the archived redo log is distributed distribute SS all the allocated channels.
Logging ing Archiving for Your Oracle RAC Database
For Oracle RAC, each instance has its own thread of redo. the preferred configuration for Oracle RAC is to configure the fast recovery area using an Oracle ASM disk group that is separate from the Oracle ASM disk group used for your data files. alternatively, you can use a cluster file system archiving scheme.
To configure archiving for your Oracle RAC database:
On the Database Home page of Enterprise Manager Database Control, while logged in as a SYSDBA user, select Availability.
The Availability subpage appears.
In the Backup/Recovery section, under the heading Setup, select Recovery Settings.
The Recovery Settings page appears.
In the Media Recovery section, select the ARCHIVELOG mode option.
In the Log Archive Filename Format field, accept the default value, or enter the desired format.
For clustered databases, the format for the archive log file name shoshould contain the % t modifier, to indicate which redo log thread the archived redo log file belongs. as a best practice, the format for the archive log file name shocould also include the % s (log sequence number) and % r (resetlogs identifier) modifiers.
If the archive log destination is the same for all instances, then in the Archive Log Destination field, change the value to the location of the archive log destination for the cluster database.
For example, you might set it to + DATA if using Oracle ASM, or to/u01/oradata/arch if you want local archiving on each node.
If you must configure a different archive log destination for any instance, then you must go to the Initialization Parameters page and modify the LOG_ARCHIVE_DEST_1 parameter that corresponds to the instance for which you want to configure the archive log destination. the Instance column shoshould display the name of the instance, for example sales1. Change the Value field to contain the location of the archive log destination for that instance.
About logging ing Access to the Archive Log
During recovery, because the archive log file destinations are visible from the node that performs the recovery, Oracle RAC can successfully access the archived redo log files during recovery.
If you do not use shared storage or a clustered file system to store the archived redo log files for your cluster database, then you must make the archived redo log files available to the node discovery the recovery.