What is difference between Flash Recovery Area and Flashback Database?


What is difference between Flash Recovery Area and Flashback Database?

About Flash Recovery Area

The flash recovery area is a directory on the storage that provides a centralized disk location for backup and recovery files. The directory location is specified by parameter DB_RECOVERY_FILE_DEST and the size of the recovery area is defined by parameter DB_RECOVERY_FILE_DEST_SIZE. If log_archive_dest_* is set to USE_DB_RECOVERY_FILE_DEST then Oracle creates archived logs in the flash recovery area. RMAN can also store its backups in the flash recovery area ( and stores the backups in FRA by default), and it uses it when restoring files during media recovery.

All files necessary to recover the database following a media failure are located in the flash recovery area ( if defined ).

The flash recovery area also acts as a disk cache for tape. The recommended strategy is store the backups in the FRA, to have more recent backups available on disk, then the backup and restore processes will be faster.

About Flashback Database

Flashback database is a new feature introduced in 10g.

It provides a way to quickly revert entire Oracle database to the state it was in at a past point in time. Also it is possible to bring a single table back in time.

Flashback database is different from traditional point in time recovery. To Flashback a database, Oracle uses older block images to back out changes to the database, what means that the oracle blocks are being overwritten for its before images to bring the database back in time.

If flashback database feature is enabled, during normal database operation, Oracle creates the Flashback logs, where the before image of the database blocks is stored previously to applying any change in this database blocks.

The following recovery-related files are stored in the flash recovery area:

— Current control file

— Online redo logs

— Archived redo logs

— Flashback logs

— Control file autobackups

— Datafile and control file copies

— Backup pieces

— Foreign archived redo log ( An archived redo log received by a logical standby database for a LogMiner session.)

Oracle automatically creates, deletes, and resizes Flashback logs in the flash recovery area. You only need to be aware of Flashback logs for monitoring performance and deciding how much disk space to allocate to the flash recovery area for Flashback logs.

Flashback Database is not true media recovery, because it does not involve restoring physical files. However, Flashback is preferable to using the RESTORE and RECOVER commands in some cases, because it is faster and easier, and does not require restoring the whole database.

You can limit the number of flashback logs stored by defining the parameter:

– DB_FLASHBACK_RETENTION_TARGET (dynamically modifiable) which defines the upper limit in minutes on how far back one can flashback the database.

Note that, you cannot manually delete the flashback logs, you need to turn flashback database off to delete the flashback logs.

Oracle Concepts – Database Files


Oracle Database Files Concepts

The final components of the Oracle architecture are the physical files where our information resided on disk. Oracle has several types for data files, each for a different purpose:

* Database datafiles

* Control files

* Online redo logs

* Parameter files

* Other database related files

Let’s look at each of these physical files in a bit more detail.
Database datafiles

Database datafiles are physical files stored on disk. These files are used to store data on disk. Database datafiles are only written to by the DBWR processes that we introduced you to earlier (there is an exception or two to this statement, but for now, assume that this point this true).

These database datafiles are associated with Oracle “tablespaces”, which are “logical” containers for tables and indexes.
Control files

The Control File of the database is a binary file that contains a great deal of database information. The control file contains the database name, data about the database log files. Oracle cannot function without valid control files.

Because the control file is so important, Oracle allows you to maintain duplicate copies of the control file. When you have more than one control file, then you are said to be multiplexing your control files. It is a good practice to put these multiple copies on different disks to protect the control file. Later in this book, we will demonstrate how to do this.
Online redo logs concepts

Think of the online redo logs like a tape recorder that records every change in the Oracle database. As changes occur, they are regularly recorded in the online redo logs, just like you might record a movie on your VCR.

In the event that a disk crashes, you may have to replace the disk and restore the disk data from a backup tape. If this backup tape was several days ago, you have lost a lot of data.

Fortunately, Oracle can “replay” the saved transactions in the online redo logs, and re-apply lost transactions back into the database. Many times, this means that Oracle can recover from a crash without the DBA having to do anything other than just telling the database to startup. We will cover the topic of online redo log files and how they relate to database recovery in later chapters of this book.

At a minimum, Oracle requires that you have two online redo logs assigned to the database. Oracle will write redo to the first log, and when the first log is full, Oracle will switch to the second log and write the same redo. Each of these individual online redo logs is known as an online redo log group.

The reason we call them groups is that there can be mirrored copies of the online redo log files in each group. Like control files, it’s a good idea to have multiplexed copies of the Online redo logs. Oracle allows you to define multiple copies of these files. Each copy is called a member. Each redo log group can have one or more members. We will discuss the online redo log files in more detail in later chapters.
Oracle Parameter file Concepts

The parameter file (sometimes called init.ora) contains configuration information for the database to use at startup time. The parameter file you configure how much RAM the database is going to use, where to find the control files, where to write trace files, and a whole host of other information. In most cases the database will not start without a parameter file. Oracle allows you to have a manual parameter file (called a PFILE) or a server-side parameter file (called a SPFILE).
Other Database Related Files

When working with the Oracle database you will be introduced to a number of different kinds of files. The following table is a list of the most common files and their general purpose. As we proceed through the chapters of this book, you will be introduced to many of these files in more detail.

* Oracle Trace Files – Created by Oracle in a number of different situations. These can be created as a result of a database crash, a session failure, an unexpected but non-fatal database failure, or based on specific user operational commands.

* Alert log – This is the general log file for each Oracle database.

*Networking configuration files – These files are used to configure the different network components of the Oracle database. These include files such as tnsnames.ora and listener.ora.

* Oracle Database Software Binaries – The Oracle Database software includes the basic programs that allow the database to function.

 

Source : Internet

LOGICAL STRUCTURE OF DATABASE


Logical structure mainly consists of tablespace, segments, extents, and oracle data blocks

TABLESPACE

Each database is logically divided into one or more tablespaces. One or more datafiles are explicitly created for each tablespace to physically store the data of all logical structures in a tablespace. The combined size of the datafiles in a tablespace is the total storage capacity of the tablespace.

SEGMENT

A segment is a set of extents allocated for a certain logical structure. The segments can be of one of following type data segment,index segment,temporary segment,rollback segment.

EXTENT

The next level of logical database space is an extent. An extent is a specific number of contiguous data blocks, obtained in a single allocation, used to store a specific type of information.

ORACLE DATA BLOCKS

At the finest level of granularity, Oracle database data is stored in data blocks. One data block corresponds to a specific number of bytes of physical database space on disk. The standard block size is specified by the DB_BLOCK_SIZE initialization parameter. In addition, you can specify up to five other block sizes.