DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Export database help

  1. #1
    Join Date
    Oct 2005
    Location
    Dhaka
    Posts
    2

    Export database help

    hello all,

    i want to export my database using export command. i have written a batch file & a parameter file to export data. the contents of the batch file is written below:

    C:\oracle\ora90\BIN\exp.exe eibsprod/eibsprod@eibs131
    PARFILE = h:\DUMPS\Exp_data.TXT

    the batch file successfuly exports data using the parameter file to a file named eibs.dmp. the contents of the parameter file is written below:

    file = h:\eibs.dmp
    log = h:\Exp_log
    owner = eibsprod
    rows = y


    i have to do this job everyday. now i want system date to be added to the file name. the file format is written below below

    filename+date
    -----------------
    eibs29102005.dmp
    eibs30102005.dmp
    eibs31102005.dmp
    eibs01112005.dmp

    plz give me any suggestions.

    regards

    sakil

  2. #2
    Join Date
    Mar 2002
    Location
    Mesa, Arizona
    Posts
    1,204
    I don't know how you'd do this in windows with batch file scripting .. Maybe a simple c/java/vb/.net program will do the trick.

    This is how I scripted it in LINUX. Maybe it'll help get you a little closer.

    1. export to known filename
    2. append the date to that file
    3. remove old copies

    #!/bin/bash
    export ORACLE_SID=TOOLBOX
    export ORACLE_HOME=/u1/oracle/9.2.0.6
    export PATH=$ORACLE_HOME/bin:$PATH
    export NLS_LANG=AMERICAN_AMERICA.UTF8
    $ORACLE_HOME/bin/exp userid=system/..cut... log=/rman/export/TOOLBOX/full.log file=/rman/export/TOOLBOX/full.dmp full=y statistics=none

    /bin/gzip /rman/export/TOOLBOX/*.dmp /rman/export/TOOLBOX/*.log

    for file in /rman/export/TOOLBOX/full.*
    do
    mv $file $file-`date "+%y%m%d-at-%H%M"`
    done

    /usr/bin/find /rman/export/TOOLBOX -type f ! -mtime -2 -exec /bin/rm {} \;
    "I do not fear computers. I fear the lack of them." Isaac Asimov
    Oracle Scirpts DBA's need

  3. #3
    Join Date
    Mar 2004
    Location
    DC,USA
    Posts
    650
    Quote Originally Posted by sakil
    i have to do this job everyday. now i want system date to be added to the file name. the file format is written below below

    filename+date
    -----------------
    eibs29102005.dmp
    eibs30102005.dmp
    eibs31102005.dmp
    eibs01112005.dmp
    sakil
    Is it for Windows or Unix?
    The same query i posted here 3months before, you can check the link:

    If Windows:
    http://www.dbasupport.com/forums/showthread.php?t=48566
    "What is past is PROLOGUE"

  4. #4
    Join Date
    Mar 2002
    Location
    Mesa, Arizona
    Posts
    1,204
    Nice work dbasan.
    "I do not fear computers. I fear the lack of them." Isaac Asimov
    Oracle Scirpts DBA's need

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