How To Backup Oracle Database Using RMAN (With Examples)
How To Backup Oracle Database Using RMAN (With Examples)
Even if you are not an Oracle DBA, you’ll still encounter a situation where you
may have to take a backup of an Oracle database. EBOOKS
Using Oracle RMAN, you can take a hot backup for your database, which will take Linux 101 Hacks 2nd Edition eBook - Practical
Examples to Build a Strong Foundation in Linux
a consistent backup even when your DB is up and running.
Bash 101 Hacks eBook - Take Control of Your Bash
Command Line and Shell Scripting
This tutorial gives you an introduction on how to perform Oracle DB backup using
RMAN. Sed and Awk 101 Hacks eBook - Enhance Your
UNIX / Linux Life with Sed and Awk
Before we modify any configuration, execute the following command to view all
current RMAN configuration settings.
To connect to RMAN, do the following from command line. This will take you to
RMAN> command prompt, from here you can execute all RMAN commands.
POPULAR POSTS
$ rman target / 15 Essential Accessories for Your Nikon or Canon
Recovery Manager: Release 10.2.0.3.0 - Production on Sat Aug 10 11:21:29 2013 DSLR Camera
Copyright (c) 1982, 2005, Oracle. All rights reserved. 12 Amazing and Essential Linux Books To Enrich
connected to target database: DEVDB (DBID=821773) Your Brain and Library
RMAN> SHOW ALL; 30 Things To Do When you are Bored and have a
Computer
using target database control file instead of recovery catalog
RMAN configuration parameters are: Linux Directory Structure (File System Structure)
Explained with Examples
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 2 DAYS;
Linux Crontab: 15 Awesome Cron Job Examples
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; Get a Grip on the Grep! – 15 Practical Grep
Command Examples
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO "/backup/rman/ct Unix LS Command: 15 Practical Examples
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 2; 15 Examples To Master Linux Command Line
History
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; Top 10 Open Source Bug Tracking System
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT "/backup/rman/full_%u_%s_%p" MAXPIEC Vi and Vim Macro Tutorial: How To Record and
CONFIGURE MAXSETSIZE TO UNLIMITED; Play
CONFIGURE ENCRYPTION FOR DATABASE OFF; Mommy, I found it! -- 15 Practical Linux Find
Command Examples
CONFIGURE ENCRYPTION ALGORITHM 'AES128';
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; 15 Awesome Gmail Tips and Tricks
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/10.2.0/dbs/snapc 15 Awesome Google Search Tips and Tricks
As you see above, it displays various RMAN parameters and their current values. Can You Top This? 15 Practical Linux Top
Command Examples
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/backup/rman/full_%u_%s_%p'; Turbocharge PuTTY with 12 Powerful Add-Ons
..
CATEGORIES
Linux Tutorials
Clear a Parameter: If you want to clear a parameter and set its value to default, Vim Editor
use CLEAR at the end of the configuration as shown below. Sed Scripting
Awk Scripting
Nagios Monitoring
In this example, since we cleared the retention policy’s value, it was set to the OpenSSH
default value, which is 1. So, the retention policy is set to 1 day as shown below. IPTables Firewall
Google Tutorials
Ubuntu Tutorials
3. Backup Oracle Database PostgreSQL DB
Make sure the directory mentioned in the CHANNEK DEVICE TYPE DISK Hello World Examples
FORMAT is created. i.e /backup/rman/ C Programming
C++ Programming
Oracle Database
Currently this directory is empty. We’ll see what this has after the backup is taken. VMware Tutorials
$ ls -l /backup/rman
total 0
RMAN stores the backup in backup sets, which are nothing but whole bunch of
files which contains the backed-up data. Only RMAN understands the format of
these files. So, if you backup an Oracle DB using RMAN, only RMAN knows how
to read the backup and restore it.
To take a full backup of the database with the archive logs, do the following:
You can also take a backup of only a specific table space. The following example
takes backup of only PRD01 tablespace.
$ ls -l /backup/rman
total 14588
Note: Once a backup is taken, to view all available database backups from RMAN,
you need to use “list” command that is shown further down in one of the
examples.
While this may be obvious, it is worth repeating again: Since we are taking
hotbackup, the Oracle database can be up and running. Make sure your Oracle
database is running before you execute any of the above RMAN backup
commands.
Once the backup is finished, if you view the files from rman directory, you’ll not
see the tag name here. Tag name is used only from RMAN repositories to view and
restore backups. So, now you see there are more files in this directory, as we’ve
taken couple of backups.
$ ls -l /backup/rman/
total 29176
Now when you view the RMAN files, you’ll see the new RMAN backup file has this
new file name format for the files. This is easier to identify certain information
about the backup just by looking at the file names.
$ ls -l /backup/rman/
total 43764
-rw-r----- 1 oracle dba 14585856 Aug 8 11:48 ctl_c-758818131-20130808-00
-rw-r----- 1 oracle dba 14585856 Aug 8 11:54 ctl_c-758818131-20130808-01
So, for most situation, you should always tak ea compressed backup of the
database.
When you view the backup files from the file system level, you will not see any .gz
(or .zip, or .bz2) to indicate that the RMAN has taken a compressed backup. The
file naming convention will still follow the same as a non-compressed backup.
$ ls -l /backup/rman/
total 58352
Note: The way to tell whether RMAN has take a compressed backup or not, it by
looking at the size, and by looking at the output of the RMAN “list” command
which is shown in one of the section below.
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
As you see above, it displays various information about the backups. In the above
output, it show 7 RMAN backups. The last column shows the “Tag” that we
specified when we took a backup. If we didn’t specify any TAG, RMAN creates a
default tag with the prefix “TAG” followed by some numbers. You can also see that
under the column “Compressed”, the last RMAN backup shows “YES”, which
indicates that out of all the 7 RMAN backups, only the last one was compressed.
Also, when the RMAN backup is running, if you want to see the proress, you can
query the V$RMAN_STATUS table from sql*plus as shown below.
There you have it!. That is how you take an Oracle RMAN backup and sleep
peacefully.
Tagged as: RMAN Backup Command, RMAN Backup Controlfile, RMAN Backup Datafile, RMAN Backup Format, RMAN Backup
Hi,
Thanks
LINK
LINK
LINK
LINK
thanks for the hints, however RMAN backup seems to be working only
when an Oracle instance is up, thus can it be used against disaster recovery?
LINK
One more question, if I remember RMAN backup is possibile only if the Oracle
database is running in archive mode, is it right?
LINK
@Tasslehoff
RMAN can make consistent and inconsistent backup,incremental or full
backup,backup of whole or portion of database.
LINK
LINK
LINK
Useful article.Thanks.
LINK
Hi,
is there any view to check the retention time of the existing back in the catalog?
LINK
Hi
LINK
LINK
LINK
LINK
LINK
Super Thanks. Excellent article, please keep posting more and more 🙂
LINK
LINK
LINK
thanks
LINK
LINK
thanks a lot
LINK
LINK
Really useful:-)
LINK
it’s very nice tutorial.It will very helpfull for beginners and experienced
LINK
LINK
LINK
LINK
Hi,
Thx for the post I am trying this on the test instance I am getting the following
errror
LINK
@Anthony
It’s normal, you can use rman only if the database is working in archive log mode.
Connect to your db as sysdba with a client (sqlplus or sql developer or any other)
and lauch “archive log list”.
It will return some information, “Database log mode” will tell you if your database
works in archive log mode or no archive log.
Probably yours will work in no archive log, you can change it but you must create
a directory for archivelogs and tell the database to use that directory.
LINK
This was the best documentation on Rman to be found on the web. It’s
far more concise and useful than anything that I saw on the Oracle sites. Oracle –
if you read this- please take note of the practical nature of this man’s work.
Mr NATARAJAN – THANK YOU ! You have saved my week and perhaps my
whole work with Oracle.
LINK
Hi friend,
if you have some more details about logical backup and physical backup please
inform.
LINK
LINK
LINK
Really it was help full article, Specially for those have started their carrier
recently in oracle DBA field.
LINK
Thanks..
LINK
LINK
LINK
It is nice article on RMAN, and most of people getting the error, they
should make sure that RMAN is achivelog enable mode, before they can use
RMAN for fully backup
LINK
LINK
LINK
LINK
LINK
Thanks alot
LINK
thanks
LINK
LINK
Thanks for this article on backup and RMAN in Database. This gives a
basic understanding how backup are done at DB level for non-DBA support team
even though we depend on DB.
LINK
Excellent one
LINK
LINK
LINK
Could you please provide me the steps to backup oracle 11g database and
its objects on a windows 7 32 bit machine. Further i would like to keep it as a
archive and day to day basis.
LINK
LINK
Excellent..!!!
LINK
Useful
LINK
Good One..!
LINK
Leave a Comment
Name
Website
Comment
Save my name, email, and website in this browser for the next time I comment.
Submit
A T G S C U S U
My name is Ramesh Email Me : Use this Contact Form to get in Support this blog by purchasing one of my
Natarajan. I will be touch me with your comments, questions or ebooks.
posting instruction guides, suggestions about this site. You can also
how-to, troubleshooting simply drop me a line to say hello!. Bash 101 Hacks eBook
tips and tricks on Linux,
database, hardware, Follow us on Google+ Sed and Awk 101 Hacks eBook
security and web. My focus is to write
articles that will either teach you or help Follow us on Twitter Vim 101 Hacks eBook
you resolve a problem. Read more about
Ramesh Natarajan and the blog. Become a fan on Facebook Nagios Core 3 eBook