|
-
He's an example of exporting to a pipe (it's a Solaris script but you should be able to modify it for your own env.)
# set -x
#
# Check syntax of command.
#
if [ $# -eq 0 ] ; then
echo "[ExpPipe] Usage :ExpPipe ORACLE_SID EXPORT_DIRECTORY"
exit 2
fi
#
# Define funtions
#
check_logfile ( )
{
grep "Export terminated unsuccessfully" $1
return $?
}
#
# Define variables
#
NOW=`date "+%y%m%d.%H:%M:%S"`
CURRENTDIR=`dirname $0`
if [ ${CURRENTDIR} = "." ] ; then
CURRENTDIR=`pwd`
fi
EXPORT_DIR=$2
if [ $2 -eq 0 ] ; then
EXPORT_DIR=`pwd`
fi
ORG_ORACLE_SID=$ORACLE_SID
OPTIONS1="consistent=yes buffer=1000000 statistics=NONE full=yes"
OPTIONS2="buffer=1000000 statistics=NONE full=yes"
PIPENAME=/tmp/ExpPipe.${ORACLE_SID}.$$
LOGFILE=./ExpPipe_log.${ORACLE_SID}.${NOW}
EXPORTFILE=${EXPORT_DIR}/exp.${ORACLE_SID}.${NOW}
#
# Set up oracle environment
#
export ORACLE_SID=$1
ORAENV_ASK=NO
. oraenv
#
# Perform export
#
/usr/sbin/mknod $PIPENAME p
exp userid=/ file=${PIPENAME} ${OPTIONS1} log=$LOGFILE.1 1>>/dev/null 2>&1 &
dd if=${PIPENAME} 2>>/dev/null | compress -c > ${EXPORTFILE}.consistent.Z
check_logfile ${LOGFILE}.1
if [ $? -eq 0 ]
then
rm ${EXPORTFILE}.consistent
else
rm ${PIPENAME}
exit 0
fi
exp userid=/ file=${PIPENAME} ${OPTIONS2} log=$LOGFILE.2 1>>/dev/null 2>&1 &
dd if=${PIPENAME} 2>>/dev/null | compress -c > ${EXPORTFILE}.Z
rm ${PIPENAME}
#
# Reset environment
#
export ORACLE_SID=$ORG_ORACLE_SID
ORAENV_ASK=NO
. oraenv
Regards
Jim
Oracle Certified Professional
"Build your reputation by helping other people build theirs."
"Sarcasm may be the lowest form of wit but its still funny"
Click HERE to vist my website!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|