Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Error while running export backup shell script

Error while running export backup shell script

From: Krishnaswamy, Ranganath <Ranganath.Krishnaswamy_at_blr.hpsglobal.com>
Date: Fri, 21 Mar 2003 13:10:38 +0530
Message-Id: <24726.322609@fatcity.com>


This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible.

------_=_NextPart_000_01C2EF7D.2AA6A530
Content-Type: text/plain

Hi List,

        I have got a shell script for taking full export backup which I am attaching with this mail as .sql file as I cannot send .sh file as file attachments. I am getting the following error when I run the script in full_exp_20030321_1309_job.log:

###########################################################################
#Starting fullexportlsyrs.sh at Fri Mar 21 13:09:41 GMT 2003
#

fullexportlsyrs.sh[3]: mknod: not found fullexportlsyrs.sh[4]:
/export/home/ranganat/backups/full_exp_20030321_1309_pipe : cannot open
LRM-00112: Message 112 not found; No message file for product=ORACORE, facility=
LRM EXP-00019: Message 19 not found; No message file for product=RDBMS, facility=EXP
EXP-00000: Message 0 not found; No message file for product=RDBMS, facility=EXP/
export/home/ranganat/backups/full_exp_20030321_1309_pipe: No such file or direct
ory
#
#Job run time was: 0 hours, 0 minutes, 0 seconds
#
#Ending fullexportlsyrs.sh at Fri Mar 21 13:09:41 GMT 2003 with an exit
status o
f 127

############################################################################
#

What should I do to eliminate the above errors and run the scripts successfully?

Any help in this regard is very much appreciated

Thanks and Regards,

Ranganath

 <<fullexportlsyrs.sql>>

WARNING: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. Thank you.

------_=_NextPart_000_01C2EF7D.2AA6A530
Content-Type: application/octet-stream;

        name="fullexportlsyrs.sql"
Content-Disposition: attachment;

        filename="fullexportlsyrs.sql"

#!/bin/ksh

#--------------------------------------------------------------------
# ARGUMENTS
export ORACLE_SID=${1}

#--------------------------------------------------------------------
# CONSTANTS
export SYSTEM_PWD=manager
export ORATAB=/var/opt/oracle/oratab

export EXP_DIR=/export/home/ranganat/backups
export EXP_PREFIX=full_exp
export EXT_TIME=$(date +"%Y%m%d_%H%M")
export EXP_LOG=${EXP_DIR}/${EXP_PREFIX}_${EXT_TIME}.exp
export EXP_DMP=${EXP_DIR}/${EXP_PREFIX}_${EXT_TIME}.dmp.Z
export EXP_PIPE=${EXP_DIR}/${EXP_PREFIX}_${EXT_TIME}_pipe
export EXP_PURGE_RETENTION=2
export EXP_JOB_LOG=${EXP_DIR}/${EXP_PREFIX}_${EXT_TIME}_job.log
exec 1>${EXP_JOB_LOG} 2>&1

#--------------------------------------------------------------------
# FUNCTIONS
usage()
{

 echo ""
 echo "USAGE:"
 echo "fullexport.sh sid"
 echo ""
 echo "where sid    = database sid to run against"

}

derive_oracle_paths()
{

 if [ -f ${ORATAB} ]; then
  export ORACLE_HOME=`awk -F: "/^${ORACLE_SID}:/ {print \\$2; exit}"\    ${ORATAB} 2>/dev/null`
  export ORACLE_BASE=${ORACLE_HOME%%/product*}   export PATH=${ORACLE_HOME}/bin:${PATH}  else

  echo "" >> ${EXP_LOG}
  echo "ERROR:" >> ${EXP_LOG}
  echo "******" >> ${EXP_LOG}
  echo "${ORATAB} not found" >> ${EXP_LOG}
  echo "Aborting fullexport.sh" >> ${EXP_LOG}
  exit 1
 fi

}

check_parameter()
{

 if [ `grep -ic ${ORACLE_SID} ${ORATAB}` -eq 0 ]; then

  echo "" >> ${EXP_LOG}
  echo "ERROR:" >> ${EXP_LOG}
  echo "******" >> ${EXP_LOG}
  echo "Oracle sid ${ORACLE_SID} not found in ${ORATAB}" >> ${EXP_LOG}
  echo "Aborting fullexport.sh" >> ${EXP_LOG}
  exit 1
 fi

}

do_export()
{

  mknod ${EXP_PIPE} p
  compress <${EXP_PIPE} >${EXP_DMP} &
  exp system/${SYSTEM_PWD} buffer=10485760 direct=y log=${EXP_LOG} file =${EXP_PIPE} full=y consistent=y 2>/dev/null   RTN=${?}
  rm ${EXP_PIPE}

}

purge_exports()
{

  find ${EXP_DIR} -name "${EXP_PREFIX}*" -mtime +${EXP_PURGE_RETENTION} -type f -print 2>/dev/null | while read File_Name   do
    echo "Purging file $(ls -Fla ${File_Name})"     rm ${File_Name}
  done

}

#--------------------------------------------------------------------
# MAIN
echo "
###########################################################################"
echo "#Starting ${0##*/} at $(date)"
echo "#"

if [ $# -lt 1 ]; then
 usage
 exit 1
fi

derive_oracle_paths
check_parameter
do_export
purge_exports

echo "#"
echo "#Job run time was: $((${SECONDS} / 3600)) hours, $(((${SECONDS} % 3600) / 60)) minutes, $((${SECONDS} % 60)) seconds" echo "#"
echo "#Ending ${0##*/} at $(date) with an exit status of ${RTN}" Received on Fri Mar 21 2003 - 01:40:38 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US