home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a524 / 28.ddi / install / rdbms.verify < prev   
Encoding:
Text File  |  1991-03-04  |  8.1 KB  |  346 lines

  1. :
  2. # $Header: rdbms.ver.pp,v 6.24 89/06/26 15:02:58 lchan Exp $ rdbms.ver.pp 
  3. #
  4. # rdbms.ver.pp
  5. #
  6. # This script does 6 things to verify the ORACLE RDBMS product:
  7. #    - install ORACLE RDBMS if $ORACLE_INSTALL!=T
  8. #          i.e. NOT being called inside rdbms.install
  9. #    - display banners for sqldba
  10. #    - invoke ptt
  11. #    - invoke ftt
  12. #    - sga relocation
  13. #    - exporting and importing scott/tiger tables
  14. #          (This is just a VERY short test to verify that
  15. #           ORACLE RDBMS is functional.  It is not trying
  16. #           to demonstrate the product nor to qa it.)
  17. # The script is assumed itself to be in ?/rdbms/install
  18. # All output of this automated process will be recorded in 
  19. # ?/rdbms/install/rdbms_ver.out
  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. product=rdbms
  31. PRODUCT=RDBMS
  32. MKTG_NAME="ORACLE RDBMS"
  33.  
  34. #
  35. #  Setup  the environment variables for the verification script.
  36. #
  37. . $ORACLE_HOME/install/setup.ver
  38.  
  39. #
  40. ## 1. Automatically install ORACLE RDBMS if ! $ORACLE_INSTALL.
  41. #             i.e. not called by rdbms.install
  42. #
  43. echo $N ".$C"                   #Wait message
  44. if test "$ORACLE_INSTALL" != T
  45. then
  46.  
  47. echo "#Default install of ORACLE RDBMS:
  48. " >> $OUTPUT
  49. # Since we are calling rdbms.install within verify, 
  50. #   ORACLE_VERIFY should be false.
  51. ORACLE_VERIFY=F
  52. export ORACLE_VERIFY
  53. ORACLE_DEFAULT=T
  54. export ORACLE_DEFAULT
  55. # exit if install fails
  56. rdbms.install >> $OUTPUT 2>&1 <<!
  57. !
  58. if test $? -gt 0
  59. then 
  60. echo "Error occured while running the install scripts."
  61. echo "Please check the log file rdbms_ver.out."
  62. exit
  63. fi
  64. echo "
  65.  
  66. " >> $OUTPUT
  67. echo "               #########################################
  68. " >> $OUTPUT
  69.  
  70. fi
  71. #
  72. ## 2. Check banners for sqldba, exp and imp
  73. #        * uses $ORACLE_HOME/install/prtversion.sh
  74. #
  75. echo $N ".$C"                   #Wait message
  76. echo "#Check the banners:
  77. " >> $OUTPUT
  78. $ORACLE_HOME/install/prtversion.sh -f temp$$
  79. echo $N ".$C"                   #Wait message
  80. fgrep 'sqldba
  81. exp
  82. imp' temp$$ >> $OUTPUT
  83. rm temp$$
  84. echo "
  85.  
  86. " >> $OUTPUT
  87.  
  88. echo "               ########################################
  89. " >> $OUTPUT
  90. #
  91. ## 3. Invoke ptt
  92. #
  93. echo $N ".$C"                   #Wait message
  94. echo "#Invoking ptt
  95. " >> $OUTPUT
  96. sqldba >/dev/null 2>&1 <<!
  97. spool temp.out
  98. connect $SYSTEM_PASS@P:
  99. create table temp (col1 number, col2 char(5));
  100. insert into temp values (1,'A');
  101. insert into temp values (2,'B');
  102. insert into temp values (3,'C');
  103. select * from temp;
  104. update temp set col2 = 'BB' where col1 = 2;
  105. select * from temp;
  106. drop table temp;
  107. disconnect;
  108. !
  109. cat -s temp.out >> $OUTPUT 2>&1
  110.  
  111. echo "
  112.  
  113. " >> $OUTPUT
  114. echo "               ########################################
  115. " >> $OUTPUT
  116.  
  117. #
  118. ## 4. Invoke ftt
  119. #
  120. echo $N ".$C"                   #Wait message
  121. echo "#Invoking ftt
  122. " >> $OUTPUT
  123. sqldba >/dev/null 2>&1 <<!
  124. spool temp.out
  125. connect $SYSTEM_PASS@F:
  126. create table temp (col1 number, col2 char(5));
  127. insert into temp values (1,'A');
  128. insert into temp values (2,'B');
  129. insert into temp values (3,'C');
  130. select * from temp;
  131. update temp set col2 = 'BB' where col1 = 2;
  132. select * from temp;
  133. drop table temp;
  134. disconnect;
  135. !
  136. cat -s temp.out >> $OUTPUT 2>&1
  137. rm -f temp.out
  138.  
  139. echo "
  140. " >> $OUTPUT
  141. echo "               ########################################
  142. " >> $OUTPUT
  143.  
  144. #
  145. ## 5. Test sga relocation
  146. #
  147. #  Assumption:  definition of sgabeg in ksms.s always starts with '0X'
  148. #                   (see genksms.c in $SRCHOME/rdbms/utl)
  149. #
  150. #  NOTE:  On SYS_PSGASTRUCT ports, the user relocates the SGA by
  151. #  specifying a parameter in the init.ora file.  Of course, the SGA
  152. #  can't be relocated on some SYS_PSGASTRUCT ports, such as the HP9000S800.
  153. #
  154.  
  155. echo $N ".$C"                   #Wait message
  156.  
  157. echo "#Test sga relocation
  158.       #   i) find a suitable value for NEW_SGABEG
  159.       #  ii) define sgabeg in ksms.s to be the one found in i)
  160.       # iii) remake oracle using oracle.mk
  161.       #  iv) invoke the new oracle
  162. " >> $OUTPUT
  163.  
  164. echo "
  165.     ls -l $ORACLE_HOME/bin/oracle" >> $OUTPUT
  166. ls -l $ORACLE_HOME/bin/oracle >> $OUTPUT
  167. echo "" >> $OUTPUT
  168.  
  169. cd ../lib
  170. $MAKE -f oracle.mk ksms.s >> $OUTPUT 2>&1
  171.  
  172. OLD_SGABEG=`grep 0[xX] ksms.s`
  173. mv ksms.s ksms.sSAV
  174.  
  175. # Define machine specific SGABEG here.
  176.  
  177. NEW_SGABEG=0x80400000
  178.  
  179. echo "   #  i)
  180. " >> $OUTPUT
  181. echo "OLD SGABEG : $OLD_SGABEG
  182. NEW SGABEG : $NEW_SGABEG
  183. " >> $OUTPUT
  184.  
  185. cat ksms.sSAV | sed "s/0[xX].*/$NEW_SGABEG/" > ksms.s
  186.  
  187. echo "
  188.    # ii) grep NEW_SGABEG ksms.s
  189. " >> $OUTPUT
  190. grep $NEW_SGABEG ksms.s >> $OUTPUT
  191.  
  192. echo $N ".$C"                   #Wait message
  193. echo $N ".$C"                   #Wait message
  194.  
  195. echo "
  196.    #iii) make -f oracle.mk oracle
  197. " >> $OUTPUT
  198. # Before we start, back up any oracle kernel already existing in
  199. #    ORACLE_HOME/rdbms/lib
  200. mv -f oracle oracleSAV >/dev/null 2>&1
  201. $MAKE -f oracle.mk oracle >> $OUTPUT 2>&1
  202. # shutdown database with old sgabeg.
  203. sqldba >/dev/null 2>&1 <<!
  204. shutdown
  205. !
  206.  
  207. mv $ORACLE_HOME/bin/oracle $ORACLE_HOME/bin/oracleSAV
  208. mv oracle $ORACLE_HOME/bin/oracle
  209. chmod 4711 $ORACLE_HOME/bin/oracle
  210.  
  211. echo "
  212.    # iv) invoke new oracle
  213.        ls -l $ORACLE_HOME/bin/oracle" >> $OUTPUT
  214. ls -l $ORACLE_HOME/bin/oracle >> $OUTPUT
  215. sqldba >/dev/null 2>&1 <<!
  216. spool temp.out
  217.  
  218. startup
  219. connect internal
  220. create table temp (col1 number, col2 char(5));
  221. insert into temp values (1,'A');
  222. insert into temp values (2,'B');
  223. insert into temp values (3,'C');
  224. select * from temp;
  225. update temp set col2 = 'BB' where col1 = 2;
  226. select * from temp;
  227. drop table temp;
  228. disconnect;
  229. shutdown
  230. exit
  231. !
  232. cat -s temp.out >> $OUTPUT 2>&1
  233.  
  234. # restore sgabeg to the old value
  235. mv $ORACLE_HOME/bin/oracleSAV $ORACLE_HOME/bin/oracle
  236.  
  237. mv $ORACLE_HOME/rdbms/lib/ksms.sSAV $ORACLE_HOME/rdbms/lib/ksms.s
  238.  
  239. mv -f $ORACLE_HOME/rdbms/lib/oracleSAV $ORACLE_HOME/rdbms/lib/oracle \
  240. >/dev/null 2>&1
  241. sqldba >/dev/null 2>&1 <<!
  242. startup
  243. !
  244. echo "
  245.        #sga relocation test done.  
  246.        #SGABEG has been restored to $OLD_SGABEG
  247. " >> $OUTPUT
  248. echo "
  249. " >> $OUTPUT
  250. echo "               ########################################
  251. " >> $OUTPUT
  252.  
  253. #
  254. ## 6. Export and import scott/tiger tables
  255. #
  256. #  Assumption:  SQL*Plus is also included in the ship tape.
  257. #
  258. echo $N ".$C"                   #Wait message
  259. echo $N ".$C"                   #Wait message
  260.  
  261. echo "#export and import scott/tiger tables
  262. " >> $OUTPUT
  263.  
  264. # Build the scott/tiger demo tables.
  265. echo "   #  i) Build the scott/tiger demo tables
  266. " >> $OUTPUT
  267. sqldba >/dev/null 2>&1 <<!
  268. connect $SYSTEM_PASS
  269. grant connect,resource to scott identified by tiger;
  270. connect scott/tiger
  271. @$ORACLE_HOME/sqlplus/demo/demobld
  272. spool temp.out
  273. connect scott/tiger
  274. select * from emp;
  275. spool off
  276. !
  277. cat -s temp.out >> $OUTPUT 2>&1
  278.  
  279. echo $N ".$C"                   #Wait message
  280. echo $N ".$C"                   #Wait message
  281.  
  282. # export the data to verify.dmp
  283. echo "
  284.    # ii) export the data
  285.    # exp scott/tiger file=verify.dmp grants=y rows=y compress=n indexes=y 
  286.    # constraints=y" >> $OUTPUT
  287. exp scott/tiger file=verify.dmp grants=y rows=y compress=n indexes=y \
  288.  constraints=y >> $OUTPUT 2>&1
  289.  
  290. echo $N ".$C"                   #Wait message
  291. echo $N ".$C"                   #Wait message
  292. echo "
  293.    
  294.    #iii) delete the existing data in the database ( to make sure that
  295.    #     import works )
  296. " >> $OUTPUT
  297. sqldba >/dev/null 2>&1 <<!
  298. connect scott/tiger
  299. delete from emp;
  300. delete from dept;
  301. delete from salgrade;
  302. delete from bonus;
  303. delete from dummy;
  304. spool temp.out
  305. connect scott/tiger
  306. select * from emp;
  307. !
  308. cat -s temp.out >> $OUTPUT 2>&1
  309.  
  310. echo $N ".$C"                   #Wait message
  311. echo $N ".$C"                   #Wait message
  312. # import back the data from verify.dmp
  313. echo "
  314.    # iv) import back the data
  315.    # imp scott/tiger file=verify.dmp ignore=y grants=y rows=y fromuser=scott
  316. " >> $OUTPUT
  317. imp scott/tiger file=verify.dmp ignore=y grants=y rows=y fromuser=scott >> \
  318. $OUTPUT 2>&1
  319.  
  320. echo $N ".$C"                   #Wait message
  321. echo $N ".$C"                   #Wait message
  322. echo "
  323.    #  v) verify that import works
  324. " >> $OUTPUT
  325. sqldba >/dev/null 2>&1 <<!
  326. spool temp.out
  327. connect scott/tiger
  328. select * from emp;
  329. !
  330. cat -s temp.out >> $OUTPUT 2>&1
  331. rm -f temp.out verify.dmp
  332. echo "
  333.  
  334. " >> $OUTPUT
  335.  
  336. echo "               #######    Rdbms.Verify Done    #######
  337. " >> $OUTPUT
  338.  
  339. echo ""
  340. echo "               #######    Rdbms.Verify Done    #######"
  341.  
  342.