Beruflich Dokumente
Kultur Dokumente
racle RMAN
One (if not the, most important) jobs of the Oracle DBA is to ensure that the databases in their care are protected. Databases, or data in the database,
can be lost through a variety of ways including:
* User error
* Hardware failure
* Software failure
* Disasters
* Application errors
To protect your database, you will need to know how to back it up and you will need to know how to recover your database. Backup and recovery is
what this last chapter is all about. Backup and recovery can be a very difficult and complex topic, for there are a number of different options for you
to choose from when it comes to backing up a database. In this chapter, we aim to set you on the right course, showing you how to perform basic
database backup and recovery operations.
In this chapter we will use the Oracle RMAN tool. It comes with the Oracle RDBMS and it?s free. In this chapter we will cover:
So, without further delay, let?s get started on getting your database backed up.
Starting RMAN
The RMAN client is started from the operating system prompt. To use RMAN, simply set the Oracle environment as you would before you use any
other Oracle client (like SQL*Plus). Once the environment is set, then you start RMAN as seen in this example:
rman target=/
Once you have started RMAN you will find yourself at the RMAN prompt. We are then ready to begin our database backup.
http://www.dba-oracle.com/concepts/rman.htm 1/3
27/11/2017 RMAN Tips
Before we can use RMAN we need to configure a few settings. In this section we will look at configuring the database for our backup, and then we
will proceed to do the backup.
1. That you will be backing up to a file system called /u01/app/oracle/backup. You will need to create this file system if it does not already exist.
Note that if you created your database as we described earlier in the book, you should already be using an SPFILE.
The configuration is pretty basic. First, we need to configure a couple of database parameters. These parameters will configure the Flash Recovery
Area of the database.
This is the location that all the disk backups will be made to. To configure the flash recovery area we will use the alter system command to set the
value of two database parameters:
* db_recovery_file_dest_size ? Determines how much space can be used by Oracle in the flash recovery area.
We will configure the flash recovery area to the value of /u01/app/oracle/backup, and we will assign it a 2 Gigabyte limit. Note! Oracle flash
recovery area re-named to fast recovery area
You may need to assign your flash recovery area more space depending on the following factors:
* If you are running your database in ARCHIVELOG mode (which we will discuss later in this chapter).
Here is an example of configuring the flash recovery area for the settlings listed previously. This assumes your database is using a SPFILE which we
discussed in earlier chapters:
Alter system set db_recovery_file_dest=?/u01/app/oracle/backup?;
http://www.dba-oracle.com/concepts/rman.htm 2/3
27/11/2017 RMAN Tips
Alter system set db_recovery_file_dest_size=2G;
We will also want to set a couple of RMAN settings before we do our first backup. Start RMAN as detailed earlier in this section with:
$ rman target /
Next, we can use the RMAN configure command to configure these settings as seen in this example:
-- Configure the retention policy to redundancy of 2.
-- This means RMAN will try to keep 2 copies of the database backups.
Now that RMAN and the database are configured, we are ready to proceed to backup the database.
Also, see my notes on the different backup types and the differences betweenincremental cumulative and incremental differential backups.
http://www.dba-oracle.com/concepts/rman.htm 3/3