Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
22Activity
0 of .
Results for:
No results containing your search query
P. 1
An Introduction to Rman With Examples

An Introduction to Rman With Examples

Ratings:

4.67

(3)
|Views: 2,914 |Likes:
Published by Shahid Mahmud
An Introduction to Rman With Examples
An Introduction to Rman With Examples

More info:

Published by: Shahid Mahmud on Nov 11, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

07/30/2011

pdf

text

original

 
An introduction to rman with examples
.
For beginners and non, rman is one of the most obscure Oracle tools, but in reality it is basedon quite simple principles. It is true, though, that a restoration can be distructive for adatabase.
Why is rman dangerous?
rman is dangerous because it works at the database physical level; to understand why, let'ssay that rman is not "too" different from WinZip. Since everybody knows WinZip, it willprobably be easier to understand rman.
Is WinZip dangerous?
The creation of a zip archive is not dangerous, unless you choose the same name for theoutput file, or the archive is so big that you fill a device or the temporary directory etc. Thesame thing can be said about rman: taking an rman backup cannot be dangerous (unless youstop the database, or close it intentionally) and you don't overwrite previous backups (you canprevent it).rman creates a compressed backup of the physical database files, including controlfiles,datafiles, archived logs and stores them somewhere. This somewhere can be a disk (likeWinZip) or a tape.Therefore, the first important point to remember is:
rman creates compressed backups of the physical database; if you prefer, rman zipsthe database, entirely or not.
Is Unzip dangerous?
Unzip, on the other hand, can be very dangerous. The risk is overwriting files that should notbe overwritten and, therefore, losing important content. The very same applies to rmanrestores: since they overwrite database files, you should know whether this is the rightdecision because, otherwise, you may lose your data. This is the main difference between animport and an rman restoration: an rman restoration (restore) overwrites one or moredatafiles; this means WATCH OUT.
Our first rman backup
The only requirements for taking simple, useful rman backups are two:
You database is in archivelog mode
You have enough disk space somewhereOn our Windows 2000 workstation we open a CMD window and type the following few lines:
E:\>rman target /Recovery Manager: Release 9.2.0.1.0 - ProductionCopyright (c) 1995, 2002, Oracle Corporation. All rights reserved.connected to target database: ARK9201 (DBID=3564144589)
 
run {allocate channel t1 type disk;backup database format 'E:\RMAN_BACKUPS\ARK9201\%d_%u_%s';release channel t1;}using target database controlfile instead of recovery catalogallocated channel: t1channel t1: sid=9 devtype=DISKStarting backup at 10-DEC-04channel t1: starting full datafile backupsetchannel t1: specifying datafile(s) in backupsetincluding current SPFILE in backupsetincluding current controlfile in backupsetreleased channel: t1RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03009: failure of backup command on t1 channel at 12/10/200414:28:50ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode
As we said, the database must be in archive mode if we want to backup open databases. Aseparate articles explains why it must be so, because it is not so obvious.
SQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL> startup mountORACLE instance started.Total System Global Area 135338868 bytesFixed Size 453492 bytesVariable Size 109051904 bytesDatabase Buffers 25165824 bytesRedo Buffers 667648 bytesDatabase mounted.SQL> alter database archivelog;Database altered.SQL> alter database open;Database altered.
Let's now repeat the operation having put the database in archive mode Choosing C:\Temp asdirectory for the backup is, of course, a very bad idea. Backups are gold and shoud be kept ona dedicated device; a good name could be E:\RMAN_BACKUPS\SID
E:\>rman target /Recovery Manager: Release 9.2.0.1.0 - ProductionCopyright (c) 1995, 2002, Oracle Corporation. All rights reserved.connected to target database: ARK9201 (DBID=3564144589)RMAN> run {
 
2> allocate channel t1 type disk;3> backup database format 'E:\RMAN_BACKUPS\ARK9201\%d_%u_%s';4> release channel t1;5> }allocated channel: t1channel t1: sid=12 devtype=DISKStarting backup at 26-DEC-04channel t1: starting full datafile backupsetchannel t1: specifying datafile(s) in backupsetincluding current SPFILE in backupsetincluding current controlfile in backupsetinput datafile fno=00001 name=E:\ORACLE\ORADATA\ARK920\SYSTEM01.DBFinput datafile fno=00002 name=E:\ORACLE\ORADATA\ARK920\UNDOTBS01.DBFinput datafile fno=00004 name=E:\ORACLE\ORADATA\ARK920\EXAMPLE01.DBFinput datafile fno=00009 name=E:\ORACLE\ORADATA\ARK920\XDB01.DBFinput datafile fno=00005 name=E:\ORACLE\ORADATA\ARK920\INDX01.DBFinput datafile fno=00008 name=E:\ORACLE\ORADATA\ARK920\USERS01.DBFinput datafile fno=00003 name=E:\ORACLE\ORADATA\ARK920\DRSYS01.DBFinput datafile fno=00006 name=E:\ORACLE\ORADATA\ARK920\ODM01.DBFinput datafile fno=00007 name=E:\ORACLE\ORADATA\ARK920\TOOLS01.DBFchannel t1: starting piece 1 at 26-DEC-04channel t1: finished piece 1 at 26-DEC-04piece handle=E:\RMAN_BACKUPS\ARK9201\ARK920_03G8KC6G_3 comment=NONEchannel t1: backup set complete, elapsed time: 00:25:58Finished backup at 26-DEC-04released channel: t1
The resulting backup file(s) are in our case
dir c:\rman_backups\ark9201Volume in drive C is 80-01-14A2Volume Serial Number is 64DA-0BF7Directory of c:\rman_backups\ark920112/26/2004 02:29p .12/26/2004 02:29p ..12/26/2004 02:44p 418,471,936 ARK920_03G8KC6G_3
Our first archive backup
Taking only the database backup is not enough, for reasons that will be clear later. We musttake a backup of the archived log as well, and the command is very similar
RMAN> run {2> allocate channel t1 type disk;3> backup archivelog all delete input format'C:\RMAN_BACKUPS\ARK9201\arch_%d_%u_%s';4> release channel t1;5> }allocated channel: t1channel t1: sid=12 devtype=DISKStarting backup at 26-DEC-04current log archived

Activity (22)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
premcgppuke liked this
Ranjith Ravidran liked this
ggiocondini liked this
spiros1 liked this
Wiinod Kumar liked this
alex1to liked this
pchandra73 liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->