#!/bin/sh
#usage:  installTemplateProcs <server name> <user name> <password>
#
#------------------------------------------------------------------------
# Name:         installTemplateProcs
#
# Purpose:      This is a Bourne Shell script for installing stored procedures
#               needed for the job scheduler.
#
#------------------------------------------------------------------------

 if [ $# -ne 3 ]; then
 
      echo -----------------------------------------------
      echo 'Usage:  installTemplateProcs <server name> <user name> <password>'
      echo -----------------------------------------------
      exit
 fi
echo 'Creating generic stored procedures used by Sybase Job Scheduler Template jobs'
isql -S$1 -U$2 -P$3 -ijst_check_reorg_space
isql -S$1 -U$2 -P$3 -ijst_database_names
isql -S$1 -U$2 -P$3 -ijst_get_index_names
isql -S$1 -U$2 -P$3 -ijst_get_datachange
isql -S$1 -U$2 -P$3 -ijst_get_datestr
isql -S$1 -U$2 -P$3 -ijst_get_freespace
isql -S$1 -U$2 -P$3 -ijst_get_mdcache_type_config
isql -S$1 -U$2 -P$3 -ijst_get_usedspace
isql -S$1 -U$2 -P$3 -ijst_reconf_mdcache_type
isql -S$1 -U$2 -P$3 -ijst_version_num
isql -S$1 -U$2 -P$3 -ijst_valid_ase_version
echo 'Creating job-specific stored procedures used by Sybase Job Scheduler Templates'
isql -S$1 -U$2 -P$3 -ijst_delete_statistics
isql -S$1 -U$2 -P$3 -ijst_dump_databases
isql -S$1 -U$2 -P$3 -ijst_dump_logs
isql -S$1 -U$2 -P$3 -ijst_reclaim_index_space
isql -S$1 -U$2 -P$3 -ijst_reclaim_table_space
isql -S$1 -U$2 -P$3 -ijst_reconf_locks
isql -S$1 -U$2 -P$3 -ijst_reconf_mdcache
isql -S$1 -U$2 -P$3 -ijst_reconf_usr_conns
isql -S$1 -U$2 -P$3 -ijst_reorg_rebuild_indexes
isql -S$1 -U$2 -P$3 -ijst_reorg_rebuild_tables
isql -S$1 -U$2 -P$3 -ijst_update_statistics
isql -S$1 -U$2 -P$3 -ijst_svr_update_statistics
