Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Exporting thru a pipe
DG ,
Check this out
******************* SCRIPT STARTS ********************
Using Unix compress pipe to export database
This script has been tested on Oracle 7.3.4 and 8.0.5
on HP-UX.
The script works regardless of whether there are
multiple versions of Oracle installed, and relies on
your oratab file being installed and set up correctly,
as per OFA guidelines.
This script should only be run by a user with the
EXP_FULL_DATABASE role.
This is a unix korn shell script, and you feed the
script the name of the database you wish to export as
a parameter ($1), and this name is case insensitive,
as it will pickup the correct case from oratab.
A trick to hiding the password for the user, is to
place the password for the user in a file and give
read permission only to the user or group (dba) on
that file, then instead of hard coding the password as
in the example below, one would change the line with
'PASSWD=' to
PASSWD=`cat /home/user/secretplace/exportusr.pw`
where the above file contains a single line with the
password for the export user. If you are using Solaris
(Sun), modify the first line to read
"ORATAB=/var/opt/oracle/oratab"
contents of compexp.sh
ORATAB=/etc/oratab
DBSID=$1
LINE=`grep -i $DBSID $ORATAB`
echo $LINE
case $LINE in
"") echo 'Invalid Oracle SID specified : ' $DBSID ;;
*) ORACLE_SID=`echo $LINE | awk -F: '{print $1}' -`
export ORACLE_SID ORACLE_HOME=`echo $LINE | awk -F: '{print $2}' -` export ORACLE_HOME PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/etc ; export PATH touch /tmp/${ORACLE_SID}comp rm /tmp/${ORACLE_SID}comp /sbin/mknod /tmp/${ORACLE_SID}comp p COMP=`which compress` USR=dba_user PASSWD=oradba export USR PASSWD $COMP
$ORACLE_HOME/bin/exp $USR/$PASSWD file=/tmp/${ORACLE_SID}comp buffer=1048576 full=y
echo 'export done !' ;;
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Sakthi , Raj INET: rajan_sakthi_at_yahoo.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-LReceived on Thu Jan 10 2002 - 16:08:32 CST
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).