« Simulating ASM Disks | Main | Recovery Scenarios Part -1 »

Rman Backup scripts

Backup a complete database:

(If the target database is in archive mode, this can be done while the database is open)





RMAN>


run {                                      

# backup complete database to disk            

allocate channel c1 type disk;                

backup full                                   

tag full_db                                   

format '/usr1/ora817/test/rman/db_d.dmp'

(database);                                   

release channel c1;                           

}                                             



You can create a script and use it multiple times, so each time you
don't need to type the above script. Just make sure to drop the old
backup files.



RMAN>

create script full_db_backup {            

allocate channel c1 type disk;            

backup full database                      

format '/usr1/ora817/test/rman/db_%d.dmp';

release channel c1;                       

}                                         



This is how you run the script:



RMAN>

run { execute script full_backup ;}    





Archive logs too can be backed up along with the database in one script:



RMAN>

create script full_db_arc_backup {            

allocate channel c1 type disk;                                            

backup full database                                                      

format '/usr1/ora817/test/rman/db_%d.dmp';                                

release channel c1;                                                      

allocate channel c2 type disk format '/usr1/ora817/test/rman/arc_%d.dmp';

backup (archivelog all delete input);                                     

release channel c2;                                                       

}                                                                         



- '%d' puts database name in the backup file name.

- 'all delete input' in above script deletes all the archive logs once the backup is   

   complete, thus frees up the space.



RMAN>

run { execute script full_db_arc_backup ;}    


TrackBack

TrackBack URL for this entry:
http://blogs.oracle.com/mte1521/mt-tb.cgi/2254

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on May 18, 2007 2:23 AM.

The previous post in this blog was Simulating ASM Disks.

The next post in this blog is Recovery Scenarios Part -1.

Many more can be found on the main index page or by looking through the archives.

Top Tags

Powered by
Movable Type and Oracle