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

Similar Messages

  • 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

  • Shell Script For Export And Import Of Table Records

    Hello,
    We have production and test instances and for constant testing we need to copy data from production to test or development environment.
    At the moment what we do is manually doing export and import table records. At times this could be very tedious as we may need
    to do this exercise a couple of times in a day.
    Is it a good idea to do this exercise using shell script? If so how could I do this? If this is not a good idea what are the best alternatives?
    Any input is highly appreciated.
    Thanks

    Ah I see, your company prefers stupidity over efficiency. It would be possible to do it in a controlled environment, wouldn't it? Also the test database would be allowed to select only.
    So the non-allowance is just plain stupid.
    To the second question: do you use hard-coded passwords in shell scripts?
    Don't you think that poses a security risk?
    Don't you think that is a bigger risk than a database link, properly set up?
    In my book it is!
    Sybrand Bakker
    Senior Oracle DBA

  • SHELL SCRIPT FOR EXPORT AUTOMATICALLY

    Hi all,
    I need a shell script which will automatically take logical backup(export) in the solaris machine.I have 5 database and 10 schemas for that i want to take logical backup.
    thanks
    vicky

    If you're using 10g try to do it with DBMS_DATAPUMP and DBMS_SCHEDULER

  • Shell script for export and import

    Hi,
    I want to run exp command in background since i need to export 40gb database of other database
    if i won't use & my session will die.
    appreciated any inputs.
    i need to run this line from shell script.
    /oracle/bin/exp pin@voipdbstg/pin file=voip.dmp owner=pin log=voip.log
    bash-2.05$ more export.sh
    #!/bin/sh
    /oracle/bin/exp pin@voipdbstg/pin file=voip.dmp owner=pin log=voip.log
    bash-2.05$ sh export.sh &
    [10] 13352
    bash-2.05$
    Export: Release 8.1.7.0.0 - Production on Fri Dec 4 22:51:09 2009
    (c) Copyright 2000 Oracle Corporation. All rights reserved.
    Password: pin
    bash: pin: command not found
    [10]+ Stopped sh export.sh
    input appreciated
    thanks
    Prakash

    Hi,
    /oracle/bin/exp pin@voipdbstg/pin file=voip.dmp owner=pin log=voip.log
    should be
    /oracle/bin/exp pin/pin@voipdbstg file=voip.dmp owner=pin log=voip.log
    Also for running the script is background and you should be able to log out of shell scriptthen run the command in nohup mode.
    $nohup export.sh&
    Regards

  • Shell scripting for hot backup

    Hi,
    can you please give me shell scripting and it's explanation for taking hot backup. and which shell scripts are frequently use in real time.
    thank a lot in advance.

    HAve you ever heard about RMAN ? Much better than reinvent the wheel.
    http://download.oracle.com/docs/cd/E11882_01/backup.112/e10642/rcmquick.htm
    Nicolas.

  • Shell Script for automatic backup

    Hello Every one,
    We have windows network and sun solaris sparc box. (both from Sun Box and from Windows machine I can communcate using Telnet.)
    I wish to take data backup of a system having windows operating system, into
    the sun solaris sparc box automatically by week end .
    Can anyone help me with the shell script which does this operation.
    Regards,
    Dwarak

    first of all, is there nfs running? and on windoze box, do u have any nfs client program running?
    you cant transfer files frm the windoze machine via telnet..
    once you can settle the above, what you can do is a simple copy script and put it in your crontab.

  • Shell script for cols backup

    I wrote shell scriptevery thing is working like showning me names of datafiles
    but now showing member of redo logs
    and name of controlfile
    #!/usr/bin/sh
    TNS_ADMIN=/disk2/oracle/product/10.2.0/Db_1/network/admin
    export TNS_ADMIN
    ORACLE_HOME=/disk2/oracle/product/10.2.0/Db_1
    export ORACLE_HOME
    DEST=/disk2/PSFSTRN/PSFSTRN_BACK`date '+%Y%m%d'`
    mkdir $DEST
    sqlplus -s sys/testing@PSFSTRN as sysdba <<EOFSQL
    set echo off
    set feedback off
    set heading off
    set pagesize 500
    spool coldbkup.sh
    select 'cp '||file_name ||' /disk2/PSFSTRN' from dba_data_files;
    select 'cp '||member||' /disk2/PSFSTRN' from v$logfile;
    SELECT 'cp '||member||' g:\orclbkp'||to_char(sysdate,'ddmonyyyy')||'' from v$logfile order by member;
    select 'cp '||name||' /disk2/PSFSTRN' from v$controlfile;
    spool off
    shutdown immediate;
    exit;
    EOFSQL
    sh coldbkup.sh
    sqlplus sys/testing@PSFSTRN as sysdba <<EOFSQL
    startup
    set echo on
    set feedback on
    EOFSQL

    What issue are you facing, exactly? You said:
    "I wrote shell scriptevery thing is working like showning me names of datafiles
    but now showing member of redo logs
    and name of controlfile"
    That's what the script looks like it's supposed to do. Did you mean to say "not showing member of redo logs and name of controlfile" instead of "now"?

  • Can anybody provide AIX shell script for Oracle Apps R12 instance backup

    Hi
    Can anybody provide AIX shell script for Oracle Apps R12 instance backup? Manually, i am able to backup but i donot have shell script to schedule through crontab.
    Help me please.
    Thanks

    Rman can be used for Database, not for Application tier. Again, I assumed you are looking for a script to backup the database. For the application tier, you can simply do a filesystem backup.
    I still do not understand your concern? Is it about using crontab? If so, then check here --> man crontab <--

  • Shell scripting for oracle DBs

    looking for good source for shell scripting for oracle DBs

    Just buy 'Classic Shell Scripting' and 'the Unix Desktop Reference' both published by O'Reilly and you have it all.
    But if you want a platform agnostic scripting language use Perl. Comes with Oracle.
    However both bash and kornshell are a lot easier compared to Perl.
    Sybrand Bakker
    Senior Oracle DBA

  • Need Help in creating Unix Shell Script for database

    Would be appreciable if some one can help in creating unix shell script for the Oracle DB 10,11g.
    Here is the condition which i want to implement.
    1. Create shell script to create the database with 10GB TB SPACE and 3 groups of redo log file(Each 300MB).
    2. Increase size of redolog file.
    3. Load sample schema.
    4. dump the schema.
    5. Create empty db (Script should check if db already exists and drop it in this case).
    6. Create backup using rman.
    7. restore backup which you have backed up.

    This isn't much of a "code-sharing" site but a "knowledge-sharing" site.  Code posted me may be from a questioner who has a problem / issue / error with his code.   But we don't generally see people writing entire scripts as responses to such questions as yours.  There may be other sites where you can get coding done "for free".
    What you could do is to write some of the code and test it and, if and when it fails / errors, post it for members to make suggestions.
    But the expectation here is for you to write your own code.
    Hemant K Chitale

  • Shell script for batch compilation of forms 10g on AIX 5.3L AS

    Hi All,
    Can anybody provide me the Shell script for batch compilation of forms 10g and reports 10g on AIX 5.3L AS?
    Regards,
    SAM

    Hi Alex,
    I tried with the below script as well as the one you had posted.
    ORACLE_HOME=/opt/oracle/OraHome_3
    export ORACLE_HOME
    TNS_ADMIN=$ORACLE_HOME/network/admin
    export TNS_ADMIN
    LIBPATH=$ORACLE_HOME/lib32:$ORACLE_HOME/jdk/jre/bin:$ORACLE_HOME/jdk/jre/bin/cla
    ssic:$LIBPATH
    export LIBPATH
    cd ../forms
    for i in `ls *.pll`
    do
    echo Compiling Library $i ....
    $ORACLE_HOME/bin/frmcmp module=$i userid=mydbuser/mydbuser@mydb
    batch=yes module_type=library
    compile_all=yes window_state=minimize
    done
    export ORACLE_HOME=/opt/oracle/OraHome_3
    export ORACLE_TERM=vt220
    export LD_LIBRARY_PATH=/opt/oracle/OraHome_3/lib:/opt/oracle/OraHome_3/jdk/jre/l
    ib:/opt/oracle/OraHome_3/jdk/jre/lib/i386:
    cd ../forms
    for i in `ls *.pll`
    do
    echo "Compiling Library $i ...."
    /opt/oracle/OraHome_3/bin/frmcmp module_type=form userid=mydbuser/mydbuser@mydb
    module=$i batch=yes compile_all=no
    window_state=minimize upgrade=no
    done
    echo "PLL Compilation done"
    But there was a same kind of error thst turning up all the time.
    Compiling Library Agf.pll ....
    Forms 10.1 (Form Compiler) Version 10.1.2.0.2 (Production)
    Forms 10.1 (Form Compiler): Release - Production
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    PL/SQL Version 10.1.0.4.2 (Production)
    Oracle Procedure Builder V10.1.2.0.2 - Production
    Oracle Virtual Graphics System Version 10.1.2.0.0 (Production)
    Oracle Multimedia Version 10.1.2.0.2 (Production)
    Oracle Tools Integration Version 10.1.2.0.2 (Production)
    Oracle Tools Common Area Version 10.1.2.0.2
    Oracle CORE 10.1.0.4.0 Production
    FRM-10043: Cannot open file.
    Form not created
    I hence updated the permissions on the pll as below
    -rwxrwxrwx 1 oracle oinstall 335872 May 19 16:31 Agf.pll
    But the problem is still persisting.
    My environment details are as below.
    I am working on Win XP machine. Connected to my AS via telnet and xmanager. I have set my DISPLAY to my local IP.
    Is there any thing more that I need to do? If so then let me know.
    Regards,
    SAM

  • Scripts for Exporting Master/Work Rep

    Hi,
    I want to automate the export process and in turn was looking for any scripts for exporting the whole ODI Work/Master Rep. I checked the CLASS objects and we donot have any CLASS names for Repository exports.
    Thanks in advance for any answers..!

    Created for 10g [ http://odiexperts.com/automize-the-backup-using-odi-exports]
    but should work for 11g too :)

  • Shell script for archive log transfer

    hi
    I dont want to reinvent the wheel.
    I am looking for shell script for log shipping to provide standby db.
    What I want to do is, get the last applied archived log number from alert.log
    Copy the files from archive destination according to this value.
    Cheers

    If you don't want to re-invent the wheel you use Dataguard, no scripts.
    And your script should use the dictionary, instead of some bs method to read the alert.
    v$archived_log has all information!
    Also as far as I know, the documentation describes manual standby.
    So apparently you not only don't want to reinvent the wheel, but you want the script on a silver plate on your doorstep!
    Typical attitude of most DBAs here. Use OTN for a permanent vacation.
    Sybrand Bakker
    Senior Oracle DBA

Maybe you are looking for

  • In MIGO, i need to see delivery dates from the purchase order

    Is there a way to see in transaction MIGO, the delivery dates from the purchase order?  I hope there is some exit or BADI or BAPI or .... to perform this copy function?  We have multi-line POs for the same material with staggered delivery dates and t

  • How to use custom label formats to display currency and percentage

    Hi There, I need a pie chart to display both currency and percentage. I have the cell format editor open for custom cell formats (from the pie chart label format menu) but am not sure how to write the expression. I've tried something like this but ge

  • My Podcast is not appearing in the iTunes Store - Feedvalidator says Valid!

    Hi there! This is my first Podcast and something is wrong but I really dont know why... I tested my rss.xml Feed several times with feedvalidator.org... Result: This is a valid RSS feed. ... when I try to uplad it on itunes i can do it every second..

  • Will 4G dock/charger work with 5G iPod?

    I just bought a 5G 30GB iPod to replace my 4G 40GB iPod that died about one month after the Apple Care ran out. (Funny how that happens, isn't it? The repair on the old one would have cost about $280, thus the decision to replace.) I see the new iPod

  • Dynamic sizing of Column Width

    Is there a way that the table columns can be dynamically adjusted widthwise in an RTF template ? I do not want my $Total to wrap around.