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 ;}    


Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blog is authored by Pankaj Chandiramani , Product Manager for Enterprise Manager at Oracle . Main Focus of the blog will be on Enterprise Manager 12c with deep coverage of Database Center Automation including DbaaS , Database Provisioning , Database Patching , Config , Compliance etc .

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today