home *** CD-ROM | disk | FTP | other *** search
- :
- #
- # $Header: rdbms.ver.pp,v 6.24 89/06/26 15:02:58 lchan Exp $ rdbms.ver.pp
- #
- #
- # rdbms.ver.pp
- #
- # This script does 6 things to verify the ORACLE RDBMS product:
- # - install ORACLE RDBMS if $ORACLE_INSTALL!=T
- # i.e. NOT being called inside rdbms.install
- # - display banners for sqldba
- # - invoke ptt
- # - invoke ftt
- # - sga relocation
- # - exporting and importing scott/tiger tables
- # (This is just a VERY short test to verify that
- # ORACLE RDBMS is functional. It is not trying
- # to demonstrate the product nor to qa it.)
- #
- # The script is assumed itself to be in ?/rdbms/install
- # All output of this automated process will be recorded in
- # ?/rdbms/install/rdbms_ver.out
- #
-
- NETLIBNAME="nsl_s"
- PHYS_BLK_SIZE=2048
- VNDR_NETLIBS="-lnsl_s "
- CHOWN=/bin/chown
- MAKE=make
- ORACLE_LPPROG="/usr/bin/lp"
- ORACLE_PAGER="/usr/bin/more"
- ORACLE_LPSTAT="/usr/bin/lpstat"
-
- product=rdbms
- PRODUCT=RDBMS
- MKTG_NAME="ORACLE RDBMS"
-
- #
- # Setup the environment variables for the verification script.
- #
- . $ORACLE_HOME/install/setup.ver
-
- #
- ## 1. Automatically install ORACLE RDBMS if ! $ORACLE_INSTALL.
- # i.e. not called by rdbms.install
- #
- echo $N ".$C" #Wait message
- if test "$ORACLE_INSTALL" != T
- then
-
- echo "#Default install of ORACLE RDBMS:
- " >> $OUTPUT
- # Since we are calling rdbms.install within verify,
- # ORACLE_VERIFY should be false.
- ORACLE_VERIFY=F
- export ORACLE_VERIFY
- ORACLE_DEFAULT=T
- export ORACLE_DEFAULT
- # exit if install fails
- rdbms.install >> $OUTPUT 2>&1 <<!
- !
- if test $? -gt 0
- then
- echo "Error occured while running the install scripts."
- echo "Please check the log file rdbms_ver.out."
- exit
- fi
- echo "
-
- " >> $OUTPUT
- echo " #########################################
- " >> $OUTPUT
-
- fi
- #
- ## 2. Check banners for sqldba, exp and imp
- # * uses $ORACLE_HOME/install/prtversion.sh
- #
- echo $N ".$C" #Wait message
- echo "#Check the banners:
- " >> $OUTPUT
- $ORACLE_HOME/install/prtversion.sh -f temp$$
- echo $N ".$C" #Wait message
- fgrep 'sqldba
- exp
- imp' temp$$ >> $OUTPUT
- rm temp$$
- echo "
-
- " >> $OUTPUT
-
- echo " ########################################
- " >> $OUTPUT
- #
- ## 3. Invoke ptt
- #
- echo $N ".$C" #Wait message
- echo "#Invoking ptt
- " >> $OUTPUT
- sqldba >/dev/null 2>&1 <<!
- spool temp.out
- connect $SYSTEM_PASS@P:
- create table temp (col1 number, col2 char(5));
- insert into temp values (1,'A');
- insert into temp values (2,'B');
- insert into temp values (3,'C');
- select * from temp;
- update temp set col2 = 'BB' where col1 = 2;
- select * from temp;
- drop table temp;
- disconnect;
- !
- cat -s temp.out >> $OUTPUT 2>&1
-
- echo "
-
- " >> $OUTPUT
- echo " ########################################
- " >> $OUTPUT
-
- #
- ## 4. Invoke ftt
- #
- echo $N ".$C" #Wait message
- echo "#Invoking ftt
- " >> $OUTPUT
- sqldba >/dev/null 2>&1 <<!
- spool temp.out
- connect $SYSTEM_PASS@F:
- create table temp (col1 number, col2 char(5));
- insert into temp values (1,'A');
- insert into temp values (2,'B');
- insert into temp values (3,'C');
- select * from temp;
- update temp set col2 = 'BB' where col1 = 2;
- select * from temp;
- drop table temp;
- disconnect;
- !
- cat -s temp.out >> $OUTPUT 2>&1
- rm -f temp.out
-
- echo "
- " >> $OUTPUT
- echo " ########################################
- " >> $OUTPUT
-
- #
- ## 5. Test sga relocation
- #
- # Assumption: definition of sgabeg in ksms.s always starts with '0X'
- # (see genksms.c in $SRCHOME/rdbms/utl)
- #
- # NOTE: On SYS_PSGASTRUCT ports, the user relocates the SGA by
- # specifying a parameter in the init.ora file. Of course, the SGA
- # can't be relocated on some SYS_PSGASTRUCT ports, such as the HP9000S800.
- #
-
- echo $N ".$C" #Wait message
-
- echo "#Test sga relocation
- # i) find a suitable value for NEW_SGABEG
- # ii) define sgabeg in ksms.s to be the one found in i)
- # iii) remake oracle using oracle.mk
- # iv) invoke the new oracle
- " >> $OUTPUT
-
- echo "
- ls -l $ORACLE_HOME/bin/oracle" >> $OUTPUT
- ls -l $ORACLE_HOME/bin/oracle >> $OUTPUT
- echo "" >> $OUTPUT
-
- cd ../lib
- $MAKE -f oracle.mk ksms.s >> $OUTPUT 2>&1
-
- OLD_SGABEG=`grep 0[xX] ksms.s`
- mv ksms.s ksms.sSAV
-
- # Define machine specific SGABEG here.
-
- NEW_SGABEG=0x80400000
-
- echo " # i)
- " >> $OUTPUT
- echo "OLD SGABEG : $OLD_SGABEG
- NEW SGABEG : $NEW_SGABEG
- " >> $OUTPUT
-
- cat ksms.sSAV | sed "s/0[xX].*/$NEW_SGABEG/" > ksms.s
-
- echo "
- # ii) grep NEW_SGABEG ksms.s
- " >> $OUTPUT
- grep $NEW_SGABEG ksms.s >> $OUTPUT
-
- echo $N ".$C" #Wait message
- echo $N ".$C" #Wait message
-
- echo "
- #iii) make -f oracle.mk oracle
- " >> $OUTPUT
- # Before we start, back up any oracle kernel already existing in
- # ORACLE_HOME/rdbms/lib
- mv -f oracle oracleSAV >/dev/null 2>&1
- $MAKE -f oracle.mk oracle >> $OUTPUT 2>&1
- # shutdown database with old sgabeg.
- sqldba >/dev/null 2>&1 <<!
- shutdown
- !
-
- mv $ORACLE_HOME/bin/oracle $ORACLE_HOME/bin/oracleSAV
- mv oracle $ORACLE_HOME/bin/oracle
- chmod 4711 $ORACLE_HOME/bin/oracle
-
- echo "
- # iv) invoke new oracle
- ls -l $ORACLE_HOME/bin/oracle" >> $OUTPUT
- ls -l $ORACLE_HOME/bin/oracle >> $OUTPUT
- sqldba >/dev/null 2>&1 <<!
- spool temp.out
-
- startup
- connect internal
- create table temp (col1 number, col2 char(5));
- insert into temp values (1,'A');
- insert into temp values (2,'B');
- insert into temp values (3,'C');
- select * from temp;
- update temp set col2 = 'BB' where col1 = 2;
- select * from temp;
- drop table temp;
- disconnect;
- shutdown
- exit
- !
- cat -s temp.out >> $OUTPUT 2>&1
-
- # restore sgabeg to the old value
- mv $ORACLE_HOME/bin/oracleSAV $ORACLE_HOME/bin/oracle
-
- mv $ORACLE_HOME/rdbms/lib/ksms.sSAV $ORACLE_HOME/rdbms/lib/ksms.s
-
- mv -f $ORACLE_HOME/rdbms/lib/oracleSAV $ORACLE_HOME/rdbms/lib/oracle \
- >/dev/null 2>&1
- sqldba >/dev/null 2>&1 <<!
- startup
- !
- echo "
- #sga relocation test done.
- #SGABEG has been restored to $OLD_SGABEG
- " >> $OUTPUT
- echo "
- " >> $OUTPUT
- echo " ########################################
- " >> $OUTPUT
-
- #
- ## 6. Export and import scott/tiger tables
- #
- # Assumption: SQL*Plus is also included in the ship tape.
- #
- echo $N ".$C" #Wait message
- echo $N ".$C" #Wait message
-
- echo "#export and import scott/tiger tables
- " >> $OUTPUT
-
- # Build the scott/tiger demo tables.
- echo " # i) Build the scott/tiger demo tables
- " >> $OUTPUT
- sqldba >/dev/null 2>&1 <<!
- connect $SYSTEM_PASS
- grant connect,resource to scott identified by tiger;
- connect scott/tiger
- @$ORACLE_HOME/sqlplus/demo/demobld
- spool temp.out
- connect scott/tiger
- select * from emp;
- spool off
- !
- cat -s temp.out >> $OUTPUT 2>&1
-
- echo $N ".$C" #Wait message
- echo $N ".$C" #Wait message
-
- # export the data to verify.dmp
- echo "
- # ii) export the data
- # exp scott/tiger file=verify.dmp grants=y rows=y compress=n indexes=y
- # constraints=y" >> $OUTPUT
- exp scott/tiger file=verify.dmp grants=y rows=y compress=n indexes=y \
- constraints=y >> $OUTPUT 2>&1
-
- echo $N ".$C" #Wait message
- echo $N ".$C" #Wait message
- echo "
-
- #iii) delete the existing data in the database ( to make sure that
- # import works )
- " >> $OUTPUT
- sqldba >/dev/null 2>&1 <<!
- connect scott/tiger
- delete from emp;
- delete from dept;
- delete from salgrade;
- delete from bonus;
- delete from dummy;
- spool temp.out
- connect scott/tiger
- select * from emp;
- !
- cat -s temp.out >> $OUTPUT 2>&1
-
- echo $N ".$C" #Wait message
- echo $N ".$C" #Wait message
- # import back the data from verify.dmp
- echo "
- # iv) import back the data
- # imp scott/tiger file=verify.dmp ignore=y grants=y rows=y fromuser=scott
- " >> $OUTPUT
- imp scott/tiger file=verify.dmp ignore=y grants=y rows=y fromuser=scott >> \
- $OUTPUT 2>&1
-
- echo $N ".$C" #Wait message
- echo $N ".$C" #Wait message
- echo "
- # v) verify that import works
- " >> $OUTPUT
- sqldba >/dev/null 2>&1 <<!
- spool temp.out
- connect scott/tiger
- select * from emp;
- !
- cat -s temp.out >> $OUTPUT 2>&1
- rm -f temp.out verify.dmp
- echo "
-
- " >> $OUTPUT
-
- echo " ####### Rdbms.Verify Done #######
- " >> $OUTPUT
-
- echo ""
- echo " ####### Rdbms.Verify Done #######"
-
-