Oracle Fast Recovery Area By Manish Sharma

Configuration of Fast Recovery Area Might Sound Basic but believe me it’s the most important step that every DBA must carryout. I have seen many people avoiding this particular topic. Some courses don’t even include it. I don’t know why. But I think It’s a very crucial component of RMAN and that every DBA must know about it. Hence here we are. In this article I am not only going to teach you what it is but also show you how to configure it.

Why Configure The Fast Recovery Area (FRA)?

Configuring the Fast Recovery Area (FRA) should be the first step of your Database and recovery strategy. This is because FRA is the place, where Oracle Recovery Manager (RMAN) saves all the backups of the database and necessary configuration files along with metadata.

Improper configured FRA will cause error, which will lead to database backup failure. And, the backup failure is the nightmare of every DBA’s life.

That’s why I suggest you to carefully read this blog till the end. If you prefer learning through videos then I have done one for you, here it is –

How to configure Oracle Fast Recovery Area by Manish Sharma(YouTube Video)

Suggested Reading

Before you start learning about FRA I would suggest you to check out the previous blog which is a quick introduction to Oracle RMAN. Click here to read that blog.

Fast Recovery Area or Flash Recovery Area?

Before I tell you what Oracle FRA is let me first clear the confusion about its name. What does FRA stands for? Is it Fast recovery area or is it Flash recovery area?

Some books refer to Oracle FRA as fast recovery area whereas some refer to it as flash recovery area which creates confusion. (I won’t blame them because sometimes I too use these terms interchangeably. )

Actually, until Oracle 11gR1 Oracle FRA was known as Flash recovery area. But after that Oracle decided to change it from ‘flash’ to ‘fast recovery area’. Therefore, now a days its more commonly known as fast recovery area. But you can call it either fast or flash, whatever you feel comfortable with. It doesn’t really matter.

What is Oracle Fast Recovery Area?

FRA is nothing but a location somewhere on your disk where RMAN creates the copy of all the files of your database during backup. This location is managed by Oracle Database server.

Having a dedicated location for all the backups keep things organized. It also makes things a lot easier to handle for Oracle server as well as for a DBA.

When you run RMAN BACKUP command without specifying a backup destination, RMAN saves the backup in the Fast recovery area. But this happens only if FRA is correctly configured.

What does Fast Recovery Area Contain?

Fast recovery area contains all the necessary files that needs to be backed up for the smooth running of your database. You can see all these files in the FRA after you perform the first backup of your database.

Here is the list of all the contents that get saved in Fast Recovery Area by Oracle Recovery Manager (RMAN) –

  • Image Copies – Exact byte-for-byte copies of all the files of the target database
  • RMAN Backup Set – logical entities produced by the RMAN BACKUP command.
  • Data files
  • Archive Logs
  • Online Redo Logs
  • Flashback logs
  • Control files
  • Control file and spfile backup

In short you will find the backups of almost all the files and directories in the Fast Recovery Area.

Who Takes Care of Fast Recovery Area (FRA)?

Once you have configured the FRA then Oracle Server takes care of it. This is because Fast Recovery area is an Oracle Managed centralized storage location for backup and recovery files.

Advantages of Fast Recovery Area.

There are multiple advantages of Configuring Fast Recovery Area, such as –

  • Fast Recovery Area gives you the ability to Flashback the database.
  • Since FRA gives you a centralized location for all your backups thus it’s easier to manage them.
  • Since all the backups are stored in a centralized location thus database server doesn’t have to waste time in finding them which makes the recovery much faster.

Best Location For The Fast Recovery Area?

Ideally you should be creating your Oracle FRA on a separate storage device. If your production environment has a dedicated backup server then you must consider creating this directory there.

You should never loose the contents of this directory, so make sure to place it at the safest position in your production environment. Be it on a NAS drive or on a TAPE Cartridge.

What if FRA is Full?

Firstly if you are aspiring to become a DBA then you must learn that the capacity planning must always be performed before backup and recovery planning. We will talk about capacity planning in a separate tutorial in future. So make sure to subscribe to my YouTube channel and be the first one to get to know about the tutorial. Click here to checkout my YouTube channel.

Nevertheless, what if Fast Recovery Area is Full –

In that case what you can do is –

  1. Delete the obsolete backups.
  2. Delete The Expired Backups
  3. Delete old FRA log files
  4. Archive the old logs
  5. Increase the FRA size – Read down below to learn how to set the FRA size
  6. Set the Backup Retention Policy accordingly.

We will talk about Backup Retention Policy in a separate tutorial.

Anyways, How to deal with FRA errors is also on the list of tutorials for this Oracle RMAN series. Thus I will again suggest you to join me on my YouTube channel or Instagram to stay updated.

What is the Right Size of the FRA

It is really hard to give you a number and ask you to set the size of the FRA to that. Because the fast recovery area is directly proportional to the size of the target database. Even it will be somewhat larger than that.

I have set the size to 2GB for the demonstration. Ideally in production environment you should set the size of your Fast recovery area 5-to-10 times larger than the size of your database.

That makes sense, for example let’s say your database holds around 2GB of data . In this case, now think – why would someone want to set the size of the directory, which is going to hold the backup of this 2GB data to 1GB or 1.5GB. That’s never going to hold the full backup of the database.

So ideally you should set the size of your FRA to at least the size of your database. But it’s still not recommended.

Recommendation here is to set the size of your fast recovery area at least 5-10 times larger. Because RMAN always backs up the meta data and other configuration files along with the actual data of your database. And this meta data and configuration files also need some space. That’s why you should always set the size larger than the actual size of your database.

How To Check The Default Size & Location of Oracle FRA

By default both these parameters are set to nothing. Unless it was configured by OUI during the installation.

You can check the default Size and location of your Oracle FRA with the help of ‘ db_recovery_file_dest ‘ parameter. Like this –

First open up the command prompt and log onto your database using the sys user

   C:>sqlplus / as sysdba

Next, to check the values that are set on above mentioned parameters we just need to query the ‘ db_recovery_file_dest ‘ parameter like this –

   SQL> SHOW PARAMETER db_recovery_file_dest;

That’s all you have to do. Just press enter and you will see the results.

How To Configure Fast Recovery Area?

In this demonstration I will be using Oracle Database 19c. This process is valid for almost all the oracle database versions that are available hence you can still follow the steps. You can click here to learn how to install Oracle Database 19c on Windows Operating System.

Step 1: Create a Directory

First decide a location for your FRA on your system. As I said earlier it could be on your local machine or on a remote backup server. Once you have done that, then create a directory there. You can name it whatever you want.

For the demonstration I have created a directory in my D:/ drive and named it ‘Oracle_FRA’.

Step 2: Parameter Configuration

To configure the Oracle FRA we need to set two parameters. These are –

  1. db_recovery_file_dest_size, and
  2. db_recovery_file_dest

The first parameter is used for setting the maximum disk size for your FRA. Using it you set how much space your FRA can take on your hard drive.

And, the second parameter is used for setting the location of your fast recovery area. Whatever directory path you will set in this parameter will be used by RMAN to save all the backups. In our demonstration that path will be ‘D:\Oracle_FRA’.

Process of configuring Oracle Fast Recovery Area –

#Log into your Oracle Database using Sys User. 
#I am using Command Prompt as a preferred tool for this process 

C:\>SQLPLUS / AS sysdba

#First Set the size for Oracle FRA directory
#For the demonstration I am allocating 2GB to my FRA directory.
#Please refer to the 'What is the Right Size of the FRA' section above.

SQL/> alter system set db_recovery_file_dest_size = 2G SCOPE = BOTH;

#Now Set The Oracle FRA location

SQL/> alter system set db_recovery_file_dest = 'd:/Oracle_FRA' SCOPE = BOTH;

Oracle FRA location Is Dependent on Oracle FRA Size

In the comments of the above code block, I clearly said that ‘First Set the size for Oracle FRA directory’. This is because the parameter db_recovery_file_dest is dependent on the first one db_recovery_file_dest_size. Which means without setting db_recovery_file_dest_size you cannot set db_recovery_file_dest. Doing so will raise an error. So always make sure to specify the size for your Oracle FRA first.

How to check FRA size?

How to check, what is the maximum size that has been allocated to a FRA and how much has been consumed? Is the most asked question on my Instagram. So here I am going to answer it once and for all –

You can find the maximum size of your FRA and the amount of space that has been used by writing a simple query against v$recovery_file_dest dynamic view.

SQL> SELECT name, space_limit , space_used FROM v$recovery_file_dest

This view can give you all the information about the disk quote and the disk usage of your Oracle Fast recovery area.

The information that v$recovery_file_dest can give you is –

  1. Location of the FRA
  2. Maximum amount of disk space allocated to FRA.
  3. Amount of disk space used by Fast recovery area. This amount will be in bytes
  4. The amount of disk space that you can reclaim.
  5. Number of files stored in Flash recovery area.

If you are planning to be a DBA then this dynamic performance view is your best friend.

How To Disable Oracle Fast Recovery Area?

Disabling Oracle Fast Recovery Area is very simple. You just have to change the value of ‘db_recovery_file_dest’ parameter to an ’empty string’, that will reset the parameter to it’s default value. However you cannot reset ‘db_recovery_file_dest_size’ to it’s default value. However you can reduce the size to 1byte.

#Disable the fast recovery area 
#Reset the db_recovery_file_dest parameter

SQL/> alter system set db_recovery_file_dest = '' SCOPE = BOTH;

#Reduce the size of db_recovery_file_dest_size parameter to 1byte

SQL/> alter system set db_recovery_file_dest_size = 1 SCOPE = BOTH;

That’s it for this tutorial. You can also watch the video on my YouTube channel on the same topic for the real time demonstrations. Thanks and have a great day.