Integrating Oracle and Data Protector

 

Configuring an Oracle Backup

 

Examples of Pre-Exec and Post-Exec Scripts on UNIX

Pre-Exec Example

The following is an example of a script that shuts down an Oracle

 

instance:

 

#!/bin/sh

 

export ORACLE_HOME=$2

 

export ORACLE_SQLNET_NAME=$1

 

if [ -f $ORACLE_HOME/bin/sqlplus ]; then

 

$ORACLE_HOME/bin/sqlplus << EOF

 

connect sys/manager@$ORACLE_SQLNET_NAME as sysdba

 

shutdown

 

EOF

 

echo "Oracle database \"$DB_NAME\" shut down."

 

exit 0

 

else

 

echo "Cannot find Oracle SQLPLUS

 

($ORACLE_HOME/bin/sqlplus)."

 

exit 1

 

fi

Post-Exec

The following is an example of a script that starts an Oracle instance:

Example

#!/bin/sh

 

 

export ORACLE_HOME=$2

 

export ORACLE_SQLNET_NAME=$1

 

if [ -f $ORACLE_HOME/bin/sqlplus ]; then

 

$ORACLE_HOME/bin/sqlplus << EOF

 

connect sys/manager@$ORACLE_SQLNET_NAME as sysdba

 

startup

 

EOF

 

echo "Oracle database \"$DB_NAME\" started."

 

exit 0

 

else

 

echo "Cannot find Oracle SQLPLUS

46

Chapter 1

Page 68
Image 68
HP OpenView Storage B6960-96008 manual Examples of Pre-Exec and Post-Exec Scripts on Unix, Pre-Exec Example