Summary of Flash Recovery Area in RMAN Recipes

Source: Internet
Author: User

I recently read "RMAN Recipes for Oracle Database 11g". for more information about [RMAN Recipes for Oracle Database 11g pdf download] I am a foreigner, I will write down some of the important operations so that you can check them later. If it works well, I will make a summary after reading each chapter. I hope this will be helpful to Oracle backup and recovery beginners. If there are any errors in the notes, you are welcome to leave a comment. The first chapter, Backup and Recovery, describes the basic concepts of Backup and Recovery in detail, it includes the database fault type, several concepts of backup and recovery in Oracle, several best practices of Backup Type, recovery type, RMAN architecture, backup and recovery. Chapter 2 "Jump-Starting RMAN" is intended for friends who are familiar with RMAN. The author uses the simplest example to allow beginners to back up and restore data in a few times, this chapter includes connecting to the database, opening and closing the database, using the archive mode, connecting to RMAN, backing up the database, Restoring and Recovering database. These two chapters mainly refer to backup and recovery in terms of concept. We also give a few examples. You can understand them at a glance and I will not list them one by one. Next we will go to the topic. Chapter 3 "Using the Flash Recovery Area" discusses the Flash Recovery Area. I use examples to illustrate some concepts.

3-1.creating the Flash Recovery Area (create a Flash Recovery Area)

We can customize this flash recovery area. We have two questions before creating it. First, where should I create this flash recovery area? Second: How much crash recovery zone should I create?

If you have determined the answer, we can create it.

3.1.1 ensure that log_archive_dest and log_archive_duplex_dest are empty

You can show parameter log_archive_dest to check whether the two initialization parameters are empty. If they are not empty, then:

Alter system set log_archive_duplex_dest = '';

Alter system set log_archive_dest = '';

If you want to put the archive file in a custom path, you can use log_archive_dest_1,

Alter system set log_archive_dest_1 = 'location =/dbarch ';

Ensure that log_archive_dest is empty. For detailed parameter descriptions, see the Oracle online document Reference.

3.1.2 log on to the database as sysdba

Sqlplus/as sysdba or

Sqlplus sys/<PasswordOfUserSys> as sysdba

3.1.3 create a flash recovery area and specify the size

Alter system set db_recovery_file_dest_size = 4G; (the original file is incorrect, but file_dest is missing)

Alter system set db_recovery_file_dest = '/home/oracle/flasharea'; well, a flash recovery zone is specified. Remember, this/home/oracle/flasharea must exist, if the operating system does not have this directory, you must create a directory.

This flash recovery area will be used to store backup files in the future, so we 'd better not place the flash recovery area and database files on the same disk. If the disk is block, the flash back to the recovery zone is also a tragedy.

3-2Writing Regular RMAN Backups to the FRA (Regular backup in the Flash recovery area)

3.2.1 Start RMAN

$ Rman

Recovery Manager :......

RMAN>

3.2.2 connect to the target database

RMAN> connect target/

Connected to target database: prodbdbid = 524826567)

3.2.3 back up the database without specifying the path

RMAN> backup database;

......

From the information generated on the screen, we found that the database allocated a channel to back up the data files to the Flash recovery area, and the control file and spfile are also backed up together.

3-3Free FRA Space in an Emergency (release the flash recovery zone in an Emergency)

We sometimes have insufficient FRA space during backup. What should we do? There are three methods.

3.3.1 increase the space of the flash recovery zone

Alter system set db_recovery_file_size_size = 10G;

3.3.2 Delete useless Restore Points

Select name, storage_size from v $ restore_point;

Find useless Restore Points, and then

Drop restore point rp0;

3.3.3 disable the flash recovery area

I simply don't need to flash back to the recovery zone to Disable it.

Shutdown immediate

Startup mount

Alter database flashback off;

Now I can use rman to delete objects with ease and delete archivelog:

Rman> delete noprompt archivelog all;

Then open the database,

Alter database open;

Note that the database is not flashed back to the recovery zone.

3-4.Checking Space Usage in the FRA (check FRA Usage Space)

Several dynamic performance views are helpful to this problem. Let's take a look at how to query them.

SQL> select * from v $ flash_recovery_area_useage;

The column names clearly show the space occupied by various files. Note that the percentage is used. How can we see how much space is used? You can view the dynamic performance view v $ recovery_file_dest. We can also use FILE_TYPE to connect these two views to query the desired information.

3-5.Expanding or Shrinking the FRA (expanding or contracting FRA)

In fact, this section was mentioned at the time of creation,

SQL> alter system set db_recovery_file_dest_size = 2G;

This value depends on the actual situation.

3-6.Configureing Archived Redo Logs to Go to FRA (configure archive Logs for FRA)

We can put archive logs in other paths. This section describes how to configure logs in FRA. We have already done several steps in the book. I will skip these operations below.

3.6.1 use FRA as the archive path

Alter system set log_archive_dest_1 = 'location = USE_DB_RECOVERY_FILE_DEST ';

3.6.2 make sure the above path is available

SQL> show parameter log_archive_dest_state_1

The value must be ENABLE. Otherwise, this path cannot be used. If it is not ENABLE

Alter system set log_archive_dest_state_1 = enable;

3.6.3 check your settings

SQL> archive log list

3.6.4 switch logs to see if they are archived to the new directory

Alter system switch logfile;

The above is the basic operation. After the configuration is complete, you can query v $ archive_log to view the archive path.

3-7.Using the Same FRA for Two Database with the Same Name (Omitted, used later)

3-8.Placing a Control File in the FRA (put the Control File in FRA)

How are control files generally generated? First, it is generated when you create a database. You can also use an SQL script to recover the database. You can also find it in the backup file. In pfile, we usually see that a parameter specifies the path of the control file. Now, you must know how to set it. Just change the path in pfile.

3-9.Placing Online Redo Log Files in FRA (Set Online Redo Log in FRA)

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.