#! /usr/bin/ksh

##
## Load all our WFS stuff
##

export ORACLE_SID=$1
export db_common=/usr/local/n2bb/watchpoint
export l_log=${db_common}/createDatabase.log


echo "\tCreating the WatchPoint 2.5 database objects........"
echo " "
echo "\tCreating the WatchPoint 2.5 database objects........" >> $l_log

sqlplus -s /nolog <<EOM5
   connect / as sysdba
   spool /home/oracle/admin/${ORACLE_SID}/create/createWFS.log
   PROMPT creating the createWFS procedure PLEASE WAIT
   @createWFS.sql
   PROMPT executing the createWFS procedure PLEASE WAIT
   set serveroutput on
   execute createWFS;
   PROMPT recompiling any invalid objects
   @${ORACLE_HOME}/rdbms/admin/utlrp.sql
   select * From sys.install_table;
   select setting_value as "WatchPoint Version"
     from wfs.system_settings 
     where setting_type = 'RELEASE';
   spool off
   exit
EOM5

exit 0