To create a shell script to run export/import utilities.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # SCRIPT # --------- # # Set environment variables for ORACLE_HOME, ORACLE_SID, # and DUMPDIR -- in case of datapump --, as well as PATH if needed. # # trap '' 1 # to use nohup in a shell script # Set these to appropriate values if needed: # #ORACLE_HOME= #ORACLE_SID= #DUMPDIR= # Customize PATH if needed # #PATH=/bin:/usr/bin:${ORACLE_HOME}/bin:/usr/local/bin:/usr/lbin #export ORACLE_HOME ORACLE_SID PATH echo "Exporting $ORACLE_SID database. start `date`" # expdp system/password dumpfile=scott.dmp directory=DUMPDIR schemas=scott logfile=scott.log # echo "Export of $ORACLE_SID database completed at `date`" #End of Script |
Running the script If you save the script as exp_comp.sh, type the following command at the Unix prompt to run it:
1 | # ./exp_comp.sh |
Note: Edit the above script to use it for your specific exports or imports (like full, schema, table, TTS). In case of traditional export/imp (exp/imp), the above command may be something like:
1 | exp system/manager file=scott.dmp owner=scott log=scott.log |