Further Information

Examples of Pre-Exec and Post-Exec Commands for UNIX

Session Pre-Exec:

Shut Down

Application

Examples of Pre-Exec and Post-Exec Commands for UNIX

The following scripts are some examples of Pre- and Post- exec commands on UNIX.

The script shuts down an Oracle instance.

#!/bin/sh

export ORACLE_HOME=$2 export ORACLE_SQLNET_NAME=$1

if [ -f $ORACLE_HOME/bin/svrmgrl ]; then $ORACLE_HOME/bin/svrmgrl << EOF

connect sys/manager@$ORACLE_SQLNET_NAME as sysdba shutdown

EOF

echo "Oracle database \"$ORACLE_SID\" shut down." exit 0

else

Disk Image

Pre-Exec:

Unmount a Disk

Before a Raw

Volume Backup

echo "Cannot find Oracle SVRMGRL ($ORACLE_HOME/bin/svrmgrl)."

exit 1 fi

#!/bin/sh

echo "The disk will be unmounted!" umount /disk_with_many_files

if [ $? = 0 ] then

echo "The disk has been successfully unmounted!" exit 0

A-20

Appendix A

Page 750
Image 750
HP B6960-90078 manual Examples of Pre-Exec and Post-Exec Commands for Unix, Session Pre-Exec Shut Down Application