Schedule RMAN Jobs In Windows Server

How to schedule a backup jobs?

Backup strategy we follow for one of our production Database is as follows:
1) Weekly RMAN full backup
2) Weekly Archive log backup
3) Daily incremental backup

In windows server environment we use scheduler (cronjob in unix environment) to schedule a job.

The important steps here are:

Taking Database backup weekly(incremental level 0):
1) Create a cmd file(command file):
Let us create a file name backup_weekly_db1.cmd using a text file editor(any editor) write the rman script to take the backup.Suppose I want to take full backup(incremental 0) than the script for taking the weekly incremental 0 backup would be like this,assuming controlfile autobackup is off(default).

backup_weekly_db1.cmd
RMAN>run{
Allocate channel ch1 type disk format '\path of taking backup_\%d_data_%U';
Backup incremental level=0 database tag='complete_backup';
Release channel ch1;
Allocate channel t1 type disk format '\path of taking backup\%d_ctrl_%U';
Backup current controlfile;
Release channel t1;
}

2) Create the bat file(Batch file is for batch job execution by scheduler)
Let us create a batch file backup_weekly_db1.bat(This batch file we are creating for executing this file through schedule (as cronjob in unix environment).
The script is:

backup_weekly_db1.bat
rman target sys/db1@db1
cmdfile=\Path of cmd file\backup_weekly_db1.cmd
log=D:\Path of log keeping\backup_complete_db1_%date:~4,2%_%date:~7,2%_%date:~10%.log

3) Use scheduler for scheduling job:

Go to control panel->scheduler tasks->Add scheduler task->command prompt->Perform this task->weekly->choose day and timings when you want to run this job weekly->specify administrator user and password->finish
 

Taking Database backup Daily(incremental level 1)

All the above steps remain the same,but the scripts and scheduler task option changes slightly:

1) backup_daily_db1.cmd
run{
Allocate channel ch1 type disk format '\path of taking backup_\%d_data_%U';
backup incremental level=1 database tag='Incremental_Backup';
Release channel ch1;
}

2) backup_daily_db1.bat
rman target sys/db1@db1
cmdfile=\Path of cmd file\backup_daily_db1.cmd
log=D:\Path of log keeping\backup_complete_db1_%date:~4,2%_%date:~7,2%_%date:~10%.log

3) Scheduler option choose daily and timings when you want to schedule the job 

Oracle Database

Have a Oracle Question
Do you have an Oracle Question?

Oracle Books
Oracle Certification, Database Administration, SQL, Application, Programming Reference Books

Oracle Application
Oracle Application Hints and Tips

Oracle Home
Oracle Database, SQL, Application, Programming Tips

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.
The site www.erpgreat.com is not affiliated with or endorsed by any company listed at this site.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
 The content on this site may not be reproduced or redistributed without the express written permission of
www.erpgreat.com or the content authors.