Archivelog Backup Script

Hello
I have a backup script which is kicked off by cron every 2 hours. I am facing a problem of script geting overlapped .Like say if the script is running at 5 am and the next one is scheduled at 7 am...if 5 am script is still backing up archive logs past 7 am then 7 am script also starts and it finishes abruptly..i want to avoid this situation.
For this i modified my script so that it can check doing a "ps -ef|grep arch_bkup.sh|wc -l"...bt i dont wanto depend on this number everytime...Does anyone came across this situation and has a better solution..Please reply
Thanks

sure
just from a simple command line:
Returns my grep:
# ps -ef | grep backup_arch.sh
oracle 22449 2861 0 11:30:59 pts/3 0:00 grep backup_arch.sh
# echo $?
0
Returns nothing (used with -v to eliminate the grep that I run)
# ps -ef | grep backup_arch.sh | grep -v grep
# echo $?
1
Normally your output would produce at least 2 lines when the job was running...
Let me know if you need any more assistance with it.
Edited by: Jamie CC on Dec 10, 2009 8:37 AM
Should also mention that $? is the return code of the last command ran so in your script make sure you check it right after your grep...
Edited by: Jamie CC on Dec 10, 2009 8:38 AM

Similar Messages

  • Todays created archivelog backup script

    Hi
    i want take backup todays created archivelog.please tell me script or command
    thanks

    Hi,
    RMAN> BACKUP ARCHIVELOG FROM TIME 'SYSDATE';
    http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/bkup003.htm#sthref365
    Why after completed backup archivelog don`t you delete archivelogs?
    rman> backup archivelog all delete input
    after backup (exemple every night 23:59:00 - I don`t know how actually your db generates archivelog and size, in this situation, we decided backup will delay 1 minute), when you execute again, it will take new archivelogs with new date.

  • Cold backup script

    Hi,
    i want to make a cold backup and schedule it in CRON, but don't know why but it doesn't work. This is what i've in de "full.rman" file:
    connect target /
    shutdown immediate;
    startup mount;
    backup database as compressed backupset;
    crosscheck backup;
    delete expired backup;
    alter database open;
    exit
    i tried to run this script by rman @full.rman
    but when i do this i'm getting the following error:
    RMAN> backup database as
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00558: error encountered while parsing input commands
    RMAN-01009: syntax error: found "as": expecting one of: "archivelog, backup, backupset, channel, copy, controlfilecopy, current, database, datafile, datafilecopy, delete, diskratio, db_recovery_file_dest, filesperset, format, from, force, include, keep, (, maxsetsize, noexclude, nokeep, not, pool, plus, reuse, recovery, ;, skip, spfile, setsize, tablespace, tag, to"
    RMAN-01007: at line 1 column 17 file: full.rman
    In the past i had another error where it looked like it wasn't shutting down the database and starting it up in mount mode. So how can i make a script what wil do what i want :)
    Thanks in advance.
    regards,
    Osman

    Try:
    backup as compressed backupset database;

  • Rman hot backup script  gives error in R12.

    hi experts
    i m facing following prob when run the backup script. 1 day before the same script runs correctily but now  it gives me error at the allocatioion of channel rest of command run correctly.
    [root@testerp rman_log]# cat UAT_daily_rman_hot_bkp_01-11-14_140301.log
    -bash: /root/.bash_profile: Permission denied
    Recovery Manager: Release 11.1.0.7.0 - Production on Sat Jan 11 14:03:01 2014
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    connected to target database: UAT (DBID=2855851979)
    connected to recovery catalog database
    RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12>
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00558: error encountered while parsing input commands
    RMAN-01009: syntax error: found "end-of-file": expecting one of: "allocate, alter, advise, backup, beginline, blockrecover, catalog, change, copy, convert, crosscheck, configure, duplicate, debug, delete, execute, endinline, flashback, host, mount, open, plsql, recover, release, replicate, report, restore, resync, repair, }, set, setlimit, sql, switch, startup, shutdown, send, show, transport, validate"
    RMAN-01007: at line 12 column 1 file: standard input
    RMAN>
    RMAN>
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00558: error encountered while parsing input commands
    RMAN-01009: syntax error: found "identifier": expecting one of: "for"
    RMAN-01008: the bad identifier was: c2
    RMAN-01007: at line 1 column 18 file: standard input
    RMAN>
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00558: error encountered while parsing input commands
    RMAN-01009: syntax error: found "identifier": expecting one of: "for"
    RMAN-01008: the bad identifier was: c3
    RMAN-01007: at line 1 column 18 file: standard input
    RMAN>
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00558: error encountered while parsing input commands
    RMAN-01009: syntax error: found "identifier": expecting one of: "for"
    RMAN-01008: the bad identifier was: c4
    RMAN-01007: at line 1 column 18 file: standard input
    RMAN>
    Starting backup at 11-JAN-14
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=362 device type=DISK
    channel ORA_DISK_1: starting incremental level 1 datafile backup set
    channel ORA_DISK_1: specifying datafile(s) in backup set
    input datafile file number=00021 name=/d06/UAT/proddata/a_txn_data06.dbf
    input datafile file number=00392 name=/d06/UAT/db/apps_st/data/a_txn_data01.dbf
    input datafile file number=00401 name=/d06/UAT/db/apps_st/data/a_txn_data02.dbf
    input datafile file number=00402 name=/d06/UAT/db/apps_st/data/a_txn_data03.dbf
    input datafile file number=00022 name=/d06/UAT/proddata/a_txn_data07.dbf
    input datafile file number=00014 name=/d06/UAT/db/apps_st/data/a_txn_data04.dbf
    input datafile file number=00020 name=/d06/UAT/proddata/a_txn_data05.dbf
    input datafile file number=00011 name=/d06/UAT/db/apps_st/data/sysaux01.dbf
    input datafile file number=00018 name=/d06/UAT/db/apps_st/data/sysaux02.dbf
    input datafile file number=00023 name=/d06/UAT/proddata/a_txn_data08.dbf
    input datafile file number=00379 name=/d06/UAT/db/apps_st/data/undo01.dbf
    input datafile file number=00024 name=/d06/UAT/proddata/sysaux03.dbf
    input datafile file number=00025 name=/d06/UAT/proddata/sysaux04.dbf
    input datafile file number=00033 name=/d06/UAT/proddata/a_txn_ind11.dbf
    input datafile file number=00029 name=/d06/UAT/proddata/a_txn_ind09.dbf
    input datafile file number=00030 name=/d06/UAT/proddata/a_txn_ind10.dbf
    input datafile file number=00015 name=/d06/UAT/db/apps_st/data/a_txn_ind06.dbf
    input datafile file number=00026 name=/d06/UAT/db/apps_st/data/a_txn_ind07.dbf
    input datafile file number=00028 name=/d06/UAT/db/apps_st/data/a_txn_ind08.dbf
    input datafile file number=00393 name=/d06/UAT/db/apps_st/data/a_txn_ind01.dbf
    input datafile file number=00403 name=/d06/UAT/db/apps_st/data/a_txn_ind02.dbf
    input datafile file number=00404 name=/d06/UAT/db/apps_st/data/a_txn_ind03.dbf
    input datafile file number=00405 name=/d06/UAT/db/apps_st/data/a_txn_ind04.dbf
    input datafile file number=00406 name=/d06/UAT/db/apps_st/data/a_txn_ind05.dbf
    input datafile file number=00400 name=/d06/UAT/db/apps_st/data/a_media01.dbf
    input datafile file number=00353 name=/d06/UAT/db/apps_st/data/system08.dbf
    input datafile file number=00013 name=/d06/UAT/db/apps_st/data/system12.dbf
    input datafile file number=00352 name=/d06/UAT/db/apps_st/data/system09.dbf
    input datafile file number=00394 name=/d06/UAT/db/apps_st/data/a_ref01.dbf
    input datafile file number=00407 name=/d06/UAT/db/apps_st/data/a_ref02.dbf
    input datafile file number=00396 name=/d06/UAT/db/apps_st/data/a_summ01.dbf
    input datafile file number=00395 name=/d06/UAT/db/apps_st/data/a_int01.dbf
    input datafile file number=00008 name=/d06/UAT/db/apps_st/data/a_queue02.dbf
    input datafile file number=00027 name=/d06/UAT/db/apps_st/data/a_queue03.dbf
    input datafile file number=00031 name=/d06/UAT/db/apps_st/data/a_queue04.dbf
    input datafile file number=00399 name=/d06/UAT/db/apps_st/data/a_queue01.dbf
    input datafile file number=00001 name=/d06/UAT/db/apps_st/data/system01.dbf
    input datafile file number=00002 name=/d06/UAT/db/apps_st/data/system02.dbf
    input datafile file number=00003 name=/d06/UAT/db/apps_st/data/system03.dbf
    input datafile file number=00004 name=/d06/UAT/db/apps_st/data/system04.dbf
    input datafile file number=00005 name=/d06/UAT/db/apps_st/data/system05.dbf
    input datafile file number=00398 name=/d06/UAT/db/apps_st/data/a_archive01.dbf
    input datafile file number=00295 name=/d06/UAT/db/apps_st/data/system06.dbf
    input datafile file number=00351 name=/d06/UAT/db/apps_st/data/system07.dbf
    input datafile file number=00354 name=/d06/UAT/db/apps_st/data/system11.dbf
    input datafile file number=00288 name=/d06/UAT/db/apps_st/data/system10.dbf
    input datafile file number=00012 name=/d06/UAT/db/apps_st/data/apps_ts_tools01.dbf
    input datafile file number=00016 name=/d06/UAT/db/apps_st/data/a_ref03.dbf
    input datafile file number=00019 name=/d06/UAT/db/apps_st/data/MLSEIGL01.dbf
    input datafile file number=00032 name=/d06/UAT/db/apps_st/data/RMAN01.dbf
    input datafile file number=00397 name=/d06/UAT/db/apps_st/data/a_nolog01.dbf
    input datafile file number=00314 name=/d06/UAT/db/apps_st/data/portal01.dbf
    input datafile file number=00017 name=/d06/UAT/db/apps_st/data/a_int02.dbf
    input datafile file number=00006 name=/d06/UAT/db/apps_st/data/ctxd01.dbf
    input datafile file number=00010 name=/d06/UAT/db/apps_st/data/olap.dbf
    input datafile file number=00009 name=/d06/UAT/db/apps_st/data/odm.dbf
    input datafile file number=00007 name=/d06/UAT/db/apps_st/data/owad01.dbf
    channel ORA_DISK_1: starting piece 1 at 11-JAN-14
    [root@testerp rman_log]#
    backup script is below:
    in this script it returns error only at the channel allocaition rest of all backup command i run manually or with scirpt it runs correctly.4
    i m not able to know why it returns error only at challnel allocation 1 day before it runs correctly.
    [orauat@testerp rman_script]$ cat rman_backup.sh
    #!/bin/sh
    #ORACLE_SID=UAT
    #BACKUP_START_TIME='date +"%y""%m""%d"_"%H""%M""%S"'
    #ORACLE_HOME=/d06/UAT/db/tech_st/11.1.0
    #PATH=$PATH:${ORACLE_HOME}:${ORACLE_HOME}/bin
    #export ORACLE_SID
    #export ORACLE_HOME
    #export PATH
    /d06/UAT/db/tech_st/11.1.0/bin/rman catalog rman/rman007 target sys/sysuat <<EOF
    run
    allocate channel c1 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_Arch_%c_%U';
    sql 'alter system switch logfile';
    sql 'alter system switch logfile';
    sql 'alter system archive log current';
    delete expired archivelog all;
    crosscheck archivelog all;
    backup archivelog all;
    delete noprompt archivelog all completed before 'sysdate-4' backed up 1 times to disk;
    allocate channel c2 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_DB_%c_%U';
    allocate channel c3 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_DB_%c_%U';
    allocate channel c4 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_DB_%c_%U';
    backup incremental level 1 database;
    delete expired backup device type disk;
    delete obsolete device type disk;
    release channel c1;
    release channel c2;
    release channel c3;
    release channel c4;
    exit
    EOF
    regards
    pritesh ranjan

    yes the script is edited
    i have add some command line and edit it for take the full backup level=0 on the same directory with different formant name but location is same.
    can i take full backup level 0 and incremental backup level 1 in the same directory with the different format name.
    for exp:
    allocate channel c2 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_DB_%c_%U';
    allocate channel c3 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_DB_%c_%U';
    allocate channel c4 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_DB_%c_%U';
    i allocate these three channel for incremental level 1 backup;
    the backup is done successfully without any error.
    after that i have change
    allocate channel c2 device type disk format '/d06/UAT/rman_hot_backup/Weekly_backup%d_DB_%c_%U';
    allocate channel c3 device type disk format '/d06/UAT/rman_hot_backup/Weekly_backup%d_DB_%c_%U';
    allocate channel c4 device type disk format '/d06/UAT/rman_hot_backup/Weekly_backup%d_DB_%c_%U';
    backup  database incremental level 0
    after doing the above changes it get the error. with the channel location.
    i have to schedule daily incremental backup level 1 and weekly full backup level 0.
    plz suggest me i have to take incremental 1 and full incremental level 0 backup on seperate directory for different format name.
    regards
    pritesh ranjan

  • Rman backup scripts

    Hi, I am inquiring as to how to create a job to run an rman script without using the Enterprise manager to schedule and create the job.
    Thanks
    James

    You are going to want to at least set the following RMAN parameters. You may need to set other depending on your environment.
    RETENTION POLICY
    CONTROLFILE AUTOBACKUP ON
    CONTROLFILE AUTOBACKUP FORMAT
    PARALLELISM
    CHANEL DEVICE TYP FORMAT
    SNAPSHOT CONTROLFILE NAME
    Below is an example of how I have these set on a test system. This from a 10g database
    RMAN> show all;
    RMAN configuration parameters are:
    CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
    CONFIGURE BACKUP OPTIMIZATION OFF; # default
    CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/backup/ecmtst/%F';
    CONFIGURE DEVICE TYPE DISK PARALLELISM 3 BACKUP TYPE TO BACKUPSET;
    CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/backup/ecmtst/%U';
    CONFIGURE MAXSETSIZE TO UNLIMITED; # default
    CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
    CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
    CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
    CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/backup/ecmtst/snapcf_ecmtst1.f';
    RMAN>

  • Oracle Hot Backup Script Windows Server 2003

    Hello,
    Does anyone here have a working Oracle 10I database hot backup script for Windows Server 2003? If so can you please post it here.
    Thanks.

    Here is a basic batch script I have used for a hot backup of Oracle databases using RMAN
    Will just need to update some locations based on you environment just check all the comments and change what you need to but this can be scheduled to run regularly through the windows scheduler for database backups.
    This will take a hot backup and backup the archive logs.
    Let me know if you have any quesitons.
    REM #####################################################################
    REM # Name: rman_hot_backup_dsk.bat
    REM #
    REM # Description:
    REM #
    REM # Generic Hot backup script that accepts the SID
    REM #
    REM # Parameters: Instance Name, backup level
    REM #
    REM #####################################################################
    REM #
    REM # Check if SID was Passed
    if (%1)==() goto USAGE
    if (%2)==() goto USAGE
    REM # assign ORACLE_SID to passed SID
    set ORACLE_SID=%1
    REM # Set the hot backup level 0-full 1-incremental
    set LEVEL=%2
    REM # export the page list
    set [email protected]
    REM # assign a date we can use as part of the logfile
    set DTE=%date:~-4%%date:~4,2%%date:~7,2%_%time:~0,2%%time:~3,2%%time:~6,2%
    REM # Take the spaces out of the date string so we can use in our file name
    set DTE=%DTE: =%
    REM # set the script location
    REM # Set location of where you will put script
    set SCRIPTLOC=C:\app\oracle\scripts
    cd %SCRIPTLOC%
    REM # Set the Temporary command file that we will write our rman script to
    set CMDFILE=%SCRIPTLOC%\%ORACLE_SID%_rman_hot_backup_dsk.cmd
    REM # Remove the temporary file if it exists
    del /q %CMDFILE%
    REM # Set the logfile directory
    REM # Change based on where you want the backup logs to go
    set LOGPATH=W:\ORACLE_BACKUP\logs
    set LOGFILE=%ORACLE_SID%_rman_hot_backup_dsk_%DTE%.log
    set LOG=%LOGPATH%\%LOGFILE%
    REM # Set the path of the backup location
    REM # Change based on disk pach for you disk based backups
    set BACKLOC=\\VirtualBox\ORA_ITS03P\ORACLE_BACKUP\%ORACLE_SID%
    REM # Lets set the ORACLE_HOME for the host
    REM # Set to your actual ORACLE_HOME location
    set ORACLE_HOME=C:\app\oracle\product\10.2.0\db_1
    # Set the rest of the Oracle Environment
    # based on our ORACLE_HOME
    set LIBPATH=%ORACLE_HOME%/lib
    set LD_LIBRARY_PATH=%ORACLE_HOME%/lib
    set TNS_ADMIN=%ORACLE_HOME%/network/admin
    REM #set ORA_NLS10=%ORACLE_HOME%/nls/data
    REM Set our PATH with the ORACLE_HOME so that we have a good
    REM clean environment to work with
    set PATH=%ORACLE_HOME%/bin;%ORACLE_HOME%/OPatch;%PATH%
    REM # Write Temporary command file for RMAN backup
    echo # configure retention policy >> %CMDFILE%
    echo CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 14 DAYS ; >> %CMDFILE%
    echo # >> %CMDFILE%
    echo # lets start clean for our hot backup by doing full crosschecks >> %CMDFILE%
    echo change archivelog all crosscheck ; >> %CMDFILE%
    echo crosscheck backup of database; >> %CMDFILE%
    echo crosscheck backup of controlfile; >> %CMDFILE%
    echo # >> %CMDFILE%
    echo # delete all expired and obsolete backups >> %CMDFILE%
    echo allocate channel for maintenance type disk ; >> %CMDFILE%
    echo delete noprompt expired archivelog all ; >> %CMDFILE%
    echo delete noprompt expired backup ; >> %CMDFILE%
    echo delete noprompt obsolete ; >> %CMDFILE%
    echo # >> %CMDFILE%
    echo # Configure control file for auto backup >> %CMDFILE%
    echo configure controlfile autobackup on ; >> %CMDFILE%
    echo CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%BACKLOC%\%ORACLE_SID%_controlfile_%%F' ; >> %CMDFILE%
    echo # >> %CMDFILE%
    echo # Configure default device type here we use disk and set parallelism to 2 >> %CMDFILE%
    echo configure default device type to disk ; >> %CMDFILE%
    echo configure device type disk parallelism 2 ; >> %CMDFILE%
    echo # >> %CMDFILE%
    echo # Must format the default channel for the device type disk >> %CMDFILE%
    echo # other wise tmp area in creating pieces will be done in >> %CMDFILE%
    echo # the $ORACLE_HOME/dbs directory >> %CMDFILE%
    echo CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT = '%BACKLOC%\%ORACLE_SID%_hot_%%U' ; >> %CMDFILE%
    echo # >> %CMDFILE%
    echo # Configure our retention policy for this database >> %CMDFILE%
    echo configure retention policy to recovery window of 14 days ; >> %CMDFILE%
    echo # >> %CMDFILE%
    echo # Let configure our channels for our backup >> %CMDFILE%
    echo # Channel 1 disk and we indicate where it goes not taking the default >> %CMDFILE%
    echo configure channel 1 device type disk MAXPIECESIZE = 4G format '%BACKLOC%\%ORACLE_SID%_hot_%%U' ; >> %CMDFILE%
    echo # Channel 2 disk and we indicate where it goes not taking the default >> %CMDFILE%
    echo configure channel 2 device type disk MAXPIECESIZE = 4G format '%BACKLOC%\%ORACLE_SID%_hot_%%U' ; >> %CMDFILE%
    echo # >> %CMDFILE%
    echo # Backup our database with compression on >> %CMDFILE%
    echo backup as compressed backupset incremental level %LEVEL% tag hot_%LEVEL%_%DTE% DATABASE ; >> %CMDFILE%
    echo # >> %CMDFILE%
    echo # Backup our archive log files that have not been backed up >> %CMDFILE%
    echo backup as compressed backupset format '%BACKLOC%\%ORACLE_SID%_Archive_%%d_%%s_%%p_%%t' archivelog all not backed up 1 times ; >> %CMDFILE%
    echo # >> %CMDFILE%
    echo # Backup Control file for standby in case needed >> %CMDFILE%
    echo backup current controlfile for standby ; >> %CMDFILE%
    echo # >> %CMDFILE%
    echo # let put a controlfile to trace >> %CMDFILE%
    echo sql 'ALTER DATABASE BACKUP CONTROLFILE TO TRACE' ; >> %CMDFILE%
    REM # Run the RMAN backup without using the recovery catalog
    %ORACLE_HOME%\bin\rman target=/ nocatalog cmdfile=%CMDFILE% msglog=%LOG%
    REM # Remove our temporary command file
    del /q %CMDFILE%
    REM # Mail Archive backup log
    REM # This relies on the free bmail utility
    bmail -date -m %LOG% -f [email protected] -s <smtpserver> -t %PAGE_LIST% -a "HOT Backup results"
    REM # Goto end of script as we are done
    goto END
    :USAGE
    echo "Must Pass ORACLE_SID and hot backup level as parameters."
    goto END
    :END

  • Running same backup script on two different Databases

    Hello All,
    I am running same backup script on two different Databases.
    But output is different.
    Please give me your feedback.
    1) Database 1:
    OS: AIX
    DB: 10.1.0.4.0
    Script:
    export ORACLE_SID=sid1
    cd $ORACLE_HOME/bin
    ./rman nocatalog << EOF
    connect target
    ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE disk;
    configure controlfile autobackup on;
    backup as compressed backupset database plus archivelog delete input;
    delete noprompt obsolete;
    exit
    EOF
    6 Files created:
    -rw-r----- 1 oracle dba 4140032 Jun 19 00:00 uvhlvjs8_1_1
    -rw-r----- 1 oracle dba 38029824 Jun 19 00:00 backup_uuhlvjs8_1_1
    -rw-r----- 1 oracle dba 781287424 Jun 19 00:20 v1hlvjsk_1_1
    -rw-r----- 1 oracle dba 578027520 Jun 19 00:23 backup_v0hlvjsk_1_1
    -rw-r----- 1 oracle dba 1222656 Jun 19 00:23 backup_v2hlvl7r_1_1
    -rw-r----- 1 oracle dba 4259840 Jun 19 00:23 c-1052429639-20060619-00
    -rw-r----- 1 oracle dba 4177920 Jun 19 00:23 SNAPCF_ATHENA.F
    2. Databse 2:
    OS: Linux (SLES 8)
    DB: 10.1.0.5.0
    Log Archive Filename Format: %t_%s_%r.dbf
    2 files created:
    1_17804_535674251.dbf 1_17837_535674251.dbf SID_2chlmrrl_1_1.1
    1_17805_535674251.dbf 1_17838_535674251.dbf SID_2dhlms8c_1_1.1
    I am also getting dbf file every one hour as below:
    1_17868_535674251.dbf
    DN

    waiting for reply

  • Recovery doesn't see old archivelog backups

    I am doing weekly full backups
    backup
    as compressed backupset
    channel=disk1
    full
    database
    include current controlfile
    plus archivelog
    delete all input;
    Point-in-time recovery worked fine using:
    set until scn $1 ;
    restore database;
    recover database delete archivelog;
    release channel c1;
    alter database open resetlogs;
    Untill today, when I tried recovering using backupset that is two weeks old.
    Restore database worked fine. But media recovery failed with errors like this:
    RMAN-03002: failure of recover command at 09/28/2006 21:06:58
    RMAN-06053: unable to perform media recovery because of missing log
    RMAN-06025: no backup of log thread 1 seq 10992 lowscn 200869768 found to restore
    RMAN-06025: no backup of log thread 1 seq 10991 lowscn 200868902 found to restore
    database recovery was unable to find archivelog backups.
    What was confusing is that 'list backup' would show me the missing backups as available:
    BS Key Size Device Type Elapsed Time Completion Time
    1653 497.50K DISK 00:00:01 17-SEP-06
    BP Key: 1868 Status: AVAILABLE Compressed: YES Tag: TAG2006_09_17
    Piece Name: /disk0/oradata/live/LIVE/backupset/2006_09_17/live_2006_09_17_archivelog_mohtfs3a_1_1.bck
    List of Archived Logs in backup set 1653
    Thrd Seq Low SCN Low Time Next SCN Next Time
    1 10992 200869768 17-SEP-06 200870470 17-SEP-06
    I tried all what I could think of to get rman to see those backups.
    Finally, I changed computer system time to two weeks ago - and recovery worked !
    Why is recovery ignoring old archivelog backups ? How to make recovery see those old files ? Is there a more elegant way to recover to a point in time that doesn't require me to change computer clock ? Using 'set until scn' is the standard way I do it but it seems to work only within a certain time frame.

    I don't think that's the problem. I use backupsets to create a copy of database on another machine. So, I never (knock on the wood) do recovery of the database that is being backed up.
    This is how the script looks like:
    set dbid 123123;
    startup nomount
    run
    allocate channel c1 device type disk;
    restore controlfile from autobackup maxdays = 100;
    alter database mount;
    set until scn 7878787;
    restore database;
    recover database delete archivelog; -- it fails when it gets to this phase, complaining about missing files
    release channel c1;
    alter database open resetlogs;
    }

  • RMAN Level 0 backup script

    Hi All,
    Required level 0 backup script.
    We have 10gR2 [10.2.0.4] Production instance, for backup required level 0 script.
    Regards
    Shaik

    Shaik wrote:
    Hi All,
    Required level 0 backup script.
    We have 10gR2 [10.2.0.4] Production instance, for backup required level 0 script.
    Regards
    ShaikHi shaik
    RMAN>run {
    backup incremental level 0 database plus archivelog ;
    delete noprompt obsolete ;
    for manual allocation channel for tape
    RMAN > RUN {
    ALLOCATE CHANNEL tape1 DEVICE TYPE sbt;
    BACKUP DATABASE PLUS ARCHIVELOG;
    RELEASE CHANNEL;
    --neeraj                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Delete obsolete causing issue with archivelog backups......or is it?

    Hi, hoping someone will have the answer for me.
    Oracle 10g R2 on Windows 2003 R2 Sever.
    The start of my RMAN script runs, i do crosschecks and delete obsolete backups from type disk. My redundancy is set to 1. I then run compressed backups of the datafiles and archivelogs with 2 channels. This leaves me with two days of full backups on disk (i have months worth on netbackup) the only problem is that one of the archivelog channel backups from the previous day is missing when i know it was there before the delete obsolete was run.
    here is the script:
    run{
    CROSSCHECK BACKUP;
    CROSSCHECK archivelog all;
    CROSSCHECK COPY;
    CROSSCHECK backup of database;
    CROSSCHECK backup of controlfile;
    delete noprompt obsolete device type disk;
    run {
    allocate channel ch1 type disk format 'Z:\backup\rman\orcl\%d_%T_%U';
    allocate channel ch2 type disk format 'Z:\backup\rman\orcl\%d_%T_%U';
    backup as COMPRESSED BACKUPSET
         format='Z:\backup\rman\orcl\full_%d_%T_%U'
         tag='full_DBbackup_ris'
         database;
    backup as COMPRESSED BACKUPSET
         format='Z:\backup\rman\orcl\arch_%d_%T_%U'
         tag='full_ARCHbackup_ris'
    archivelog all not backed up delete all input;
    sql "alter database backup controlfile to trace as ''Z:\backup\rman\orcl\controlfile_backup_trace.txt''";
    release channel ch1;
    release channel ch2;
    This is my (simplified) list of backups on disk:
    Full_day1_chan1
    Full_day1_chan2
    Arc_day1_chan1
    Arc_day1_chan2
    Full_day2_chan1
    Full_day2_chan2
    Arc_day2_chan1
    It looks like channel2, days2, archivelog backup is missing. Is this correct? If not does anyone have an idea how to fix this?
    thanks in advance.
    Steven.

    Hi Steven,
    The data backed up by rman is written to backup pieces.
    Are you missing pieces containing archive logs?
    Could it be there was only 1 arc file available so the second channel could not create any backup piece?
    Did you could check the output of the backup in v$rman_output?
    Regards,
    Tycho

  • Rman Full and Archivelog backups

    I am scripting my rman stuff and it's part of a much larger Perl maintenance. I have nightly and hourly jobs. Nightly will do a full backup and hourly will do archivelog backup. Full backups take about 2-3 hours.
    My question is: is there a problem with running archivelog backups be running while I am doing a full backup. If system resources are not an issues, what are some arguments for or against it?

    Thanks Tychos.
    That is something that I've debated - if my full would be with Plus ArchiveLog or not. So, I've decided not to backup the log during a full backup.
    This is for my nightly:
    open (RMAN, "| rman target sys/$SYPASS\@$CSID catalog rman/$CATPSS\@catalog >$Rlog");
    print RMAN <<"END";
    run {
    allocate channel d1 device type disk format \'$HBDir/$HBFiles\';
    set controlfile autobackup format for device type disk to \'$HBDir/$ControlFile\';
    backup as compressed backupset database;
    crosscheck backup;
    delete noprompt obsolete;
    report need backup;}
    END
    close (RMAN);
    This is the hourly:
    open (RMAN, "| rman target sys/$SYPASS\@$CSID catalog rman/$CATPSS\@catalog >$Rlog");
    print RMAN <<"END";
    run {
    allocate channel d1 device type disk format \'$TempArchHBDir/$BUFile\';
    CROSSCHECK ARCHIVELOG ALL;
    set controlfile autobackup format for device type disk to \'$HBDir/$ControlFile\';
    backup archivelog all not backed up 1 times delete input;
    END
    close (RMAN);

  • RMAN backup Scripts: Please Check and Advice

    Dear All
    We are now upgrading our database from 9iR2 to 10gR2.
    Before this process we want a full database backup with RMAN with the following scrips. I also included our current database configuration.
    So, dear all gurus please check this process if any thing goes wrong and give some valuable advice for better performance and other issue.
    ===========================================================
    /data01          400GB
    /data02      400GB
    /data03          400GB
    /idx04          400GB
    Current Tablespace Used Size= 1700GB
    Total Tablespace=31
    Total File=295
    Max File Size= 15GB
    Avg File Size= 9GB
    CPU_COUNT=4
    Memory=32GB
    sqlplus /nolog
    conn /as sysdba
    --configured database in archivelog mode.  Then
    create user rman identified by pass default tablespace INDX tempprary tablespace temp;grant connect,resource,RECOVERY_CATALOG_OWNER to RMAN;
    RMAN target rman/rman@dwh nocatalog
    RMAN>configure channel device type disk maxpiecesize=64GB;
    RMAN>configure channel device type disk maxsetsize=195GB;
    RMAN>configure channel device type disk parallelism=4;
    RMAN>run { 
    allocate channel Channel1 type disk format '/data01/oracle/rman_backup/DWH_df_%s_%p_%c';
    allocate channel Channel2 type disk format '/data02/oracle/rman_backup/DWH_df_%s_%p_%c';
    allocate channel Channel3 type disk format '/data03/oracle/rman_backup/DWH_df_%s_%p_%c';
    allocate channel Channel4 type disk format '/idx01/oracle/rman_backup/DWH_df_%s_%p_%c' ;
    backup as compressed backupset database plus archivelog;
    backup current controlfile format '/idx01/oracle/rman_backup/DWH_cf_%U.f';
    backup spfiel format '/idx01/oracle/rman_backup/DWH_spf_%U.f';
    release channel Channel1;
    release channel Channel2;
    release channel Channel3;
    release channel Channel4;
    ===========================================================
    Thanks & Regards
    Quazi Abdur Rab

    Try this ...
    RUN {
    RECOVER COPY OF DATABASE WITH TAG 'incr_backup' UNTIL TIME 'SYSDATE - 7';
    BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG 'incr_backup' DATABASE;
    The RECOVER COPY... line will not do anything until the script has been running for more than 7 days. The BACKUP INCREMENTAL line will perform a complete backup (level 0) the first day it is run, with all subsequent backups being level 1 incremental backups. After 7 days, the RECOVER COPY... line will start to take effect, merging all incremental backups older than 7 days into the level 0 backup, effectively moving the level 0 backup forward. The effect of this is that you will permanently have a 7 day recovery window with a 7 day old level 0 backup and 6 level 1 incremental backups. Notice that the tag must be used to identify which incremental backups apply to which image copies

  • RMAN Cold backup script

    DB version :10.2.0.4
    Do you find anything wrong in the below mentioned RMAN cold backup script? Any enhancements, corrections required?
    shutdown immediate;
    startup mount;
    backup database including current controlfile tag='full_bkp';
    startup;
    crosscheck backup;
    delete noprompt obsolete device type disk;
    resync catalog;
    }

    Since you are doing a SHUTDOWN IMMEDIATE and STARTUP MOUNT before the BACKUP, there will be no ArchiveLogs generated while the backup is running --- as the database is not OPEN.
    However, the PLUS ARCHIVELOG can include ArchiveLogs that had been generated from the previous STARTUP or ALTER DATABASE OPEN.
    (In that case, I would suggest an SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT' before the SHUTDOWN IMMEDIATE).
    Is your database running in ARCHIVELOG mode ? If not, then this discussion is moot.
    If yes, the next question is, obviously : Why not take a Hot Backup while the database is running (in which case you MUST backup archivelogs !)
    Hemant K Chitale

  • How to check for archivelog backup on a particular date or time?

    Dear All,
    We have RMAN full database, cumulative and archivelog backup(eg location: Diskgroup A) scheduled on a regular period basis. Assume archivelog location is Diskgroup B. The diskgroup B became full and unable to archive further, since no space. Unable to connect to database, connect internal only until freed error. alert log also shows that archiver error. So the solution for this to clear some space in diskgroup B by removing some old archive logs. In our environment, everyday the archive logs are stored in a separated folder arranged in date wise.  I can do that . But before clearing some space, i need to make sure that the folder( or any date folder what im going to delete) is backed up or not. How to check that? Any idea please?
    eg: i have archivelogs like this in folders
    01_11_2013/
    02_11_2013/
    03_11_2013/
    04_11_2013/
    05_11_2013/
    06_11_2013/
    If i want to remove the folder 01_11_2013/( and its contents ie archivelogs) , how to check whether the archivelogs in this folder 01_11_2013/ is backed up or not?
    Regards,

    Pradeepcmst wrote:
    Dear All,
    We have RMAN full database, cumulative and archivelog backup(eg location: Diskgroup A) scheduled on a regular period basis. Assume archivelog location is Diskgroup B. The diskgroup B became full and unable to archive further, since no space. Unable to connect to database, connect internal only until freed error. alert log also shows that archiver error. So the solution for this to clear some space in diskgroup B by removing some old archive logs. In our environment, everyday the archive logs are stored in a separated folder arranged in date wise.  I can do that . But before clearing some space, i need to make sure that the folder( or any date folder what im going to delete) is backed up or not. How to check that? Any idea please?
    eg: i have archivelogs like this in folders
    01_11_2013/
    02_11_2013/
    03_11_2013/
    04_11_2013/
    05_11_2013/
    06_11_2013/
    If i want to remove the folder 01_11_2013/( and its contents ie archivelogs) , how to check whether the archivelogs in this folder 01_11_2013/ is backed up or not?
    Regards,
    rman> list backup;
    Which begs the question .. why is the FRA getting filled in the first place?  Is it seriously undersized?  Are you not doing regular housekeeping with rman 'delete obsolete' and 'backup archivelog delete input'

  • Backup script

    I created a backup script for my data & system and i'd like to share it.
    I have a 320GB hdd (1) as my main hard drive, and a 160GB hdd (2) as a backup drive (i keep this one in a drawer nearby, disconnected from the computer).
    What i wanted was to create a partial copy of 1 on 2, such that 2 would contain the entire system (bootable) + a part of my data.
    1. You need to have the same filesystem on both (i have ext4). Maybe it works with a mix of ext3 and 4, but it's better to have just one. The partitioning scheme on hdd 1 doesn't matter, but for hdd 2 you need a single partition to which you backup.
    2. The scripts:
    backup
    #!/bin/sh
    # rsync backup script
    sudo rsync -av --delete-excluded --exclude-from="excl" / "$1"
    sudo touch "$1"/BACKUP
    This one is very simple. You rsync in archive mode (which ensures that symbolic links, devices, attributes,  permissions,  ownerships,  etc.  are preserved) and exclude the files that match the patterns from excl.
    The / is the source from where you backup (in our case the whole root) and "$1" is the destination to where you backup (this is passed as an argument to the script).
    excl
    # Include
    + /dev/console
    + /dev/initctl
    + /dev/null
    + /dev/zero
    + /media/win
    + /var/run/mpd
    + /home/wooptoo/music/Amestecate
    + /home/wooptoo/music/script
    + /home/wooptoo/music/list.txt
    + /home/wooptoo/music/.hg*
    # Exclude
    - /home/wooptoo/dl/*
    - /home/wooptoo/games/kits/*
    - /home/wooptoo/mov/*
    - /home/wooptoo/music/*
    - /dev/*
    - /media/*
    - /media/win/*
    - /mnt/*
    - /proc/*
    - /sys/*
    - /tmp/*
    - /var/run/*
    - /var/run/mpd/*
    This is a bit more tricky. It's an exclude (and include) file in rsync format.
    Exclude: I excluded my games, movies and music from the backup, and also the system directories /dev, /media, /mnt, /proc, /sys, /tmp, /var/run. These are excluded because their content is created at runtime by the system. Note that the direcotries themselves are preserved (you need them!) but they are empty.
    Include: even though i excluded /dev, i need to include 4 file from it (which are not dinamically created by udev), these are console, initctl, null, zero.
    I also included the directories /media/win and /var/run/mpd. But these are empty, because their content was excluded (in the exclude section).
    3. So we got these two files: backup and excl.
    Mount the backup hdd, let's say at /media/backup/ and run the script:
    ./backup /media/backup/
    rsync will backup the whole root to that destination. I excluded game kits, music and movies from my backup because they are just too large to fit on hdd 2, and it would also take a lot of time to backup and keep in sync afterwards.
    4. After the sync is finished you need to install a boot loader on hdd2, so you can have a working copy of your system.
    Open the grub console and type in:
    root (hd1,0)
    setup (hd1)
    The root command tells grub where your system is installed (in this case hdd 2, first partition).
    Setup tells grub where to install the boot loader. In my example it is installed in the MBR of hdd 2.
    The problem here is that the boot loader installs correctly, but its menu entries are for the partitions of the main system, not the backup system. So if you'll try to boot the backup system, it won't work.
    You can fix this by creating a custom menu.lst for the backup hdd. But i prefer not to do this, in order to have an accurate copy of my data. I just prefer to edit the entries from the boot menu on the fly if i need to boot the backup directly. But you can automatically add a custom menu.lst to the backup hdd from the backup script:
    #!/bin/sh
    # rsync backup script
    sudo rsync -av --delete-excluded --exclude-from="excl" / "$1"
    sudo cp ~/custom.menu.lst "$1"/boot/grub/menu.lst
    sudo touch "$1"/BACKUP
    5. Reboot and try out your new system.
    I think this approach (system + data backup) is better than just data backup because if something goes wrong with the main hdd, you can always swap in the backup one and continue working. Besides this, you now have another working system, from which you can recover the main one without the need of live CDs.
    In my setup both hdds are SATA with AHCI, so they are hot-pluggable. You can plugin the backup drive, run the backup script, and disconnect it. This is very advantageous because you don't have to reboot.
    But you can use an USB stick/hdd as backup drive if you only have IDE.
    I would like to know what do you think of my backup strategy. Is it good or am i doing it wrong? Are there better methods? What backup strategy do you use? etc.
    Last edited by wooptoo (2009-10-24 01:40:46)

    I use the following to rotate four backups and backup my root and home separately and hard-link common files between all the backups. I run this weekly to have backups of the last four weeks while using barely more space then one full backup would. It is not super customisable as it is my personal script and I've been wanting to add in a check to see whether the backup location is actually mounted, but I've not gotten to it just yet
    #!/bin/bash
    # Script to rotate three backups of / and /home and make a new incremental
    # backup. No arguments required. Make sure the correct disk is mounted at
    # $PAR, though!
    # Original command ran to create the first backup of /home :
    # /usr/bin/sudo /usr/bin/rsync --progress --stats -avz \
    # --exclude-from=/home/ramses/home_backup_excludes --delete-exludes \
    # /home/ /media/seadisc/home_backup.0
    # Variables and paths
    PAR="/media/seadisc/backup"
    HOME_EXCLUDES="/usr/local/bin/backup_config/home_backup_excludes"
    ROOT_EXCLUDES="/usr/local/bin/backup_config/root_backup_excludes"
    SUDO="/usr/bin/sudo"
    MV="/bin/mv"
    RM="/bin/rm"
    RSYNC="/usr/bin/rsync"
    DATE="/bin/date"
    TEE="/usr/bin/tee"
    # Home backups
    echo "Moving previous /home backups ..."
    $SUDO $RM -rf $PAR/home_backup.3
    $SUDO $MV $PAR/home_backup.2 $PAR/home_backup.3
    $SUDO $MV $PAR/home_backup2_date $PAR/home_backup3_date
    $SUDO $MV $PAR/home_backup.1 $PAR/home_backup.2
    $SUDO $MV $PAR/home_backup1_date $PAR/home_backup2_date
    $SUDO $MV $PAR/home_backup.0 $PAR/home_backup.1
    $SUDO $MV $PAR/home_backup0_date $PAR/home_backup1_date
    echo "Doing incremental backup of /home ..."
    $SUDO $RSYNC --progress --stats -av \
    --exclude-from=${HOME_EXCLUDES} \
    --delete --delete-excluded \
    --link-dest=$PAR/home_backup.1 \
    /home/ $PAR/home_backup.0
    $SUDO $DATE | $TEE $PAR/home_backup0_date > /dev/null
    # Root backups
    echo "Moving previous / backups ..."
    $SUDO $RM -rf $PAR/root_backup.3
    $SUDO $MV $PAR/root_backup.2 $PAR/root_backup.3
    $SUDO $MV $PAR/root_backup2_date $PAR/root_backup3_date
    $SUDO $MV $PAR/root_backup.1 $PAR/root_backup.2
    $SUDO $MV $PAR/root_backup1_date $PAR/root_backup2_date
    $SUDO $MV $PAR/root_backup.0 $PAR/root_backup.1
    $SUDO $MV $PAR/root_backup0_date $PAR/root_backup1_date
    echo "Doing incremental backup of / ..."
    $SUDO $RSYNC --progress --stats -av \
    --exclude-from=${ROOT_EXCLUDES} \
    --delete --delete-excluded \
    --link-dest=$PAR/root_backup.1 \
    / $PAR/root_backup.0
    $SUDO $DATE | $TEE $PAR/root_backup0_date > /dev/null

Maybe you are looking for

  • Podcast downloads: keeps giving the message Error 9006

    I have a problem downloading a podcast. It keeps giving me the error message 9006. I contacted Apple by email and the information they gave me was:" It means the TCP connection was closed unexpectedly. These closings, or time outs can happen for a va

  • Hibernate in Weblogic10 : class not found exception

    Hi All, I am using JPA/Hibernate in Weblogic 10. While running the application, I am getting the following exception. Can someone help on this. Exception caught is : java.lang.IllegalArgumentException : org.hibernate.QueryException : ClassNotFoundExc

  • FUnction Module to Calculate future date after 'x' years

    Hi Gurus, Can anyone tell me the Standard Function Module which will take today's date as i/p & return the date after 10 years. e.g say input date is 18.05.2010 & input year is 10.              output = 17.05.2020 Regards, Rohit.

  • Keep opened socket connection?

    Hi, My Java application communicates with server on average every 3 seconds. I wonder if it is a good idea to keep an opened socket connection to the server and don't open new connection for each request. The problem with this is that if in the meant

  • WebPart Connection does not work between DataForm-WebPart and ListView-WebPart

    Hi Experts, how to reproduce: Create a new EditForm.aspx (i called mine just Edit.aspx) from a typical custom list and set this one as Default. Browse to that page and Start Edit Add a WebPart from one of your custom lists. Add a WebPart-Connection f