FAQ
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

Search Discussions

  • Robert Freeman at Dec 1, 2009 at 3:15 pm
    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
    To: "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
  • Guillermo Alan Bort at Dec 1, 2009 at 4:34 pm
    I use a vbs script. I've seen people code on perl. The RCV scripts are
    basically the same (format is the only thing that changes). I'd stay away
    from Windows Task Scheduler unless you want to get into administration HELL.

    For automation, I'd go for Tivoli Workload Scheduler, Control-M, Autosys,
    etc. If you Trust Grid Control it's a good choice.... though I've not used
    it extensively and EM (at least dbcontrol) has the habit of breaking when
    you need it...

    Another option is DBMS_SCHEDULER, but it's tricky and requires some
    testing...

    hth
    Alan Bort
    Oracle Certified Professional
    On Tue, Dec 1, 2009 at 1:03 PM, Bill Zakrzewski wrote:

    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
  • Robert Freeman at Dec 1, 2009 at 4:44 pm
    Hmmmm.... I've never had much of a problem with the Windows task scheduler for such things. I will say the Windows Oracle I've dealt with for the most part has been small enterprise (usually running Oracle Standard Edition). Usually 1 or 2 databases at most and limited technical people to support the solution. Typically the medium/large enterprises move away from the WIN platforms (though, I admit, not always). The Win users that I've been involved with often need simple, inexpensive solutions..... When you start talking about Tivoli, Control-M, etc... you are usually talking about money that they are often not willing to spend, because they don't see the benefit or have the budget.

    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: Guillermo Alan Bort
    To: bill_at_intactus.com
    Cc: "Oracle-L_at_freelists.org"
    Sent: Tue, December 1, 2009 9:34:43 AM
    Subject: Re: RMAN on Windows Server

    I use a vbs script. I've seen people code on perl. The RCV scripts are basically the same (format is the only thing that changes). I'd stay away from Windows Task Scheduler unless you want to get into administration HELL.

    For automation, I'd go for Tivoli Workload Scheduler, Control-M, Autosys, etc. If you Trust Grid Control it's a good choice.... though I've not used it extensively and EM (at least dbcontrol) has the habit of breaking when you need it...

    Another option is DBMS_SCHEDULER, but it's tricky and requires some testing...

    hth
    Alan Bort
    Oracle Certified Professional
    On Tue, Dec 1, 2009 at 1:03 PM, Bill Zakrzewski wrote:

    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
  • Robert Freeman at Dec 1, 2009 at 4:39 pm
    Rich you are correct there.... We have had all sorts of issues with Grid control and in fact I have a project to rip it out and completely rebuild it with the latest and greatest in the works. I was actually more thinking from a single windows database point of view and using Oracle Database Control which is pretty solid. Usually when I think windows, I for some reason tend to think small business. Probably a bad bias... :-)

    RF

    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: Rich Jesse
    To: "Oracle-L_at_freelists.org"
    Sent: Tue, December 1, 2009 9:22:19 AM
    Subject: Re: RMAN on Windows Server

    Hey Robert,
    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.
    I'd say this option is "USE AT YOUR OWN RISK". I chose it to get RMAN
    going, but there is a severe issue with Grid Control jobs. Unfortunately
    all my SR information is now lost since the upgrade to MOS, so I can't give
    any specifics, although patch 759579 is what I applied to hopefully fix it.
    The problem is that the scheduled jobs in Grid Control can silently
    disappear. If I hadn't noticed my archive_dest suspiciously filling up on
    the weekend, it could have been major trouble.

    I'm in the delicate process of replacing all RMAN backups in Grid Control
    with a POSIX shell script run locally on each server. Much more robust and
    reliable, IMNSHO. One can't modify *any* aspect of the RMAN script once
    it's scheduled. The job must be dropped and recreated. How absurd!

    Unfortunately I have one Winders XE DB that I'd still like backed up. And
    since I'm a solo DBA, I can't take the time to rewrite a backup script
    specific for this ancillary DB, so Grid Control it is for this guy. I've
    supplemented the job with yet ANOTHER "Check to make sure Grid Control is
    running" script utilizing the output from a "repvfy verify jobs" command of
    the EMDiag kit. And even the version of EMDiag somehow broke a few weeks
    ago, where I needed to upgrade it. Granted, I'm using this diag tool well
    beyond what it was meant to do, but at this point I don't another viable
    option.

    Really really really (REALLY!) try to avoid Grid Control for production
    database backups.

    Really.

    My $.02,
    Rich
  • Jeffrey Beckstrom at Dec 1, 2009 at 4:41 pm
    We put all of our RMAN backup commands in a .cmd file. The cmd file references each database and runs an RMAN script. It is scheduled through the windows task scheduler.


    Jeffrey Beckstrom
    Database Administrator
    Greater Cleveland Regional Transit Authority
    1240 W. 6th Street
    Cleveland, Ohio 44113
    Bill Zakrzewski 12/1/09 10:03 AM >>>
    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
  • Niall Litchfield at Dec 1, 2009 at 5:45 pm

    On Tue, Dec 1, 2009 at 5:05 PM, Guillermo Alan Bort wrote:

    I'm working for a VERY large global company, and they still have about 40%
    of their databases on Windows. And this introduces a whole new problem,
    since we can't actually create local users, we use our domain accounts to
    schedule tasks, and as our passwords change, the scheduled tasks become
    invalid. Due to compliance issues, we are still not authorized to create a
    Service Account in order to schedule the tasks... so we started moving away
    from windows task scheduler.

    I'd say windows is an OS for desktop computers... not enterprise servers.
    I'd much rather run linux (even RedHat) on any machine that supports
    windows. And have a very robus environment on which to run Oracle... as
    opposed to the Blue-Screen-Maker...
    I can understand the bias against windows, but your specific issues are
    almost entirely unrelated to the operating system and instead related to the
    security policy and likely the politics. If you also rotated unix os
    passwords on a schedule and schedule using a central scheduler and don't
    allow the people doing the scheduling to use appropriately privileged
    accounts then you'd also be stuffed. If you are regularly having blue
    screens then you likely have bad drivers or hardware. Actually I bet if you
    collect the stats your windows db servers haven't been down for a blue
    screen for years if at all, it just doesn't generally happen these days on
    server hardware.
  • M Rafiq at Dec 2, 2009 at 1:04 am
    I agree with Niall. All pharma companies with validated env have hundred of Windows servers (with all type of security compliance) without such issues.

    You need to create a non-people domain account with no password expired option and run all your scheduled jobs using that account. It is quite acceptable practice as changing password for hundreds of schedule jobs is not easy. Besides running netbackup jobs also need such accounts to run dataabse server backups.



    Regards



    Rafiq





    Date: Tue, 1 Dec 2009 17:45:38 +0000
    Subject: Re: RMAN on Windows Server
    From: niall.litchfield_at_gmail.com
    To: cicciuxdba_at_gmail.com
    CC: robertgfreeman_at_yahoo.com; bill_at_intactus.com; oracle-l_at_freelists.org

    On Tue, Dec 1, 2009 at 5:05 PM, Guillermo Alan Bort wrote:

    I'm working for a VERY large global company, and they still have about 40% of their databases on Windows. And this introduces a whole new problem, since we can't actually create local users, we use our domain accounts to schedule tasks, and as our passwords change, the scheduled tasks become invalid. Due to compliance issues, we are still not authorized to create a Service Account in order to schedule the tasks... so we started moving away from windows task scheduler.

    I'd say windows is an OS for desktop computers... not enterprise servers. I'd much rather run linux (even RedHat) on any machine that supports windows. And have a very robus environment on which to run Oracle... as opposed to the Blue-Screen-Maker...

    I can understand the bias against windows, but your specific issues are almost entirely unrelated to the operating system and instead related to the security policy and likely the politics. If you also rotated unix os passwords on a schedule and schedule using a central scheduler and don't allow the people doing the scheduling to use appropriately privileged accounts then you'd also be stuffed. If you are regularly having blue screens then you likely have bad drivers or hardware. Actually I bet if you collect the stats your windows db servers haven't been down for a blue screen for years if at all, it just doesn't generally happen these days on server hardware.

    --
    Niall Litchfield
    Oracle DBA
    http://www.orawin.info

    _________________________________________________________________
    Get gifts for them and cashback for you. Try Bing now.
    http://www.bing.com/shopping/search?q=xbox+games&scope=cashback&form=MSHYCB&publ=WLHMTAG&crea=TEXT_MSHYCB_Shopping_Giftsforthem_cashback_1x1
    --
    http://www.freelists.org/webpage/oracle-l

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouporacle-l @
categoriesoracle
postedDec 1, '09 at 3:03p
activeDec 2, '09 at 1:04a
posts8
users6
websiteoracle.com

People

Translate

site design / logo © 2022 Grokbase