Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: Export Script

  1. #1
    Join Date
    Apr 2004
    Posts
    113

    Unanswered: Export Script

    Hello,

    I have been asked to create a export and import parfile to implement on a Sun Solaris 8 server 64 bit.
    If I remember correctly my parfile should be set up differently from a Windows parfile and also do I need a shell script if so, how is that done?

  2. #2
    Join Date
    Jan 2004
    Posts
    370
    A parfile just contains the parameters you would use on the command line. The parameters are the same for Windows and Unix but some values will be specified differently (eg O/S paths to files). And you don't need a shell script.

    All the parameters are documented in the Utilities Guide:

    http://download-west.oracle.com/docs...a96652/toc.htm

  3. #3
    Join Date
    Apr 2004
    Posts
    113
    Thank you Skywriter,

    I was wondering though how would I call his sql script from the sun solaris box? If I do not have a shell script.

  4. #4
    Join Date
    Jan 2004
    Posts
    370
    exp username/password PARFILE=filename

  5. #5
    Join Date
    Apr 2004
    Posts
    113
    Thanks Skywriter,

    I must be an idiot because I tried that and it does not work.

    Here is a sample:


    Remember I am no unix guru:


    login: root
    Password:

    Sun Microsystems Inc. SunOS 5.8
    # exp
    exp: not found
    # exp tigger/rats@yp parfile=d:/opt5/export/yp_exp.txt
    exp: not found
    #

  6. #6
    Join Date
    Jan 2004
    Posts
    370
    Don't login as root.

    Login as the oracle software owner.

  7. #7
    Join Date
    Apr 2004
    Posts
    113
    Thank you SkyWriter!


    They want this to run nightly. How would I set that up?

  8. #8
    Join Date
    Apr 2002
    Location
    California, USA
    Posts
    482
    Set a cron job the the Solaris box to run the export. Add this to "oracle" user crontab:

    $ crontab -e

    then add:

    0 0 * * * /path/exp_full.ksh > /path/exp_full.log 2>&1


    the exp_full.ksh should looks like:

    #!/bin/ksh

    $ORACLE_HOME/bin/exp parfile=exp_full.par


    I guess, you already know how to create the exp_full.par file.


    HTH,

    clio_usa - OCP 8/8i/9i DBA

  9. #9
    Join Date
    Apr 2004
    Posts
    113
    Clio,

    Thank you so much. I will try this today!

  10. #10
    Join Date
    Apr 2004
    Posts
    113

    Export Again

    Ok, I have made my directories for where I want the export to go and I have made my ksh script that I need to use.
    How do I get the ksh script over to that server. I made it from my desktop. Also what does the:

    0 0 *** stand for
    AND
    2>&1

    Here is my ksh script:

    # parfile and export
    . /export/home/oracle/.profile
    dir=`date +"%d%m%Y"`
    echo full=y >expfull.par
    echo consistent=y >>expfull.par
    echo direct=y >>expfull.par
    echo ignore=y >>expfull.par
    echo log=./exp_log.log >>expfull.par
    echo file=./exp.dmp >>expfull.par
    echo indexes=y >>expfull.par
    echo rows=y >>expfull.par
    exp / parfile=./expfull.par
    gzip -9 expfull.dmp

  11. #11
    Join Date
    Jul 2003
    Posts
    2,296
    crontab info:
    http://www.unidata.ucar.edu/cgi-bin/man-cgi?00+00

    you can ftp any files over to the unix box
    I suggest you start learning vi or emacs and use those file editing applications on the Unix box since you will most likely need to edit files on that box eventually.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  12. #12
    Join Date
    Apr 2004
    Posts
    113
    Duck,

    Thank you so much for such a quick reply:
    I am sorry for all the questions but I was kind of thrown in this role because the senior dba is out sick.

    Ok, how do I ftp?
    What is the command for that?

    Also, that link did not work....

  13. #13
    Join Date
    Apr 2004
    Posts
    113
    also, I created my parfile in notepad and named it .ksh.

    Should I have done that differently?

  14. #14
    Join Date
    Jul 2003
    Posts
    2,296
    fixed link:
    I would normally name parameter files with the extention .par
    .ksh would be used if you create a korn shell script.

    look up FTP on google or man it on your unix box.
    or you can download a GUI FTP application

    FTP = File Transfer Protocol
    This allows you to move files from one mahcine to another.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  15. #15
    Join Date
    Apr 2004
    Posts
    113

    Angry

    Thank you Duck!

    Because this site was down I figured out the ftp! Woohoo!

    However, I am having a hard time with my cron job.
    I set it as specified in this thread but I am not sure about the parfile part.
    Here is my parfile:

    FULL=Y
    LOG=/dbdump/export/log/exp_log.log
    FILE=/dbdump/export/dmps/exp.dmp
    FILESIZE=
    IGNORE=Y
    GRANTS=y
    INDEXES=y
    ROWS=y
    CONSTRAINTS=y
    COMPRESS=y

    Here is my .ksh file:
    # construct a directory name, create it and a parfile and do export
    . /export/home/oracle/.profile
    dir=`date +"%d%m%Y"`
    echo full=y >expfull.par
    echo consistent=y >>expfull.par
    echo direct=y >>expfull.par
    echo ignore=y >>expfull.par
    echo log=./exp_log.log >>expfull.par
    echo file=./exp.dmp >>expfull.par
    echo indexes=y >>expfull.par
    echo rows=y >>expfull.par
    exp / parfile=./expfull.par
    gzip -9 expfull.dmp

    Now I thought I needed a shell script in order for cron to be able to call it?
    However when I typed in what clio_usa said, it did not appear to work.

Posting Permissions

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