Write a ms dos script for rman backup

Hi all,
i wanna write a dos batch file to take the rman backup..
i have written one...actually there are 2 files. one is for login purpose...other one is for sql commands
rman.bat-->
rman target sys/sysadmin@hnbhrm @'c:\rm.sql'
==============================
rm.sql-->
configure retention policy to recovery window of 7 days;
configure controlfile autobackup on;
run {
alter system switch logfile;
crosscheck archivelog all;
crosscheck backupset;
backup database plus archivelog;
DELETE NOPROMPT ARCHIVELOG ALL COMPLETED BEFORE 'sysdate -1';
DELETE NOPROMPT OBSOLETE REDUNDANCY = 1;
========================================
but i have problem in first file rman.bat. it doesnt run at all. but if i write sqlplus / as sysdba instead of rman thing.. then it works fine.
can anybody tell me whats happening over there please..? Have i done this correctly? or u have some other simple way to do this...
both files are located in C drive.. and oracle is installed to E drive... oracle path has set already.
can anybody please give me a hand to solve this issue please...
Thanks in Advance,
Max

write a ms dos script for rman backupImpossible. rman does not support MS-DOS. It is not a 16bit real mode application that can be run inside the MS-DOS operating system.
So get your terminology straight - the Windows console is a character based 32bit virtual machine. It is not MS-DOS. It never was MS-DOS. Do not confuse the two simply because of superficial similarities. A stick-it note can be yellow - but because it is yellow does not mean it is a banana.

Similar Messages

  • Shell script for RMAN backup

    Hi,
    on 10G R2 in AIX 6.1
    I'm looking for Shell script for RMAN backup.
    Moreover , if we should connect like this :
    rman nocatalog target sys/password@myDB << EOF
    backup as compressed backupset format '$savdir/ctl_%d_%T_%s_%p' current controlfile;
    exit
    EOFHow to avoid writting password in shell script ?
    Thank you.

    user522961 wrote:
    Can you please tell me in case of having a catalog , how to connect to catalog without writting password in script ? I mean , how to write the following in a way without password :
    #!/usr/bin/ksh
    export ORACLE_SID=myDB
    ORACLE_ENV_ASK=NO
    . /usr/local/bin/oraenv
    export savedir=/backups/myDB
    rman target /  << EOF
    connect catalog rman/password@myrepository
    backup as compressed backupset
        format '$savdir/ctl_%d_%T_%s_%p'
        include current controlfile;
    exit
    EOF:p

  • Script for RMAN backup

    kindly send the script for RMAN bacup

    Hi,
    About RMAN backup
    http://dbataj.blogspot.com/2007/01/about-rman-backups.html
    About RMAN architechture
    http://dbataj.blogspot.com/2007/01/recovery-manager-architecture.html
    About RECOVERY CATALOG
    http://dbataj.blogspot.com/2006/12/recovery-catalog.html
    RMAN backup script
    http://dbataj.blogspot.com/2007/01/hotfullrmanbkpscirpt.html
    above is my own work on RMAN you have to edit according you needs.
    regards
    Taj

  • Shell script for DB backup

    HI,
    i have written some java code Database backup but there are some problems with that so now i need to write shell script for db backup.
    what i was doing in java code i was running command like that
    /usr/local/bin/tar cvzf /export/home/monitor/FILE_20091005.tar.gz FILES/*20091005.*which compress the all *20091005* files (myisam table files)
    but after compression file doesn't extract
    so i have to write shell script for that ..... can any body guide me how can i write that kind of script and put it in cron job.
    thanks

    soundar wrote:
    Hi all,
    I have migrated database from 8i to 10gr2.For Backup in 8i, we used a RMAN shell script (scheduled uding cron tab) to backup the database to Tape.(VERITAS BACKUP).
    I am new to 10G.I checked out the options to backup the database using Oracle Enterprise manager DB console.
    http://www.oracle.com/technology/obe/10gr2_db_single/ha/rman/rman_otn.htm#t1d
    I am planning to take a test backup using the steps mentioned inthe above url.Could any one suggest whcih is the best option for database backup,eiether to use Oracle Enterprise manager DB console or thru RMAN shell script for backup..?
    Edited by: soundar on Mar 9, 2010 10:53 PMDear soudar
    I woudn't suggest you to work with EM if you want to be a professional DBA. Start learning RMAN and use CLI instead of GUI
    Those who live by the GUI, die by the GUI

  • Getting error while running script for online backup

    Hi,
    I am running a script for online backup but ended up with an the below error.
    *ERROR* [Backup Worker Thread] com.day.crx.core.backup.Backup Failed to create temporary directory
    Please help out in resolving this.
    Thanks in Advnace.
    Maheswar

    Hi mahesh,
    If you are using backup feature from crx console, I mean http://localhost:4502/crx/config/backup.jsp  I can say that we had also some problems with this functionalities.
    First off all what you need to check are the permissions, because when you check a source code there is line which creates a File object using a path specified by you to make a backup of repository.
    File targetDir = new File(req.getParameter("targetDir", listDir.getParentFile().getAbsolutePath()));
    You need to have sure that the proper read write access has been granted for this path.
    Another issue is that maybe there was already prepared some hotfix if you are using CQ5.4. Please refer to the following link:
    http://dev.day.com/content/kb/home/Crx/CrxSystemAdministration/CRXOnlineBackup.html
    and also to this one:
    http://dev.day.com/content/docs/en/crx/current/release_notes/overview.html which contains a hotfix number #34797 which was applied to backup.jsp file.
    Regards,
    kasq

  • Best pratices for RMAN backup management for many databases

    Dear all,
    We have many 10g databases (>40) hosted on multiple Windows servers which are backup up using RMAN.
    A year ago, all backup's were implemented through Windows Scheduled Tasks using some batch files.
    We have been busy (re)implementing / migrating such backup in Grid Control.
    I personally prefer to maintain the backup management in Grid Control, but a colleague wants now to go back to the batch files.
    What i am looking for here, are advices in the management of RMAN backup for multiple databases: do you guys use Grid Control or any third-party backup management tool or even got your home-made solution?
    One of the discussion topic is the work involved in case that the central backup location changes.
    Well... any real-life advices on best practices / strategies for RMAN backup management for many databases will be appreciated!
    Thanks,
    Thierry

    Hi Thierry,
    Thierry H. wrote:
    Thanks for your reaction.
    So, i understand that Grid Control is for you not used to manage the backups, and as a consequence, you also have no 'direct' overview of the job schedules.
    One of my concern is also to avoid that too many backups are started at the same time to avoid network / storage overload. Such overview is availble in Grid Control's Jobs screen.
    And, based on your strategy, do you recreate a 'one-time' Oracle scheduled job for every backup, or do your scripts create an Oracle job with multiple schedule?
    You're very welcome!
    Well, Grid Control is not an option for us, since each customer is in a separate infrastructure, and with their own licensing. I have no real way (in difference to your situation) to have a centralized point of control, but that on the other hand mean that I don't have to consider network/storage congestion, like you have to.
    The script is run from a "permanent" job within the dba-scheduler, created like this:
    dbms_scheduler.create_job(
            job_name        => 'BACKUP',
            job_type        => 'EXECUTABLE',
            job_action      => '/home/oracle/scripts/rman_backup.sh',
            start_date      => trunc(sysdate)+1+7/48,
            repeat_interval => 'trunc(sysdate)+1+7/48',
            enabled         => true,
            auto_drop       => false,
            comments        => 'execute backup script at 03:30');and then the "master-script", determines which level to use, based on weekday from the OS. The actual job schedule (start date, run interval etc) is set together with the customer IT/IS dept, to avoid congestion on the backup resources.
    I have no overview of the backup status, run times etc, but have made monitoring scripts that will alert me if/when a backup either fails, or runs for too long. This, in addition with scheduled disaster/recovery tests makes me sleep rather well at night.. ;-)
    I realize that there (might be) better ways of doing backup scheduling in your environment, since my requirements are so completely different than yours, but I guess that we all face the same challenges in unifying the environments as much as possible, to minimize the amount of actual work we have to do. :-)
    Good luck!
    //Johan

  • Choice a remote drive for RMAN backup

    I want to use my AIX (OS 5.3L) as a remote server for RMAN backup, under the 10g R2. The two most likely drives that still has lots space are hdisk1 and hdisk3. However, the hdisk1 is in rootvg with my test Oracle 10g appl on. Although the hdisk3 is in appvg and but it is the data storage for oracle of local machine. Both drives are quite busy based on the memory monitor and iostat. so How to make a choice for which drive is more proper as a remote drive?

    As i play more with the NFS on AIX, i noticed more about the user/group attributes of the files and directory. Mainly, they are different on either side, even more strangely that the new file created on the server side has different user/group attribute , not as oracle/oinstall of original (client side) It worries me whether there will be problem when RMAN does the recovery later.
    Secondly, the NFS only allows to write into one level of the directory, which is assigned NSF. As I know, the whole RMAN backup creates backupset files at several levels down from my flash_recovery_area.
    Message was edited by:
    user508054

  • WHAT IS BEST STRATEGY FOR RMAN BACKUP CONFIGURATION

    Hi all,
    my database size is 50GB I want TAKe WEEKLY FULL BACKUP AND INCREMENTAL BACKUP
    WITHOUT RECOVERY CATALOG.by follwing commands
    weekly full database backup
    run
    backup as compressed backupset
    incremental level=0
    device type disk
    tag "weekly_database"
    format '/sw/weekly_database_%d_t%t_c%c_s%s_p%p'
    database;
    I want do CONFIGURE RMAN BY FOLLWING stragtegy
    CONFIGURE RETENTION POLICY TO REDUNDANCY window of 14 days.
    CONFIGURE BACKUP OPTIMIZATION OFF;
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO
    '\SW\AUTOCFILE_'%F';
    and other is by default
    sql>alter system set control_file_record_keep_time=15 days;
    os--aix6 and for two database 10g2 and 11g2
    what is best configuration strategy for rman backup.AND BACKUP WITH RECOVERY CATALOG OR WITHOUT RECOVERY CATALOG
    PLEASE TELL ME
    Edited by: afzal on Feb 26, 2011 1:45 AM

    For simply two databases, there really wouldn't be a need for a recovery catalog. You can still restore/recover without a controlfile and without a recovery catalog.
    From this:
    afzal wrote:
    CONFIGURE RETENTION POLICY TO REDUNDANCY window of 14 days.I am assuming you want to keep two weeks worth of backups, therefore these:
    alter system set control_file_record_keep_time=15 days;
    CONFIGURE RETENTION POLICY TO REDUNDANCY window of 14 daysShould be:
    RMAN> sql 'alter system set control_file_record_keep_time=22';
    RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 14;22 would give you that extra layer of protection for instances when a problem occurs with a backup and you want to ensure that data doesn't get aged out.

  • Volume Duplication Policy for RMAN Backups

    Hi,
    I wish to configure a volume duplication policy for RMAN backups. Both the source media family and duplicate media family are 'content managed' as per the documentation. However, the duplication policy 'trigger' is defined as if the media family is 'time managed', which does not seem to make sense in 'content-managed' media families used by RMAN.
    Does anyone have any guidelines on how RMAN volume duplication can be set up so that my duplicates are valid?
    Thanks

    Yes. I understand. The reason I used time-managed volumes in the tutorial is that with time-managed volumes a duplicate may have different retention and rotation than the original. The procedure for time or content managed duplicates are the same.
    A content managed tape may be duplicated to the same or different media family. If to a different media family, the retention would be same...since content managed but it could have a different rotation policy...if desired. For example, if you wanted original tapes left onsite but the duplicates to go offsite for "x" time, then create a new content managed media family and a desired rotation policy...associate that rotation policy to new media family and duplicate tapes to that media family with desired rotation policy. In that scenario, your original media family would have a duplication policy and possible a rotation policy. The new media family would just have a rotation policy.
    Donna

  • RMAN script for hot backup (looking for code critic) code attached.

    Hello Guru's,
    I have been having soem trouble running a successful hot full rman backup nightly.
    We max our CPU load whenever our RMAN takes too long and conflicts with a Legato tape backup. I have a development server that I attempted to get a consistent backup time duration that is rock solid as to not conflict with the Legato backup time.
    I just found out about duration with RMAN scripts here is my code:
    #!/bin/bash
    #rman backup script for daily hot whole database backup
    at -f /hd1/rman_scripts/rman_backup 0600 tomorrow
    rman target/
    run {
    allocate channel d1 device type disk format '/path/%U';
    backup duration 1:00 partial minimize load database filesperset 1;
    backup as BACKUPSET tag '%TAG' database;
    backup as BACKUPSET tag '%TAG' archivelog all delete all input;
    delete noprompt obsolete;
    release channel d1;
    exit
    It completes the backup, but does not use the 1 hour allocated- it only uses 15 minutes on average and creates many files instead of normally three backup files.
    Here is the results from querying the v$rman_status table for operation,status,start_time:
    RMAN,FAILED, 17-OCT-06 0600
    BACKUP,FAILED,17-OCT-06 0600
    RMAN,FAILED,17-OCT-06 0606
    BACKUP,COMPLETED,17-OCT-06 0606
    BACKUP,COMPLETED,17-OCT-06 0606
    BACKUP,FAILED,17-OCT-06 0615
    RMAN,COMPLETED,17-OCT-06 1513
    REPORT,COMPLETED,17-OCT-06 1513
    DELETE,COMPLETED,17-OCT-06 1513
    However, the timestamps of the backupset files it creates is:
    06:15 and not 1513?????????????
    RMAN appears to have only taken 15 minutes to create the files, why do I have a completed timestamp from v$rman_status of 1513???
    Please advise and comment, I am just learning RMAN.

    Try to remove the DURATION option in your script.
    Here more details about that part.
    http://download-east.oracle.com/docs/cd/B19306_01/backup.102/b14194/rcmsynta009.htm#i1010261
    Bye, Aron

  • Shell script for export backup in oracle 11g

    Hi,
    Oracle version 11.2.0..
    O/S-AIX
    How to write shell script for export full backup in oracle 11g and also need to remove 2 days of old backup.
    Regards,
    Raju

    How to write shell script for export full backup in oracle 11g
    Do you mean that export is your backup strategy ? is your database running in noarchivelog mode ? if so, then why ? if not so, then why not RMAN ?
    need to remove 2 days of old backup.
    If that mean remove files older than 2 days, you can use something like this :
    $ find <absolute directory path> -mtime +2 -exec rm {} \;

  • Revised script for online backup

    Hi everybody,
    in http://linux-dba.gutzmann.com you can find a revised and
    enhanced version of a script for a full online backup. It
    requires the database to be in archive mode, of course, and
    contains compress steps so you can use it for a disk backup.
    Any comments are welcome.
    Cheers
    Thomas
    null

    Hi mahesh,
    If you are using backup feature from crx console, I mean http://localhost:4502/crx/config/backup.jsp  I can say that we had also some problems with this functionalities.
    First off all what you need to check are the permissions, because when you check a source code there is line which creates a File object using a path specified by you to make a backup of repository.
    File targetDir = new File(req.getParameter("targetDir", listDir.getParentFile().getAbsolutePath()));
    You need to have sure that the proper read write access has been granted for this path.
    Another issue is that maybe there was already prepared some hotfix if you are using CQ5.4. Please refer to the following link:
    http://dev.day.com/content/kb/home/Crx/CrxSystemAdministration/CRXOnlineBackup.html
    and also to this one:
    http://dev.day.com/content/docs/en/crx/current/release_notes/overview.html which contains a hotfix number #34797 which was applied to backup.jsp file.
    Regards,
    kasq

  • NT DOS Script for Mass transports.

    Dear Friends,
    My system is 640. I have a list of 500 transports to be transported to PRD system. I am thinking of doing it at os level a script in NT which can read the transport requests line by line and writes the request number and return code in a log file.
    Please share any one having such dos script. I have unix but not for windows. Also please help if any one is aware of performing mass transports by other means, if yes then how ? please list exact step by step procedure.
    thanks for your help.
    Tony.

    Hi Tony,
    from performance point of view, it's better to mark your  requests and transport them together. Also inconsistencies (forget a data element, transported in 2nd request) will be avoided.
    In case transports are imported together, than all dictionary parts are imported in a first step, repository parts come later -> automatically correct import order, less activations.
    Regards,
    Christian

  • User Permission for RMAN Backups

    Oracle 10g Database Enterprise Edition R 10.2
    I have created a user admin and i want to run backups from admin user. Kindly let me know what user permissions i have to grant for rman successful backups?
    Thanks!

    The rman "client" executable must connect to the Database AS SYSDBA.
    Therefore, technically it doesn't require a separate user account in the target database, although you could setup a user, grant SYSDBA to the user and have remote_login_passwordfile configured to allow connections.
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • DBID for RMAN backup with format '%u'

    Hi all:
    (I've post this at c.d.o.s. too, but no answers...)
    This is Oracle 10.2.0.3 on Enterprise Linux 5.
    I've been given two backups from an Oracle Database: one 'cold' and
    one 'hot'. They both come from a lost server.
    The fact is that they have been made with the format '%u' (eight
    alphanumerics) and I must recover the database on a new server. I
    cannot get the DBID from the backup files name because of this format
    '%u'.
    The backups have been made with CONTROLFILE AUTOBACKUP ON (or so I'm told).
    How can I get the DBID to recover the DB on a new server?
    Thanks in advance.
    Cheers.
    Carlos.

    "I don't know where you read this, it's wrong. "Oracle® Database Backup and Recovery Advanced User's Guide
    10g Release 2 (10.2)
    2 RMAN Backups Concepts
    Control File and Server Parameter File Autobackups
    How RMAN Performs Control File Autobackups
    "The RMAN behavior when the BACKUP command includes datafile 1 depends on the CONFIGURE CONTROLFILE AUTOBACKUP setting. If control file autobackups are ON and the backup includes datafile 1, RMAN writes the control file and SPFILE to a separate autobackup backup set. If control file autobackups are OFF and the backup includes datafile 1, then RMAN includes the current control file and SPFILE in the same backup set as the datafiles."
    Cheers.
    Carlos.

Maybe you are looking for

  • Can I get 5.1 Surround Sound from Mac to Apple TV?

    Hi, I have an iPad, iPhone and an Apple TV, and I love airplay, such a great feature! I'm thinking of replacing my desktop for a mac and I was wondering; if I had a 5.1 surround encoded video file on my mac, would I be able to push the whole screen t

  • Java Server/Client Applicaton - problem with sending data back

    Hello! I'm trying to write a small server/client chat application in Java. It's server with availability to accept connections from many clients and it's app just for fun... However, I've come up against a huge problem: everything what clients send,

  • Can external users change their language, time zone, and locale settings?

    Hi, We're migrating our hosts from WebEx cloud to our on-prem solution right now (CWMS 1.5.1.323.A). We've learned that CWMS 1.5 does not provide an online address book where hosts could customize language, time zone, and locale settings for their ex

  • Webservice to file

    Hi ..     I want detailed step by step guide for "webservice to file" scenario. Kindly help me out in this.

  • OLTP data to view in pre-built reports

    Hi Forum, I have created few records in Siebel CRM eCommunications application to view the data in OBI Presentation services. Using DAC, I want to populate into W_ tables to view in OBI eCommunications pre-built reports. So can you please guide me in