home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a524 / 37.ddi / install / plsql.install < prev    next >
Encoding:
Text File  |  1991-03-04  |  5.4 KB  |  200 lines

  1.  
  2. :
  3. # $Header: plsql.in.pp,v 6.29 90/04/01 21:12:58 pgreenwa Exp $ plsql.in.pp 
  4. #
  5. #  plsql.install
  6. #
  7. #  This is the installation script to install PL/SQL on a
  8. #  UNIX ORACLE system.
  9. #
  10. #  It can be invoked by the master installation script, oracle.install,
  11. #  or as a stand alone procedure.
  12. #
  13. #  The master script, oracle.install, sets ORACLE_HOME and
  14. #  ORACLE_SID before it runs this script.
  15. #  If the script is run stand-alone, then these variables must be set and
  16. #  exported before it is run.
  17. #
  18. #  Default answers are shown in square brackets.
  19. #
  20.  
  21. NETLIBNAME="nsl_s"
  22. PHYS_BLK_SIZE=2048  
  23. VNDR_NETLIBS="-lnsl_s "
  24. CHOWN=/bin/chown
  25. MAKE=make        
  26. ORACLE_LPPROG="/usr/bin/lp"
  27. ORACLE_PAGER="/usr/bin/more"
  28. ORACLE_LPSTAT="/usr/bin/lpstat"
  29.  
  30. #
  31. #  Initialize variables used in installation script.
  32. #
  33. PRODUCT=PLSQL
  34. product=plsql
  35. MKTG_NAME=PL/SQL
  36. SILENT=-s
  37.  
  38. AR=ar
  39.  
  40. # ARDELETE - Delete entry from archive
  41.  
  42. ARDELETE="$AR d"
  43.  
  44. # AREXTRACT - extract entry from archive
  45.  
  46. AREXTRACT="$AR x"
  47.  
  48. #
  49. #  Setup  the environment variables for the installation script.
  50. #
  51. . $ORACLE_HOME/install/setup.ins
  52.  
  53. #FILE_LIST=`cat $ORACLE_HOME/${product}/install/${PRODUCT}.DIST`
  54.  
  55. #
  56. #  rdbms/lib/libpls.a that is shipped, contains a dummy routine.
  57. #  This library will be replaced by the the real libpls.a, if plsql
  58. #  is installed, and the dummy library will be moved to libdumpls.a
  59. #
  60.  
  61. rm -f $ORACLE_HOME/rdbms/lib/libpls.a  >> $LOG 2>&1
  62. ln $ORACLE_HOME/${product}/lib/libpls.a $ORACLE_HOME/rdbms/lib/libpls.a \
  63.    >> $LOG 2>&1
  64.  
  65. #
  66. #
  67. #  libora.a contains a dummy plsql routine that will be deleted from the 
  68. #  library when plsql is installed.
  69. #
  70. $AREXTRACT $ORACLE_HOME/rdbms/lib/libora.a plsdum.o 2>> $LOG
  71. chmod u+w $ORACLE_HOME/rdbms/lib/libora.a 2>> $LOG
  72. $ARDELETE $ORACLE_HOME/rdbms/lib/libora.a plsdum.o 2>> $LOG
  73.  
  74. #
  75. #  If rdbms is not being installed, relink and install oracle.
  76. #
  77. if [ "$RDBMS_INSTALL" != "T" ] ; then
  78.    echo ""
  79.    echo "Relinking the Oracle executable to incorporate $MKTG_NAME..."| tee -a $LOG
  80.    echo ""
  81.    cd $ORACLE_HOME/rdbms/lib
  82.    $MAKE -f oracle.mk oracle >> $LOG 2>&1
  83.    if [ $? = 0 ] ; then
  84.       # make sure the database is down before replacing oracle.
  85.       if [ -f $ORACLE_HOME/dbs/sgadef${ORACLE_SID}.dbf ] ; then
  86.           echo ""
  87.       echo "Database currently running."
  88.       echo $N "Okay to shutdown the database? $C "
  89.     DEFLT="N"; . $INSTALL_HOME/read.sh; ANS=$RDVAR
  90.     case $ANS in 
  91.        y|Y) echo ""
  92.         echo "Shutting down the database..." | tee -a $LOG
  93.         echo ""
  94.         sqldba command=shutdown >> $LOG 
  95.         echo ""
  96.         echo "Installing new Oracle executable in $ORACLE_HOME/bin...
  97.         " | tee -a $LOG
  98.         mv -f $ORACLE_HOME/bin/oracle $ORACLE_HOME/bin/oracle.OLD
  99.         mv oracle $ORACLE_HOME/bin/oracle
  100.          chmod 4751 $ORACLE_HOME/bin/oracle
  101.         echo ""
  102.         echo "Bringing the database up..." | tee -a $LOG
  103.         echo ""
  104.         sqldba command=startup >> $LOG
  105.         ;;
  106.        n|N) echo "
  107.     In order to complete $MKTG_NAME installation, you will need to:
  108.     1- Shutdown the database.
  109.     2- mv $ORACLE_HOME/rdbms/lib/oracle $ORACLE_HOME/bin/oracle
  110.     3- chmod 4751 $ORACLE_HOME/bin/oracle
  111.     4- Startup the database.
  112.     " | tee -a $LOG ;;
  113.     esac
  114.      else
  115.     mv -f $ORACLE_HOME/bin/oracle $ORACLE_HOME/bin/oracle.OLD
  116.     mv oracle $ORACLE_HOME/bin/oracle
  117.     chmod 4751 $ORACLE_HOME/bin/oracle
  118.     echo ""
  119.     echo "New Oracle executable installed in $ORACLE_HOME/bin.
  120.     " |tee -a $LOG
  121.      fi
  122.      case $SUPER_USER in
  123.       TRUE)       $CHOWN $ORACLE_OWNER $ORACLE_HOME/bin/oracle ;;
  124.      esac
  125.    else
  126.       echo "
  127.     Relinking Error.
  128.     The executable for $MKTG_NAME was not made successfully.
  129.     Please check the log file, and repeat the installation
  130.     procedure for $MKTG_NAME.
  131.     " | tee -a $LOG
  132.    fi
  133. fi
  134.  
  135. #
  136. #  Perform steps required to install demo for this product.
  137. #
  138. #echo ""
  139. #echo "Loading $MKTG_NAME PLSQA/SUPERSECRET Demo DataBase..." | tee -a $LOG
  140. #echo ""
  141. #
  142. #sqlplus $SILENT $SYSTEM_PASS <<! >> $LOG 2>&1
  143. #grant connect,resource to plsqa identified by supersecret;
  144. #connect plsqa/supersecret
  145. #        start ?/plsql/demo/buildtab
  146. #        start ?/plsql/demo/enterdat
  147. #!
  148.  
  149. echo "
  150. TO LOAD AND RUN PL/SQL DEMOS:
  151. Please read the README file in $ORACLE_HOME/plsql/demo
  152. for a detailed description on how to load and run the PL/SQL
  153. demos. The RDBMS must be installed and a database has to be
  154. up before you can load and run the demos." | tee -a $LOG
  155. echo ""
  156.  
  157. if [ -d $ORACLE_HOME/c/demo ] ; then
  158.    rm -f $ORACLE_HOME/c/demo/examp6.pc
  159.    rm -f $ORACLE_HOME/c/demo/examp7.pc
  160.    rm -f $ORACLE_HOME/c/demo/sample5.pc
  161.    rm -f $ORACLE_HOME/c/demo/bank_demo.pc
  162.    ln $ORACLE_HOME/plsql/demo/examp6.pc $ORACLE_HOME/c/demo/examp6.pc
  163.    ln $ORACLE_HOME/plsql/demo/examp7.pc $ORACLE_HOME/c/demo/examp7.pc
  164.    ln $ORACLE_HOME/plsql/demo/sample5.pc $ORACLE_HOME/c/demo/sample5.pc
  165.    ln $ORACLE_HOME/plsql/demo/bank_demo.pc $ORACLE_HOME/c/demo/bank_demo.pc
  166. fi
  167.  
  168. #
  169. #  Use "touch" to time stamp hidden file, for future verification of
  170. #  product installation.
  171. touch "$ORACLE_HOME/$product/install/.$product" 2> /dev/null
  172.  
  173. #
  174. #  Hook for verification scripts -- this must happen last
  175. #
  176. case $ORACLE_VERIFY in
  177.     T)    if [ -f $ORACLE_HOME/$product/install/${product}.verify ] ; then
  178.         ORACLE_INSTALL=T ; export ORACLE_INSTALL
  179.         if [ "$RDBMS_INSTALL" != "T" ] ; then
  180.             chmod 755 $ORACLE_HOME/$product/install/${product}.verify
  181.            $ORACLE_HOME/$product/install/${product}.verify
  182.         fi
  183.     fi ;;
  184. esac
  185.  
  186. #
  187. #  Do any cleanup and exit this script.
  188. #
  189. echo ""
  190. case $UPDATE in
  191.     Y) echo "$MKTG_NAME update completed." | tee -a $LOG ;;
  192.     *) echo "$MKTG_NAME installation completed." | tee -a $LOG ;;
  193. esac
  194. echo ""
  195. sync;sync;sync
  196. exit 0
  197.  
  198.