Automating Backups Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Automating Backups

  1. #1
    Join Date
    Apr 2004

    Automating Backups

    I am taking the backups by using the following files:

    Parameter file

    Userid = 'test/test@test'
    File = d:\testbackup\exp_test.dmp
    Log = d:\testbackup\exp_test.log

    Batch File

    exp parfile=d:\testbackup\test.par

    I have automated the task using the Windows scheduler.

    When ever i take the backups it overwrites the previous backup file.

    Now can i modify my script so that i can include date in the filenames.

    Also can i keep the backup for say 3 days and then delete the same modifying the script.

    I am using Windows 2000 Advanced Server and Oracle 9i.

    Any suggestions for the same.



  2. #2
    Join Date
    Nov 2000
    exp/imp is not a viable backup methodology for a production database.
    Jeff Hunter
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  3. #3
    Join Date
    Apr 2004
    Well i agree its not a viable method for taking backups of production databases.
    But is there anyway to modify my script.



  4. #4
    Join Date
    Jan 2001
    Well, you can but it is a little tricky. Here is an example of what we do here.

    First you need to schedule your export, no problem right?

    Next you will need another .CMD file scheduled to generate compression. Something like this...

    REM the script is for generating script for compressing export backups

    sqlplus export/export @D:\export\hanky\gen_code.sql
    The above is loggin into SQLPLUS and calling gen_code.sql first, that .SQL file would look like this.

    set echo off
    set pagesize 0
    spool d:\export\hanky\compress_dump.cmd
    select 'cd D:\export\hanky' from dual;
    select 'zip d:\export\arch_export\DB_NAME_'||to_char(sysdate,'MMDDYYYY')||
    ' d:\export\*.dmp' from dual;
    select 'copy d:\export\*.log d:\export\arch_export\bkup_'||to_char(sysdate,'MMDDYYYY')||
    '.log' from dual;
    spool off
    Now this is assuming you have a D:\export directory that your scheduled export writes to. This is timestamping the next .CMD file which will grab/zip and relocate your .DMP and .LOG files.

    The first .CMD file is also calling "compress_dump.cmd" that file would look like this.

    cd D:\export\hanky

    zip d:\export\arch_export\ d:\export\*.dmp

    copy d:\export\*.log d:\export\arch_export\bkup_06142004.log
    As you can see the date has been filled in from the first command file.
    I think you will also need to copy the winzip .EXE into the D:\export\hanky directory, it is called Zip.exe

    Remember the ZIP command is zipping TO dir ----> FROM dir.


    I remember when this place was cool.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width