Example of a sybase_mydb_restore script
The following code example shows the sybase_mydb_restore script:
#***************************************************************************
# Replace /usr/sybase12 below with your actual Sybase home directory
#***************************************************************************
SYBASE=/usr/sybase12
#***************************************************************************
# Replace SYBASE12 below with your actual name of the SQL Server
#***************************************************************************
SYBSERVER=SYBASE12
if [ ! -d "${SYBASE}"/ASE-12_0/ ]
then
#************** Sybase 11.9.2 or earlier **************
ASE_QUAL=
OCS_QUAL=
else
#************** Sybase 12.0 or later **************
SYBASE_ASE=ASE-12_0; export SYBASE_ASE
SYBASE_OCS=OCS-12_0; export SYBASE_OCS
ASE_QUAL=/$SYBASE_ASE
OCS_QUAL=/$SYBASE_OCS
fi
#***************************************************************************
# Replace /usr/openv/netbackup/ext/db_ext/sybase/scripts/sybase_mydb_load
# below with your actual SQL script path which contains corresponding
# LOAD commands
#***************************************************************************
LOADDB=/usr/openv/netbackup/ext/db_ext/sybase/scripts/sybase_mydb_load
echo "Started 'date'"
SYBASE=$SYBASE; export SYBASE
RETURN_STATUS=0
# NetBackup has started a restore
#***************************************************************************
# Replace "manager" with your Sybase server Administrator's Password
#***************************************************************************
echo "$SYBASE$OCS_QUAL/bin/isql -Usa -Pmanager -I$SYBASE/interfaces -S$SYBSERVER < $LOADDB"
$SYBASE$OCS_QUAL/bin/isql -Usa -Pmanager -I$SYBASE/interfaces -S$SYBSERVER < $LOADDB
RETURN_STATUS=$?
echo "Finished 'date'"
echo "exit $RETURN_STATUS"
echo ""
exit $RETURN_STATUS