Cold backup using script

Dear all,
I need a script to take cold backup of oracle database 10.2.0.3.0 .. such that if todays date is 28-oct-08.. then a folder with the name 28oct08 to be created in the backup location.then using the script user should login to the database shutdown the db and listener and make sure this is completely down and copy the complete oracle files and home location to the above mentioned folder in the server.. any links or points will help a lot ?
Kai

Kai, rather than write a script to perform a cold backup for whatever platform you are on I suggest you write a script to generate the cold backup script. The script can connect to the database, read various v$ and dba views such as dba_data_files to get the necessary data file information, and place the file names into OS copy commands. The resulting script should probably include steps to connect to and stop the database and to restart the database instance when it is complete.
Be sure to include a copy of your control file and the spfile in your backup. You do not need to include the online redo logs in your manual cold backup.
An alternate might be to run an rman backup while the database is in restricted session depending on how freely your site has given out the DBA role and/or restricted session privilege.
HTH -- Mark D Powell --

Similar Messages

  • Cold backup using RMAN

    Dear All,
    db_version :10.2.0.4
    os_version:Window 2003 server
    Environment:Test
    I wish to perform cold backup using RMAN for the same i want to know following :
    1. What is the script / command ?
    2. How to restore cold backup completely ( ex:- if i lost all my data,redo and archives )
    3. Is it mandatory to open the database in RESETLOG mode after recovery ( since i have a cold backup ) ?
    Thanks in advance

    A "Cold" Backup is called a "Consistent" Backup.
    See http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/bkup003.htm#sthref297
    Backup :
    From the RMAN command line :
    SHUTDOWN IMMEDIATE
    STARTUP MOUNT
    BACKUP DATABASE
    BACKUP CURRENT CONTROLFILE  -- to get the controlfile in a separate backupsetRestore :
    STARTUP MOUNT
    RESTORE DATABASE
    ALTER DATABASE OPENIf you use an SPFILE, you can have an SPFILE backup included automatically with the controlfile backupset with CONFIGURE CONTROLFILE AUTOBACKUP ON and CONFIGURE CONTROLFILE AUTOBACKUP FORMAT ...
    Read the documentation.
    Hemant K Chitale

  • How lot take log backup using script in HANA

    We have SAP HANA SPS09.
    1) We are using script provided by SAP Note#1651055 to take the data backup.But it seems it is not taking log backup.HOw can we schedule logbackup ? or we have to use DBACOCKPIT or Studio only?
    2) My DB is log_mode OVERWRITE.I have taken backup using script.But when I tried to check the backup using below command
    hdbbackupdiag --check -f -d /mnt/resource/backup/xb8_bkp_19022015/ --logDirs  /mnt/resource/logbackup/,/usr/sap/XB8/HDB00/backup/log
    ERROR: [110081] Catalog backup log_backup_0_0_0_0 not found
    goazr1app904d:/usr/sap/XB8/HDB00>
    Is it like we have the DB in OVERWRITE mode thats why we are getting this error?Will my recovery work ?
    Thanks,
    Mofizur

    Did your issue got resolved?
    We are having same issue. We are on Rev 82 and using DD Boost EMC to take the backup using BACKINT.
    Though we are on Rev 82 I tried option provided by Pavan which didn't worked for me.
    hdbbackupdiag --check --useBackintForCatalog --backintDataParamFile /opt/ddbda/config/sap_hana_ddbda.utl -d /usr/sap/A0T/SYS/global/hdb/backint
    ERROR: [110081] Catalog backup log_backup_0_0_0_0 not found
    Regards,
    Nitin

  • 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

  • Cold backup automated script

    Hi--
    Can any one provide me one cold backup script,,with that i need to delete 2 days old backup and need to put current backup in that mountpoint.
    Thanks in advance.

    user8683962 wrote:
    We are not using RMAN So what is preventing you from starting? The real value of rman will be when you have to recover, it will already know where all the necessary peices are and what needs to be done. Plus, it will take care of the housekeeping of deleting your old, obsolete backups.
    and Hot backups.....So you don't care if you lose any changes that occur between your cold backups?
    i want to take a cold backup of my database every day and delete need to delete 2 days old backup, so that i can maintain 2 backups(today's and yesterday's) in my hand... Again, rman will do this for you, and more, and much more simply
    for this can any one provide me a script to make it automate by adding to crontab.If someone else hasn't by the time I get back to my hotel room this evening, I'll post an rman solution. It is a waste of time to work on a non-rman solution.

  • Cold backup shell scripts

    Could anyone please send me Shell script for taking Cold backups on solaris
    The script will be run and will start taking backup
    if possible Automatically it will Down and UP the Database
    Thanks
    Mark

    I'm sure that a short google search should find some example for you.
    Here some scripts :
    http://orafaq.com/scripts/
    http://www.dbasupport.com/oracle/scripts/Backup_Recovery/
    But, that would be better to google for more results :
    http://www.google.fr/search?q=oracle+script+backup&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:fr:official
    Nicolas.

  • My cold backup shell script not working

    I have written a shell script for cold backup but. It says that line 42 has unexpected syntex error '{' and line 57 unexpected end of file. Please help
    BKUP_DIR=/u03/backups/abu/nightly_backup
    LOG_FILE=/u03/backups/abu/backup.log
    ORACLE_HOME= /u01/app/oracle/product/10.2; export ORACLE_HOME
    ORACLE_SID=SEED; export ORACLE_SID
    PATH="$PATH:$ORACLE_HOME/bin";export PATH
    # Execute the backup procedure
    echo ymd=`date +%Y%m%d` >> $LOG_FILE
    echo "Database BACKUP starting." >> $LOG_FILE
    ORACLE_HOME=/u01/app/oracle/product/10.2; export ORACLE_HOME
    ORACLE_SID=SEED; export ORACLE_SID
    PATH="$PATH:$ORACLE_HOME/bin";export PATH
    rman target=/ << EOF
    shutdown immediate
    EOF
    if [ $? -eq 0 ]
    then
    mkdir -p ${BKUP_DIR} # make directory
    echo "Database shut down.">> $LOG_FILE
    else echo "not shutdown".>> $LOG_FILE
    fi
    if [ ! -d ${BKUP_DIR} ]
    then
    echo "Not a directory: ${BKUP_DIR}">> $LOG_FILE
    exit 1
    fi
    echo "Previous Backup is being removed." >> $LOG_FILE
    rm ${BKUP_DIR}/${ymd-${seed}.gz >>$LOG_FILE
    echo "Cold backup being performed." >> $LOG_FILE
    cp /u01/app/oracle/admin/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz #copying database files into new dir
    cp /u02/oradata/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz
    cp /u03/oradata/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz
    echo "Cold backup of archive logs being performed." >> $LOG_FILE
    mv /u01/app/oracle/product/10.2/dbs/arch/* ${BKUP_DIR}/$ymd-${cmsv}.gz
    gzip ${BKUP_DIR}/$ymd-${cmsv}
    echo "Restarting Database" >> $LOG_FILE
    rman target=/ << EOF
    startup
    EOF
    else
    echo "Database will NOT start up." >> $LOG_FILE
    fi
    echo 'ymd='date +%Y%m%d' >> $LOG_FILE
    echo "Database BACKUP has completed." >> $LOG_FILE
    exit

    I trying to write that script for our new production database. My script will create a folder automatically and will copy all database files into the folder. Now my script dont copy the files into the direcory that automatically create. I want my directory name with timestamp that i already speciy in my code. The scripts now generate an error that now such files or directory. I mean when it tries to copy files from source to destination folder. Please give me some suggestions.
    if [ $? -eq 0 ]
    then
    mkdir -p ${BKUP_DIR} # make directory
    echo "Database shut down.">> $LOG_FILE
    else echo "not shutdown".>> $LOG_FILE
    fi
    if [ ! -d ${BKUP_DIR} ]
    then
    echo "Not a directory: ${BKUP_DIR}">> $LOG_FILE
    exit 1
    fi
    echo "Previous Backup is being removed." >> $LOG_FILE
    rm ${BKUP_DIR}/${ymd-${seed}.gz >>$LOG_FILE
    echo "Cold backup being performed." >> $LOG_FILE
    cp /u01/app/oracle/admin/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz #copying database files into new dir
    cp /u02/oradata/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz
    cp /u03/oradata/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gzecho "Cold backup of archive logs being performed." >> $LOG_FILE

  • Hot backup using script

    hi,
    please help me to take hot backup.
    i want step by step procedure or send me some links
    with regards,
    Senthilkumarp

    I think you'd be better asking about backups in the correct forum...
    Try...
    General Database Discussions
    or
    Recovery Manager (RMAN)

  • A script for oracle10g cold backup on linux

    Hi,
    I have a urgent need to do a cold backup using o/s command. Can anyone please send me a script for this.
    Thanks in advance
    PK

    I ended up writing the script
    define 3 = &backup_directory
    define 4 = &instance_name
    define 5 = &user_dump_directory
    Set Heading Off
    Set Verify Off
    Set FeedBack Off
    Set LineSize 132
    Set PageSize 1000
    set termout off
    Spool cold_back.sql
    select 'connect /as sysdba' from dual;
    Select 'Startup Force' || CHR(10) ||
    'Shutdown Normal' From Dual;
    select '! mkdir '||'&&3'||'/'||to_char(sysdate,'yyyyddmm') from dual
    /* Data Files */
    Select '!cp ' || File_Name || ' &&3'||'/'||to_char(sysdate,'yyyyddmm') || CHR(10) ||'!gzip ' || '&&3' ||'/'||to_char(sysdate,'yyyyddmm')|| '/' || SubStr(File_Name, InStr(File_Name, '/', -1)+1) From Sys.DBA_Data_Files
    /* Redo Log Files */
    Select '!cp ' || Member || ' &&3'||'/'||to_char(sysdate,'yyyyddmm') || CHR(10) || '!gzip ' || '&&3'||'/'||to_char(sysdate,'yyyyddmm') || '/' || SubStr(Member, InStr(Member, '/', -1)+1) From V$LogFile
    /* Control Files */
    Select '!cp ' || name || ' &&3'||'/'||to_char(sysdate,'yyyyddmm') From V$controlfile
    /* Init and Config Files */
    Select '!cp $ORACLE_HOME/dbs/init&&4' || '.ora &&3'||'/'||to_char(sysdate,'yyyyddmm') From Dual
    alter session set tracefile_identifier=coldbackup
    alter database backup controlfile to trace
    select '!mv '||'&&5/*COLDBACKUP*' ||' &&3'||'/'||to_char(sysdate,'yyyyddmm') FROM dual
    Select 'Startup' From Dual;
    Select 'Exit' from dual;
    set termout on
    PROMPT " Run the output cold_back.sql script [sqlplus -s '/as sysdba' @cold_back.sql ]"
    Spool Off
    -----------------------

  • Cold backup from disaster system

    Hi,
    We are using oracle 9.2.0 ,HP UNIX and SAP version 4.7E.  We have disaster recovery configuration.
    We are normally taking oracle cold backup using UNIX commands and at the time of taking cold backup we shutdown the production system.
    My queries are:
    1.I do not want to shutdown production system. I want to shutdown disaster recovery system and take cold backup from disaster system using UNIX commands.
        (I) what are the prerequisites to follow this?
        (ii) Is it right way to take backups?
    Thnaks&Regards,
    Nani

    Hi Nani,
    The reply to your queries are below :
    1) Prerequisites :
    a) Make sure that the archive logs generated at the production site are stored temporarily at the DRP site, so that when the DRP DB starts after backup gets completed, it will get recovered using those logs.
    b) Make sure that there are scripts or procedures in place for automatic shipping and application of redo logs at the production and DRP sites respectively.
    c) Ensure that two consecutive backups of the DRP DB don't overlap, otherwise the redologs will only fill the temporary location (usually oraarch or saparch) without getting actually applied.
    2) This is definately a much better and efficient way to take backup of your production server. This will ensure higher availablity of your production server for carrying out business.
    Regards,
    Deoraj Alok.

  • Recovery from cold backup

    Hi,
    We take Hot backup everyday, but I took a cold backup using the same catalog. If I want to restore the cold backup I took, what is the proceedure. We are running on 10g in HP Unix.
    Thanks.

    Hi Rock2,
    If you want to restore the cold backup you need to know the tag belonging to this backup.
    Using the logfile of the coldbackup or <list backup summary;> in rman you should be able to get this info.
    The restore would be similar as:
    connect catalog rman/pwd@define_rcv;
    # check in catalog database for the dbid.
    # If so set the appropriate dbid by unhashing the line directly below using the current dbid
    # set dbid = define_dbid
    connect target /;
    STARTUP NOMOUNT;
    run {
    allocate channel tc1 type 'SBT_TAPE'; # or 'DISK'
    allocate channel tc2 type 'SBT_TAPE'; # or 'DISK'
    # adjust the TAG in the following lines
    restore controlfile from tag TAG0000001;
    sql 'alter database mount';
    restore database from tag TAG0000001;
    sql 'alter database open resetlogs';
    release channel tc1;
    release channel tc2;
    Regards,
    Tycho

  • Restore from cold backup (rac server)

    Hi All,
    Oracle version : 10g
    OS : SunOS dixie1 5.10 Generic_118855-36 i86pc i386 i86pc
    I am having cold backup of RAC server (2 nodes), I want to restore from cold backup.
    The problem is that : when i performed the cold backup using rman at that time Oracle was having 3 ASM diskgroups.But unforunately that disk is no more in use due to some fault.
    Now my question is how can i restore from the cold backup as when i'll restore from the cold backup this will ask for the same ASM diskgroups.Even more if i creates the same diskgroup with the same name and same configuration then my doubt is that rman will allow me to restore the same from the cold backup as ASM disk header changed now ?
    Thanks,
    Vipin

    VipinK wrote:
    Hi All,
    Oracle version : 10g
    OS : SunOS dixie1 5.10 Generic_118855-36 i86pc i386 i86pc
    I am having cold backup of RAC server (2 nodes), I want to restore from cold backup.
    The problem is that : when i performed the cold backup using rman at that time Oracle was having 3 ASM diskgroups.But unforunately that disk is no more in use due to some fault.
    Now my question is how can i restore from the cold backup as when i'll restore from the cold backup this will ask for the same ASM diskgroups.Even more if i creates the same diskgroup with the same name and same configuration then my doubt is that rman will allow me to restore the same from the cold backup as ASM disk header changed now ?
    Yes.You can do these and restore/recover your database.First you need startup your ASM instance then create your ASM disk groups and do following:
    1.Edit pfile and change controlfile location to diskgroup(Consder that +dgr1)
    2.Restore controlfile to this disk group using backup of controlfiles(you say that is cold backup)
    rman target /
    /*Instance  need starting up from pfile*/
    startup nomount ;
    /*then restore controlfile,give full path of controlfile from coldbackup*/
    restore controlfile from 'coldbackup_location\coltrolfile';
    alter database mount;
    catalog start with 'coldbackup_location';
    backup as copy database format  '+dgr1';
    switch database to copy;
    alter database open;

  • Restoring tigger from cold backup.

    Hi
    I have one problem..... recently i have drooped 1 trigger by mistake of one of my user in database. Now the problem is... we never take the logical backup of that DB.
    Backup mechanism of the database is Cold Backup and size is *2TB*.
    Now i have to restore that trigger from the cold backup with minimum effort , do i have to create the Clone database with the Cold backup using all the datafiles ...? or System tablespace ( or datafile) and default Schema tablespace(Schema which holds the trigger and its tables) in enough for restoring the trigger ?
    I hope i am clear with my question. please let me know if you need more details.
    Please suggest some best and fast way to solve this problem.
    Thanks,

    You need to restore enough to OPEN the DB can you please elaborate this clearly....
    The version is :
    Oracle Database 11g Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0 ;     Production
    TNS for Linux: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production I have dropped in this Monday. Flashback is not implemented.
    Edited by: user10915512 on May 10, 2011 7:15 AM

  • Build standby database using cold backup on a different file system & host

    Hi gurus,
    The database version is 11.2.0.3. OS is HP UX Itanium 11.31
    I am building a standby database using cold backup of primary. The primary mount points are (/p003/oracle, /p004/oracle) on HOST1 and the standby file system on HOST2 are (/s003/oracle,/s004/oracle). I am not using Data Guard to apply logs as we have a script that mounts the log location periodically to standby server and apply the logs to make it current. I am using cold backup as the database is small like 200G and can be taken down. Could someone help me with the steps to build standby using cold backup for a different file location in standby ?? My concern is I can copy the data files from /p003 to /s003. How will I build the controlfile ?
    If it was same File system on both HOST 1 and HOST2 I can copy the cold backup to the standby server, build a standby control file on primary and copy and replace the standby control file and everything was set.
    Thanks
    Cherrish Vaidiyan

    Hello;
    I have a note on this using a cold copy of the current files instead of a copy backup :
    http://www.visi.com/~mseberg/data_guard_on_oracle_10_step_by_step.html
    I will post SCP SQL in a moment.
    Best Regards
    mseberg
    set heading off
    set feedback off
    set pagesize 100
    set linesize 400
    select 'scp '||a.name ||' server_name:' || a.name as newname from v$datafile a;
    select 'scp '||a.name ||' server_name:' || a.name as newname from v$controlfile a;
    select 'scp '||a.member ||' server_name:' || a.member as newname from v$logfile a;Edited by: mseberg on May 25, 2013 10:35 AM

  • A decent cold backup script

    Oracle version : 11G release 2
    Platform : AIX
    After going through various OTN posts, i wrote the below Cold backup script (Untested). If there are any unnecessary stuff or enhancements required, please let me know
    $ rman target /
    RMAN>
    run
         allocate channel c1  type disk format '/u05/rmanbkp/%d_COLD_DB_%u';
         sql 'alter system archive log current';
         shutdown immediate;
         startup mount;
         backup database including current controlfile tag='mydbname_full_bkp';
         backup spfile tag = 'mydbname_SPFILE';
         release channel c1;
    }

    Hi T.Boyd
    What do you guys think of the backup script? Any room for improvement? I found in a small percentage of the shutdown immediate commands issued, the instance hangs (specially when the machine is very busy).
    I have modified my rman coldbackup the procedure to:
    shutdown abort;
    host 'sleep 3';
    startup restrict;
    shutdown immediate;
    startup mount;Maybe you can add more channels to improve performance. You can use more resources as there are no users on the database anyway....
    Regards,
    Tycho

Maybe you are looking for

  • Blind copy while sending a mail...

    Hi Friends, How to set a recipient under the blind copy recipient list (BCC) while sending a mail using the function module SO_DOCUMENT_SEND_API1. I have checked the flag <b>blind_copy</b> but not seeing that recipient under the bcc list. Some body p

  • How do you install Perforce as daemon on OS X Snow Leopard Server?

    I recently purchased a mac mini with Snow Leopard Server, and I am interested in installing Perforce as a daemon. I am familiar on how to do this on a Linux distro, but not so much on Snow Leopard Server. Is there some documentation that explains how

  • Received thrugh cheque from customer

    Dear all SAP Guru's, Hi i have a problem regarding with collecting cheque from customer. i explain our client business process for that and i need suggestion for that. 1. Customer invoice amount of 50000 2. Collecting from customer amount of 1, 00,00

  • Problem initiating process with multiple operations using HTTP/SOAP

    Hi, I have defined a process which has multiple operations. My process starts with a pick activity containing onMessage branches for each possible operation. When I initiate this service using the BPEL console, I choose one of the operations and ever

  • WDURLGenerator.isSecureURL: WD Error in Portal User Admin Identity Mgmt

    Hi: I've come across a strange error while selecting/creating Users in EP 7.0 under UserAdmin > Identity Mgmt > Selecting a User (clicking on user) I got the following error: <b>java.lang.NoSuchMethodError: com.sap.tc.webdynpro.services.sal.url.api.W