Re: RMAN on Windows Server

From: Robert Freeman <robertgfreeman_at_yahoo.com>
Date: Tue, 1 Dec 2009 07:15:07 -0800 (PST)
Message-ID: <394646.63564.qm_at_web113208.mail.gq1.yahoo.com>



Are you using Database control or grid control? They will automate this for you using the Oracle Scheduler. Of course, if your shutting down your database from time to time then the database scheduler would not be able to run the backups.

You can also look at the schtasks scheduler or at (I prefer schtasks) to schedule the batch files. A simple RMAN backup batch file (usual disclaimers about testing, I'm not responsible for the results of this file, etc) would look something like this:

_at_echo off
rem backup.bat
rem RMAN BACKUP SCRIPT
rem For WIN XP
rem
echo %1
set oracle_sid=%1
if "%2" == "backup" rman target=/ cmdfile=backup.scr if not ERRORLEVEL 0 echo "WARNING - FAILURE OCCURED"

if "%2" == "arch" rman target=/ cmdfile=arch.scr if not ERRORLEVEL 0 echo "WARNING - FAILURE OCCURED"

and the scheduling would look like this:

schtasks /create /tn "database_backup" /sc daily /st 14:50:00 /tr "c:\bc\rman\backup.bat rob10r2 backup>>c:\bc\rman\backup.output" schtasks /delete /tn "database_backup"

schtasks /create /tn "archivelog_backup" /sc daily /st 14:45:00 /tr "c:\bc\rman\arch.bat rob10r2 arch>>c:\bc\rman\backup.output"

and the scr command files would be something like this (this assumes you have pre-configured channels, etc):

  • backup.scr backup database channel c1 plus archivelog delete input;
  • arch.scr backup archivelog all channel c1 delete input;

Robert G. Freeman
Oracle ACE
Ask me about on-site Oracle Training! RMAN, DBA, Tuning, you name it! Author:
Oracle Database 11g RMAN Backup and Recovery (Oracle Press) - ON IT'S WAY SOON! OCP: Oracle Database 11g Administrator Certified Professional Study Guide (Sybex) Oracle Database 11g New Features (Oracle Press) Oracle Database 10g New Features (Oracle Press) Other various titles
Blog: http://robertgfreeman.blogspot.com



From: Bill Zakrzewski <bill_at_intactus.com> To: "Oracle-L_at_freelists.org" <oracle-l_at_freelists.org> Sent: Tue, December 1, 2009 8:03:17 AM
Subject: RMAN on Windows Server

All -

I was just given a database to maintain on Windows, does anyone have a basic RMAN backup script that I can alter to automate an RMAN backup on Windows? I usually work on Linux or Unix and not really familiar with scripting on a Windows server. Any advice on automating the script will be helpful too.

Oracle 10.2.0.4
Windows Server 2003 SP2

Thanks in advance,
Bill--
http://www.freelists.org/webpage/oracle-l

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Dec 01 2009 - 09:15:07 CST

Original text of this message