Oracle RMAN settings and configuration (1)

Source: Internet
Author: User

1. Configure the database to run in ARCHIVELOG Mode

Before ORACLE 10 Gb, you must start the arch process after placing the database in Archivelog mode. Set LOG_ARCHIVE_START to true, or start the arch process. In

This method is not required after 10 Gb. When the database is in archivelog mode, Oracle automatically starts the arch process.

The Arch process is called by the LGWR process, as long as an online redo log is filled up. The LGWR process switches to another online redo group. If the database is in archivelog mode,

The LGWR process also notifies ARCH to wake up the process and start working. The location or definition defined by the ORACLE database parameter LOG_ARCHIVE_DEST_n

Generate a copy of the online redo log in the Flash recovery area. Oracle can reuse this redo log file only after the arch process has created an archived redo log copy.

Oracle10g provides two different locations for saving archive logs: The ArchiveLog target directory and the flash back area.


1.1 ArchiveLog target directory

You can use the LOG_ARCHVEI_DEST_n parameter to define 10 different log archiving targets. These directories can be local directories and network directories.

The following describes some parameters:

(1) LOG_ARCHIVE_STAT_n parameter: this parameter defines two different States for each archive log: ENABLE and DEFER. If it is ENABLE, the archive directory is valid. If it is

If DEFER is specified, LOG_ARCHIVE_DEST_n is not archived.

(2) LOG_ARCHIVE_FORMAT parameter: When Oracle creates an archive log, it renames the archive log according to the format specified by the parameter.

(3) LOG_ARCHIVE_MIN_SUCCEED_DEST: Allows DBA to define the minimum data of the target log copy. These copies must be successful. In this way, Oracle can reuse the associated redo

Online log.

(4) LOG_ARCHIVE_START: this parameter is no longer used in 10 Gb. You can automatically start the ARCH process.


1.2 flash recovery zone

Flash recovery FRA) allows centralized storage of all recovery-related files. FRA can locally use additional storage. The Oracle cluster File system is Oracle File system: OCFS.

) Or the New Automatic Storage Management (ASM) feature in Oracle 10g. Backup file types in FRA: Archived redo logs, control files, and automatic backup of control files. Flash Back log, redo

Logs, copies of RMAN data files, RMAN backups, and other related files.

FRA helps manage all disk space allocations and provides centralized storage areas for all recovery-related ELE. Me files. FRA also provides faster backup and recovery operations.

The retention of files in FRA is determined by the RMAN storage policy. Run the RMAN config retention policy command to set the policy. If the file is not out of date under the RMAN Storage Policy

Will not be deleted. If the archived logs are out of date, they can be deleted.

FRA is created in a specific location defined by the DB_RECOVERY_FILE_DEST parameter. This location can be a file system or ASM volume. The DB_RECOVER_FILE_DEST_SIZE parameter is used to define

The maximum FRA size. This is the limitation of the file space controlled by Oracle, and it has nothing to do with all the available space in the file system itself. Oracle monitors available space in FRA, once

When the amount of data in the space is reduced to an insecure level, Oracle generates a warning in the alarm log 90% when used, and generates a warning again when 95% is used ). Similarly, when

If the free space in FRA is less than 10%, Oracle will delete files in the obsolete file list.

If the flash recovery area is the only archiving target, the space in FRA will be very troublesome when it is used up, which may cause the database to terminate abnormally. Therefore, if only a unique archiving directory is set, you should

Carefully monitors space availability. To put it simply, there are several methods:

1) Add DB_RECOVERY_FILE_DEST_SIZE.

2) use rman backup recovery area. Move the FRA content to another location.

3) Physically Delete the earlier backup, and then use the RMAN crosscheck command to let the database recognize the deleted files.


1.3 views related to the Flash recovery zone

1) DBA_OUTSTANDING_ALERTS

When files are added and deleted in FRA, the records of these events are recorded in the database warning log. You can use this view to learn more about some notable issues of FRA. Note: space phase

There is a certain degree of latency between the time when the problem occurs and the time when the warning log is in this view.

SQL> select reason from dba_outstanding_alerts;

REASON

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

Db_recovery_file_dest_size byte (4039114752 bytes in total) is 100.00%, and 0 bytes are available.

2) v $ recovery_file_dest

This view provides the concept of defining FRA in the database. The configured FRA size, the amount of space used, the amount of space that can be recycled, and the number of files in FRA are provided.

SQL> select * from v $ recovery_file_dest;

NAME SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES

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

D:/app/Administrator/flash_recovery_area 4039114752 4005191680 0 85

If SPACE_RECLAIMABLE is not 0, it indicates that there are recoverable files in FRA. If you need this space, you can force log switching. It will delete any files that can be recycled and release the space.

SQL> alter system switch logfile;

The system has been changed.

3) v $ flash_recovery_area_usage

This view provides detailed information about the file types that occupy FRA space. This view combines file types, and then provides the percentage of space used by each file type, from the total number

FRA recoverable space percentage and the number of files in FRA from this group.

SQL> select * from v $ flash_recovery_area_usage;

FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES

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

Control file 0 0 0

Redo log 0 0 0

Archived log 99.16 0 85

Backup piece 0 0 0

Image copy 0 0 0

Flashback log 0 0 0

Foreign archived log 0 0 0

You have selected 7 rows.

Other views that contain the FRA Column

The IS_RECOVERY_DEST_FILE view can be found in many 10 Gb views, for example:

V $ CONTRILFILE, V $ LOGIFLE, V $ ARCHIVEC_LOG, V $ DATAFILE_COPY, V $ DATAFILE, V $ BACKUP_PIECE.

This column is a Boolean value used to indicate whether the file is located in FRA.

Another BYTES column can be found in V $ BACKUP_PIECE and RC_BACKUP_PIECErman Restore directory view. This column indicates the size of the Backup set in BYTES.

Other flash recovery zone features

In Oracle 10g, if the DB_CREATE_ONLINE_LOG_DEST_n Parameter Related to OMF is not set, alter database add logfile and alter database add standby

The logfile command creates a connection redo log member in FRA. The Alter database drop logfile and alter database rename file commands also support files in FRA.

During database creation, Oracle can use FRA to store Database Control Files and online redo logs. If the OMF parameter DB_CREATE_ONLINE_LOG_DEST_n is defined

Control Files and redo logs will be created in these locations, but not in FRA, even if FRA is defined. If DB_CREATE_ONLINE_LOG_DEST_n is not defined

CREATE_FILE_DEST: Create a copy of the control file and online redo log at the location defined by CREATE_FILE_DEST. Finally, if DB_RECOVERY_FILE_DEST is defined

Create a control file at this location. If none of these parameters are defined, the control file and online redo log will be created in the default OS location.

FRA and ASM

RMAN supports Automatic Storage Management (ASM) to store RMAN backups. ASM is a disk management tool. With this tool, DBA no longer needs to manage physical files associated with a given database. ASM in

To some extent, it is similar to a logical volume group that can be used in UNIX. ASM uses an ASM disk group, which is stored in a logical unit. The physical disk is allocated to the ASM disk group and the ASM

The overall storage function of the disk group. The ASM disk can exist in the previously allocated file system or be stored on the RAW disk. In combination with OCFS, cluster servers can share

ASM disk. Configure ASM and define various disk combinations to allocate data files, control files, online redo logs, and various RMAN backup files to the ASM disk group.

ASM provides a large number of features, including load balancing and data redundancy, and it is easy to add and delete new disks in the ASM disk group. RMAN supports ASM disk groups, but for most non-RAC sites

Using ASM is of little value.

1.4 Should FRA be used?

We think that the idea behind FRA is excellent. We also like to copy backups to other media, such as tapes, so that they can be used offline for disaster recovery.

We like to use FRA for archiving redo logs, but still like to copy archived redo logs to multiple locations, specifically multiple disks ). Archived redo logs are critical for database recovery.

Yes. If an archived redo log is lost, all other redo archives after the redo log will have almost no value. Because we tend to use

The LOG_ARCHIVE_DEST_n parameter is used to configure the database, and FRA and another independent file system are used to store archived redo logs.

1.5 switching between ARCHIVELOG Modes


Ii. RMAN command line

There are two different methods to enter RMAN: Command Line and OEM.


2.1 connect through RMAN command line

Run the rman command at the OS prompt to Start RMAN. Once the RMAN command interpreter is started, you can perform any required operations.

RMAN always connects to the target database as SYSDBA, so the connection account must have SYSDBA permissions. For detailed usage, refer to help:

C:/Users/Administrator. David Dai> rman help

Parameter value description

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

Target string enclosed in quotation marks: connection string of the target database

Directory string enclosed in quotation marks restore the connection string of the Directory

Nocatalog none if specified, the directory is not restored

The name of the string input command file enclosed in quotation marks

Name of the log file output by a string enclosed in quotation marks

Name of the log file that outputs debugging information by following the string enclosed in quotation marks

If no append is specified, logs are opened in append mode.

Debug optional parameter activation debugging

Msgno does not display the RMAN-nnnn prefix for all messages.

Send a quoted string to send the command to the Media Manager.

Build block of pipe string pipeline name

Timeout INTEGER: the number of seconds to wait for pipeline Input

Checksyntax does not check syntax errors in the command file

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

Single quotation marks and double quotation marks ('or ") can be used as strings with quotation marks.

No quotation marks are required unless the string contains spaces.


2.2 Use The RMAN connet command

If RMAN is started and the database is not connected to the correct database, or you want to connect to a different database target database, directory database, or secondary database, you can use connect

Command to change the database to which RMAN connects. The connect target command can be used to connect to a different target database. The connect catalog command can be used to connect to different

Restore the Directory and use the connect auxiliary Command to connect to a different secondary database.

Connect target sys/pwd @ sid

Connect catalog user/pwd @ sid

2.3 exit the RMAN Client

There are two RMAN exit commands: quit and exit.


Oracle video tutorial follow: http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.