Script for cold backup on windows

looking for a script that can be scheduled nightly to perform
a cold backup to disk of a 8.1.7 database on windows.
while i've seen many, i'm looking for one that will keep 3 days worth
of backups... then write over the oldest etc...
thanks
dg

set term off
set head off
set feedback off
set verify off
spool c:\coldbackup.bat
select 'copy '||name||' c:\DBBACKUP' from v$datafile;
select 'copy '||name||' c:\DBBACKUP' from v$controlfile;
select 'copy '||name||' c:\DBBACKUP' from v$tempfile;
select 'copy '||member||' c:\DBBACKUP' from v$logfile;
spool off
shutdown IMMEDIATE
host c:\coldbackup.bat
startup
host del c:\coldbackup.bat
set term on
set head on
set feedback on
set verify on

Similar Messages

  • Script for cold backup using RMAN

    Dear all,
    db_version:-10.2.0.4
    os_version:- Windows 2003 server
    I wish to schedule a script that will take cold backup of my database using RMAN.
    Any help is appreciated ..
    Edited by: user12000301 on May 18, 2011 5:02 AM

    Dear All,
    Thanks a lot for your valuable time :
    However i have managed to do it as follows :
    1. First i have configure the parameter of RMAN ( Since it is my UAT in Noarchive log mode), I have never tried RMAN cold backup on the same.
    Following is the out put of SHOW ALL;
    RMAN> show all;
    using target database control file instead of recovery catalog
    RMAN configuration parameters are:
    CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 2 DAYS;
    CONFIGURE BACKUP OPTIMIZATION OFF;
    CONFIGURE DEFAULT DEVICE TYPE TO DISK;
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'D:\DB\RMAN_BKP\BACKUPS%F';
    CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO COMPRESSED BACKUPSET;
    CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
    CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
    CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'D:\DB\RMAN_BKP\BACKUPS\DB_%U.%r';
    CONFIGURE MAXSETSIZE TO UNLIMITED;
    CONFIGURE ENCRYPTION FOR DATABASE OFF;
    CONFIGURE ENCRYPTION ALGORITHM 'AES128';
    CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
    CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\DB\RMAN_BKP\BACKUPS\SNCFDB.ORA';
    2. I have created a rman_cold_bkp.bat file which has following entry :
    cd c:\oracle10g\bin
    set oracle_sid=DB
    rman target system/*** @D:\DB\RMAN_BKP\SCRIPT\rman_cold_bkp.rcv log=D:\DB\RMAN_BKP\SCRIPT\rman_cold_bkp.log
    exit
    3. Whereas rman_cold_bkp.rcv file contains following contents:
    run
    allocate channel C1 device type disk;
    shutdown immediate;
    startup mount;
    backup database;
    alter database open;
    release channel C1;
    exit
    I did checked it and it;s working fine for me :-)
    Regards,
    Girish

  • Script for cold backup

    Hello friends;
    I'm trying to run following script which I copied from somewhere using .sh file but the same is not running and showing errors:
    Script:
    #!/bin/sh
    dy=`date +%D`
    bk='/backup/test'
    cm_oracle='tar -czhf '$bk'/'$dy'_db_bkp.tar.gz /TEST/oracle'
    [oracle@visionerp ]$ sh cold_bkp.sh
    : command not found:
    : command not found:
    : command not found:
    OS Linux 5.8.
    Regards
    Aneel Ahmed

    Hi ,
    I see this : ^M: bad interpreter. Can you vi your file and see if you have ^M character ?
    you may need to remove this. Dont do it manually.
    follow any of the links below :
    https://www.google.co.in/search?q=remove+%5Em+linux&oq=remove+%5EM+&aqs=chrome.1.69i57j0l5.7360j0j7&sourceid=chrome&espv=210&es_sm=93&ie=UTF-8

  • Using tar with zip for Datafiles backup on windows machine

    Dear all,
    We have R12 e business suite instance on windows.
    I was implementing cold backup for this. Unfortunately i am not a windows guy.
    I do have MKS tools installed on my windows machine, which contains the tar command.
    Can i use tar -cvzf <bkp>.tgz <location of datafiles> for this?, My main concern is, is it going to harm the source like corruption etc..
    Thanks

    If MKS tools are supported under Windows it should not corrupt input files whether input files are Oracle database files or any other Windows files.
    You could try instead to use RMAN for cold backup if you have already RMAN experience:
    - RMAN does not backup empty blocks
    - RMAN can also compress backups
    - RMAN is fully supported on Windows if corresponding Oracle version is certified on your Windows server.
    See an example of cold backup for database running in NOARCHIVELOG mode in http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmquick.htm#BRADV90059.
    If your database runs in ARCHIVELOG mode just backup your database online: http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmquick.htm#i766544.

  • 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

  • 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

  • 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

  • Stop and start database for cold backup

    Hi,
    Database :Oracle 10g R1
    OS : Red hat 3
    I have a RAC database with 2 nodes.
    I build this script to make a cold backup of the database. (I will put it in the cron tab).
    My question is the SRVCTL will work in this scripts??
    # ***** COLDBACKUP ORACLE DATABASE ON LINUX *****
    DIRECTORY=/u02/backup/script/; export DIRECTORY
    cd ${DIRECTORY}
    # ***** SHUTDOWN THE DATABASE *******
    export oracle_sid=RCDB
    srvctl stop database -d RCDB
    # *****cold backup for "RCDB" database on 13-FEB-07 ... *****
    # ***** COPY FILES *****
    # Redo logs
    cp /u02/oradata/RCDB/redo01.log ${DIRECTORY}
    cp /u02/oradata/RCDB/redo07.log ${DIRECTORY}
    cp /u02/oradata/RCDB/redo03.log ${DIRECTORY}
    cp /u02/oradata/RCDB/redo08.log ${DIRECTORY}
    # Datafiles
    #*********START UP DATABASE AND SERVICES********
    srvctl start database -d RCDB
    exit
    Message was edited by:
    ASkika
    Message was edited by:
    ASkika

    I need to put a quick policy backup ... and cold
    backup it's what I use and it works.And reduces the availability of your cluster.
    The problem about RMAN is that we never use it. I
    have to learn about it to make scripts to test....
    and this will tack me 2 or 3 days...I'd assume that installing RAC didn't go overnight, so why underfund the crucial part of any database system, the backup?
    There's even a step by step guide for backup on the Getting Started: DBAs page.
    Samples (and changes) on the latest version of RMAN can be found for example in RMAN Enhancements.
    Or take a look at this Oracle Magazine article:Faster Backup, Faster Recovery
    Backup and Recovery Basics in the user documentation may also be a good starting point.
    C.

  • Database hangs in shutdown immediate for cold backup

    Dear experts ,
    we have scheduled cold backup for our database.
    is there any solution to resolve below mentioned errors other than RMAN hot backup or shutdown abort ?
    Sat Jan 26 00:20:55 2013
    Active call for process 3939 user 'oracle' program '[email protected]'
    SHUTDOWN: waiting for active calls to complete.
    Sat Jan 26 01:15:59 2013
    SHUTDOWN: Active sessions prevent database close operation
    Instance shutdown aborted

    Hi,
    should we daily kill these processes with LOCAL=NO
    what is proposed solution in such cases ?
    is it not harmful for OS or database to kill these processes daily ?Yon can create shell script to find kill session only when you find active calls in your database alert log. You need not have to kill it on daily basis.
    Refer MOS tech notes for more details:
    *Alert Log: Shutdown Waiting for Active Calls to Complete [ID 1039389.6]*
    *What Is The Fastest Way To Cleanly Shutdown An Oracle Database? [ID 386408.1]*
    thanks,
    X A H E E R

  • Unix Cold Backup To Windows Machine

    Is it possible to restore a cold backup of 9.2 oracle to a windows operating system.
    My problem is, i have a cold backup and i want to restore just one datafile ..

    It's NOT possible to restore Unix cold bacup of Oracle database to Windows machine. You HAVE to restore it on the same OS
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • 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.

  • 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 {} \;

  • 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

  • Need clarification for cold backup and recovery

    Hello Everyone ..
    I have much confusion on cold backup and recovery topic.
    Already i posted a scanario regarding this and i want to know some clarity points to understand.
    1. I had cold backup two days before
    2. I am creating an object *(EMP)* and inserting some records then issue log switch continiously.
    3. Manually i removed all physical files (datafiles , control files , log files , redolog files ...)
    4. then i issued STARTUP FORCE MOUNT;
    5. here i am getting error identifying control file.
    6. cold backup two days before all files restored
    6. then i issue recover database using backup controlfile until cancel;
    7. i am trying to issue select * from emp; i am getting error
    select * from emp
    *ERROR at line 1:
    ORA-00942: table or view does not existMy QUESTION IS
    After cold backup finished , i created emp table ..
    when restoring old back " There is no emp table"
    *- then , can i recover emp table ? - If so , please explain about this ..*
    Note : REF - LINK https://forums.oracle.com/forums/message.jspa?messageID=11056341#11056341
    - Above link says what i did ? . In this thread i am asking concept & logic ..
    please do NOT consider as "*DUPLICATE*"

    When you recover the database using backup controlfile until cancel, you have to apply archived logs. Did you apply all of them?
    If the create command was in the online redo, not yet archived, and you lost the online redo, then you won't have it. This is why you want to have redo multiplexed, it is a critical piece.
    In some recovery scenarios, if you haven't lost the online redo, you need to specify those files as if they were archives.
    It is normally easier to just be sure you have the latest controlfiles and let Oracle figure it out automatically (which is why you want to use online RMAN backups rather than cold backups). But yes, it is important to understand what is going on for different scenarios. I used to have manual standbys, and one of the disaster instruction sets explained to try to get online redo over to the standby to lose as few transactions as possible. That could still be useful for some snapshot hardware type scenarios, assuming the business is too cheap to do proper failovers.

  • I'm looking for iPad backup to windows software reviews

    I'm looking for software that will run on windows that will backup/restore reliably :
    iPad2 / iPhone 5
    1. apps.
    2. photoes / movies.
    3. Settings.
    4. Documents.
    5. Contacts
    6. iBooks
    Thank you,
    Docfxit

    I realize iTunes is available for partial backups.
    I do sync with iTunes.  I don't like iTunes.
    1.  I have 4 different devices I need to backup up.  iTunes lets you have one account sync'ed to one PC.
    2.  iTunes doesn't backup everything.
    3.  iTunes fails sometimes and you loose what you have sync'ed.  I would like backup software that is more reliable.
    Thanks,
    Docfxit

Maybe you are looking for

  • User wants to see textual data for smartlist in the reports

    Hi, We have a smartlist for employee status-Single,Married. But these are stored as numbers in essbase as 1 and 2. The user wants to see the status as married or single in financial reports. Connection to planning details will do or using any functio

  • How can I get the current user and the current page?

    Hi everyone Question.. It is possible to get the current user (from the user's database on apex) and the current page? (I mean, if I'm in page 4 be able to query a variable / function or something which could give me the current displayed page) Thank

  • How to delete DTR wokspace folders

    Dear Experts I did some serious mistake and require your help to get rid of it. Basically I created one track and imported the Dev Config in NWDS and created some CAF DC inside it after creating a DTR client. Then I have deleted the projects manually

  • Using AIC in ProRes timeline

    I currently edit a lot of videos - mixing high quality original footage with found low quality clips from the web. I edit in ProRes, but for the sake of storage space, would it hurt much to convert the low quality web clips to AIC instead of ProRes a

  • Do Rentals Purchased on ATV sync back to iTunes?

    If so where can I find them please?