shell scripts



shell scripts:
-------------


parameter file:
--------------



GRID_HOME=/u01/app/11.2.0/grid_1
DB_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
INV_HOME=/u01/app/oraInventory
ORA_BASE=/u01/app/oracle
DB_BASE=/oradb1

DB_TAR=/mnt/hgfs/H/ora.tar
GRID_TAR=/mnt/hgfs/H/grid.tar

GRID_HOME_NAME=Oracle11gR2_gridinfrahome1
DB_HOME_NAME=Oracle11gR2_dbhome1
OSDBA_GROUP=dba
OSOPER_GROUP=dba

AGENT_HOME=/u01
AGENT_TAR=/U01
HOST_NAME=surendra


DATA_DG=D1_T1_A4
FRA_DG=F1_T1_A4


DB_NAME=prod
REDO_SIZE=50M
SYS_PWD=PASSWD
SYSTEM_PWD=PASSWD
DATABASE_CHARACTER_SET=AL32UTF8
DATABASE_N_CHARACTER_SET=AL16UTF16
DATAPUMP_DIR=/oradb1/${DB_NAME}/exports


AUDI_SYS_OPERATIONS=TRUE
AUDIT_TRAIL=db_extended
BACKUP_TAPE_IO_SLAVES=true
COMPATIBLE=11.2.0.1
CONROL_FILE_RECORD_KEEP_TIME=60
DB_BLOCK_SIZE=8192
DB_CACH_SIZE=100M
DBA_FILES=2048
DB_RECOVERY_FILE_DEST_SIZE=32G
FILESYSTEMIO_OPERATIONS=SETALL
JAVA_POOL_SIZE=32M
LARGE_POOL_SIZE=32M
MAX_DUMP_FILE_SIZE=20M
MEMORY_TARGET=470M
OPEN_CURSORS=1024
OPEN_LINKS=6
OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES=TRUE
PROCESSES=250
RESOURCE_LIMIT=true
SESSION_CACHED_CURSORS=256
SGA_TARGET=370M
PGA_AGGREGATE_TARGET=100M
SHARED_POOL_SIZE=80M
STREAM_POOL_SIZE=16M
UNDO_TABLESPACE_NAME=UNDOTBS1



setup file:
---------

#/bin/bash -x

if [ $# != 1 ]; then
 echo "Missing parameter file input. Terminating script "
 exit 1
fi

if [ ! -f $1 ]; then
 echo "Parameter file does not exists. Terminating script"
 exit 1
fi

source $1

#checking parameters

check_par()
{
 if [ ! -z $1 ]; then
   echo "$2  value is missing. Terminating Script"
   exit 1
 fi
}


 if [ ! -z $GRID_HOME ]; then
    echo " GRID HOME : $GRID_HOME "
 else
   echo "GRID HOME not found Terminating Script"
   exit 1
 fi


 if [ ! -z $DB_HOME ]; then
    echo "ORACLE HOME : $DB_HOME"
 else
   echo "ORACLE HOME not found. Terminating Script"
    exit 1
 fi

 if [ ! -z $INV_HOME ]; then
    echo "INVENTORY HOME :$INV_HOME"
 else
   echo "Inventory HOME not found. Terminating Script"
    exit 1
 fi

 if [ ! -z $ORA_BASE ]; then
    echo "ORACLE BASE : $ORA_BASE"
 else
   echo "ORACLE BASE not found. Terminating Script"
    exit 1
 fi

 if [ ! -z $GRID_TAR ]; then
    echo "GRID TAR FILE : $GRID_TAR"
 else
   echo "GRID TAR file not found. Terminating Script"
   exit 1
 fi

 if [ ! -z $DB_TAR ]; then
    echo "ORACLE DATBASE TAR FILE : $DB_TAR"
 else
   echo "ORACLE TAR file not found. Terminating Script"
   exit 1
 fi

if [ ! -z $GRID_HOME_NAME ]; then

    echo "GRID HOME NAME : $GRID_HOME_NAME"

 else

   echo "GRID HOME NAME not found. Terminating Script"

   exit 1

 fi

if [ ! -z $DB_HOME_NAME ]; then
    echo "DB HOME NAME : $DB_HOME_NAME"
 else
   echo "DB HOME NAME not found. Terminating Script"

   exit 1
 fi

if [ ! -z $OSDBA_GROUP ]; then
    echo "OSDBA_GROUP : $OSDBA_GROUP"
 else
   echo "OSDBA GROUP not found. Terminating Script"
   exit 1
fi

if [ ! -z $OSOPER_GROUP ]; then
    echo "OSOPER_GROUP : $OSDBA_GROUP"
 else
   echo "OSOPER GROUP not found. Terminating Script"
   exit 1
fi

 if [ ! -z $SYS_PWD ]; then

    echo "SYS PASSWORD : $SYS_PWD"

 else

   echo "SYS PASSWORD not found. Terminating Script"

   exit 1

 fi



 if [ ! -z $DATA_DG ]; then

    echo "DATA DISK GROUP : $DATA_DG"

 else

   echo "DATA DISK GROUP NAME not found. Terminating Script"

   exit 1

 fi



 if [ ! -z $FRA_DG ]; then

    echo "FRA DISK GROUP : $FRA_DG"

 else

   echo "FRA DISK GROUP NAME not found. Terminating Script"

   exit 1

 fi



 if [ ! -z $AGENT_HOME ]; then

    echo "AHENT HOME : $AGENT_HOME"

 else

   echo "AGENT HOME not found. Terminating Script"

   exit 1

 fi



 if [ ! -z $HOST_NAME ]; then

    echo "HOST NAME : $HOST_NAME"

 else

   echo "HOST NAME not found. Terminating Script"

   exit 1

 fi



 if [ ! -z $AGENT_TAR ]; then

    echo "AGENT TAR FILE : $AGENT_TAR"

 else

   echo "AGENT TAR file name not found. Terminating Script"

   exit 1

 fi


echo "Do You Want To Continue(Y/N):"

read choice


 if [ $choice != "Y" ]; then
  echo " Terminating script.."
  exit 1
 fi


PGM=`/bin/basename $0`

# Validations

echo "##### Validations in progress       .... \c"

iam=`whoami`

if [[ "$iam" != "root" ]]; then

 echo ""

 echo  "$PGM must be run as the root user"

 echo ""

 exit 1

fi



if [ -d ${GRID_HOME} ]

then

 echo ""

 echo " ${GRID_HOME} directory already exists. Terminating Script "

 echo ""

 exit 1

fi



if [ -d ${DB_HOME} ]

then

 echo ""

 echo " ${DB_HOME} directory already exists. Terminating Script "

 echo ""

 exit 1

fi



if [ ! -f $GRID_TAR ]

then

 echo ""

 echo " $GRID_TAR   file does not exists. Terminating Script "

 echo ""

 exit 1

fi



if [ ! -f $DB_TAR ]

then

 echo ""

 echo "  $DB_TAR file does not exists. Terminating Script "

 echo ""

 exit 1

fi





echo " Done"

#Create Directories

echo ""

echo ""

echo "##### Creating Directory Structures ..."

echo ""


su oracle -c "mkdir -p ${GRID_HOME} ${DB_HOME} "



if [ ! -d ${GRID_HOME} ]

then

 echo " Failed to create ${GRID_HOME} directory. Terminating Script "

 exit 1

fi



if [ ! -d ${DB_HOME} ]

then

 echo " Failed to create ${DB_HOME} directory. Terminating Script "

 exit 1

fi



echo " Done"

# Extract and install  Grid binaries

echo ""

echo "#### Extracting GRID binaries ..."

echo ""

cd ${GRID_HOME}
tar -xvf $GRID_TAR

chown -R oracle:dba ${GRID_HOME}

chmod u+s ${GRID_HOME}/bin/oracle

chmod g+s ${GRID_HOME}/bin/oracle

chmod u+s ${GRID_HOME}/bin/extjob

chmod u+s ${GRID_HOME}/bin/jssu

chmod u+s ${GRID_HOME}/bin/oradism


echo ""

echo "#### Staring GRID Installation ..."

echo ""



su oracle -c "perl ${GRID_HOME}/clone/bin/clone.pl -silent ORACLE_BASE=${ORA_BASE} ORACLE_HOME=${GRID_HOME} GRID_HOME_NAME=$GRID_HOME_NAME INVENTORY_LOCATION=${INV_HOME}"



echo ""

echo "#### Starting Post GRID Install tasks ... "

echo ""

$INV_HOME/orainstRoot.sh


${GRID_HOME}/root.sh

${GRID_HOME}/perl/bin/perl -I${GRID_HOME}/perl/lib -I${GRID_HOME}/crs/install ${GRID_HOME}/crs/install/roothas.pl




# Extract and install  RDBMS binaries

echo ""

echo "#### Extracting RDBMS binaries ..."

echo ""

cd ${DB_HOME}

tar -xvf $DB_TAR



echo ""

echo "#### Staring RDBMS Installation ..."

echo ""

su oracle -c "perl ${DB_HOME}/clone/bin/clone.pl ORACLE_HOME=${DB_HOME} ORACLE_BASE=${ORA_BASE} OSDBA_GROUP=$OSDBA_GROUP OSOPER_GROUP=$OSOPER_GROUP  -defaultHomeName"



echo ""

echo "#### Staring Post RDBMS Install tasks ..."

echo ""

${DB_HOME}/root.sh



echo ""

echo "#### Oracle grid and rdbms binaries have been installed successfully on $HOST_NAME server "


su oracle -c "/dba/scripts/asmsetup.sh /dba/scripts/par.ini SKIP"
su oracle -c "/dba/scripts/createdb.sh /dba/scripts/par.ini "


echo " Grid , oracle  installation and ASM , Database created successfully on $HOST_NAME Server..."




asmsetup file:
-------------
#/bin/bash -x

if [ ! $# != 1 ]; then
 echo "Missing parameter file input. Terminating script "
 exit 1
fi

if [ ! -f $1 ]; then
 echo "Parameter file does not exists. Terminating script"
 exit 1
fi

source $1

PGM=`/bin/basename $0`

# Validations

echo "##### Validations in progress       .... \c"

iam=`whoami`

if [[ "$iam" != "oracle" ]]; then
 echo ""
 echo  "$PGM must be run as the oracle user"
 echo ""
 exit 1
fi


export ORACLE_HOME=${GRID_HOME}
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_BASE=${ORA_BASE}
export MACHINE=`uname -n`
export ORAENV_ASK=NO
export ORACLE_SID=+ASM



cat /etc/oratab | grep -v '^#'| grep ^+ASM > /dev/null



if [[ $? != 0 ]]; then
  echo "+ASM:${ORACLE_HOME}:N" >> /etc/oratab
else
  echo "ASM Instance already found. Terminating Script "
  exit 1
fi
. oraenv

cp /u01/init+ASM.ora $ORACLE_HOME/dbs/


srvctl add asm -p ${ORACLE_HOME}/dbs/spfile+ASM.ora

orapwd file=$ORACLE_HOME/dbs/orapw+ASM password=${SYS_PWD}  entries=20 force=y


echo "connecting to sqlplus......."

sqlplus -s / as sysasm <<EOF

startup

CREATE DISKGROUP ${DATA_DG} EXTERNAL REDUNDANCY
DISK 'ORCL:VOL1' NAME ${DATA_DG}_0001
attribute 'au_size'='4M','compatible.rdbms'='11.2','compatible.asm'='11.2';



CREATE DISKGROUP ${FRA_DG} EXTERNAL REDUNDANCY
DISK 'ORCL:FRA1' NAME ${FRA_DG}_0001
attribute 'au_size'='4M','compatible.rdbms'='11.2','compatible.asm'='11.2';



set echo off feed off pages 0 time off timing off trimspool on

spool /tmp/asm_dg.sql

set echo off

select 'alter diskgroup ${DATA_DG} add disk '''||path ||''';' from v\$asm_disk where name is null and path like 'ORCL:VOL%' order by path;

select 'alter diskgroup ${FRA_DG} add disk '''||path ||''';' from v\$asm_disk where name is null and path like 'ORCL:FRA%'order by path;

spool off

set echo on feed on head on

@/tmp/asm_dg.sql
Exit
EOF
echo "ASM Instance is started and disk groups are created successfully on $HOST_NAME Server....."



dbcreate file:
------------


#!/bin/bash

sql_func()
{
  sqlplus -s / as sysdba <<EOF
  SET ECHO OFF NEWP 0 SPA 0 PAGES 0 FEED OFF HEAD OFF TRIMS ON TAB OFF
  $1
  exit
EOF
}

if [ $# != 1 ]; then
 echo "Missing parameter file input. Terminating script "
 exit 1
fi

if [ ! -f $1 ]; then
 echo "Parameter file does not exists. Terminating script"
 exit 1
fi

source $1

PGM=`/bin/basename $0`

# Validations

echo "##### Validations in progress       .... \c"

iam=`whoami`

if [[ "$iam" != "oracle" ]]; then
 echo ""
 echo  "$PGM must be run as the oracle user"
 echo ""
 exit 1
fi

echo " Done"

echo "Setting enviroment variables..."

export ORACLE_HOME=${DB_HOME}
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_BASE=${ORA_BASE}
export MACHINE=`uname -n`
export ORAENV_ASK=NO
export ORACLE_SID=${DB_NAME}

echo "Done"

cat /etc/oratab | grep -v '^#'| grep ^${ORACLE_SID} > /dev/null

if [[ $? != 0 ]];then
  echo "$ORACLE_SID:${ORACLE_HOME}:N" >> /etc/oratab
else
  echo "$ORACLE_SID Instance already found. Terminating Script "
 exit 1
fi

export ORAENV_ASK=NO
. oraenv

echo "Creating Database Subdirectories..."

if [[ ! -d ${DB_BASE}/${ORACLE_SID}/adump ]]; then
mkdir -p ${DB_BASE}/${ORACLE_SID}/adump
fi

if [[ ! -d ${DB_BASE}/${ORACLE_SID}/dbs   ]]; then
mkdir -p ${DB_BASE}/${ORACLE_SID}/dbs  
fi

if [[ ! -d ${DB_BASE}/${ORACLE_SID}/createdb ]]; then
mkdir -p ${DB_BASE}/${ORACLE_SID}/createdb
fi

if [[ ! -d ${DATAPUMP_DIR} ]]; then
mkdir -p ${DATAPUMP_DIR}
 fi

echo "Done"

echo "Creating Password FILE..."

orapwd file=${DB_BASE}/${ORACLE_SID}/dbs/orapw${ORACLE_SID} password=$SYS_PWD entries=20 force=y

if [[ -h ${ORACLE_HOME}/dbs/orapw${ORACLE_SID} ]]; then
rm $ORACLE_HOME/dbs/orapw${ORACLE_SID}
 fi

ln -sf ${DB_BASE}/${ORACLE_SID}/dbs/orapw${ORACLE_SID} ${ORACLE_HOME}/dbs

echo "Done"

echo "creating PFILE...."

#Create init file
echo "
audit_file_dest           = '$DB_BASE/${ORACLE_SID}/adump'
audit_sys_operations      = $AUDI_SYS_OPERATIONS
audit_trail               = '$AUDIT_TRAIL'# Include bind variables in text
backup_tape_io_slaves     = $BACKUP_TAPE_IO_SLAVES
compatible                = '$COMPATIBLE'   # set to current release version 11.2.0.X , where x is the patch level
control_file_record_keep_time = $CONROL_FILE_RECORD_KEEP_TIME
control_files   = ('+${DATA_DG}/${ORACLE_SID}/controlfile/${ORACLE_SID}.ctl','+${FRA_DG}/${ORACLE_SID}/controlfile/${ORACLE_SID}.ctl')
db_block_size             = $DB_BLOCK_SIZE         # Recommended 8K(8192) for most applications, 16K(16384) for more DSS type apps
db_cache_size             = $DB_CACH_SIZE        # Adjust minimum as required using AMM <DBC_SZ>
db_create_file_dest       = '+${DATA_DG}/'                  
db_domain                 = 'monsanto.com'
db_files                  = $DBA_FILES
db_name                   = '${ORACLE_SID}'
db_recovery_file_dest     = '+${FRA_DG}/'
db_recovery_file_dest_size= $DB_RECOVERY_FILE_DEST_SIZE   # should be equal to size for log_a, but not greater than fradg or sum of all dbs using fra
diagnostic_dest           = '$DB_BASE/${ORACLE_SID}'
filesystemio_options      = '$FILESYSTEMIO_OPERATIONS'
instance_name             = '${ORACLE_SID}'
java_pool_size            = $JAVA_POOL_SIZE          # Adjust minimum as required using AMM <JP_SZ>
large_pool_size           = $LARGE_POOL_SIZE          # Adjust Minimum as required using AMM <LP_SZ>
log_archive_dest_1        = 'location=use_db_recovery_file_dest'    
log_archive_format        = '${ORACLE_SID}_%t_%s_%r.arc'
max_dump_file_size        = $MAX_DUMP_FILE_SIZE        # Limit to 10MB, adjust as required
memory_target             = $MEMORY_TARGET        # Adjust minimum as required using AMM <AMM_SZ>
nls_date_format           = 'DD-MON-RRRR HH24:MI:SS'
open_cursors              = $OPEN_CURSORS  # Set high enough to not be of concern, high value has no negative impact
open_links                = $OPEN_LINKS            # Set as appropriate
optimizer_capture_sql_plan_baselines = $OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES
optimizer_features_enable = '$COMPATIBLE'   # Recommend set to current release version (11.2.0.x)
os_authent_prefix         = ''
#parallel_max_servers     = <2xCPU_COUNT># Max. value should be 2 x no. of CPUs, set for AIX only
pga_aggregate_target      = $PGA_AGGREGATE_TARGET         # Adjust minimum as required using AMM <PGA_SZ> (at least 10% of SGA size [(total_mem * 80%) * 50%], recommend 10G for 500 users)
processes                 = $PROCESSES          # Adjust as appropriate, start at 100-200 processes for new db where value is not known
resource_limit            = $RESOURCE_LIMIT
session_cached_cursors    = $SESSION_CACHED_CURSORS
sga_target                = $SGA_TARGET        # Adjust minimum as required using AMM <SGA_SZ> (recommend 2G minimum for 500 users)
shared_pool_size          = $SHARED_POOL_SIZE         # Adjust minimum as required using AMM <SP_SZ> (recommend 1800M for 500 users)
streams_pool_size         = $STREAM_POOL_SIZE          # Used by Data Pump as well as Streams, adjust minimum as required using AMM <ST_SZ>
undo_tablespace           = '$UNDO_TABLESPACE_NAME'
" > ${DB_BASE}/${ORACLE_SID}/dbs/init${ORACLE_SID}.ora

if [ -h $ORACLE_HOME/dbs/init$ORACLE_SID.ora ];
  then rm $ORACLE_HOME/dbs/init$ORACLE_SID.ora
fi

ln -s $DB_BASE/$ORACLE_SID/dbs/init$ORACLE_SID.ora $ORACLE_HOME/dbs

echo "Done"

echo "creating the create database script..."

#creating the create database script

echo "spool createdb_$ORACLE_SID.log
create database $ORACLE_SID
CONTROLFILE REUSE
  USER SYS IDENTIFIED BY $SYS_PWD
  USER SYSTEM IDENTIFIED BY $SYSTEM_PWD
character set $DATABASE_CHARACTER_SET
national character set  $DATABASE_N_CHARACTER_SET
  LOGFILE GROUP 1 ('+$DATA_DG','+$FRA_DG') SIZE $REDO_SIZE ,
          GROUP 2 ('+$DATA_DG','+$FRA_DG') SIZE $REDO_SIZE ,
          GROUP 3 ('+$DATA_DG','+$FRA_DG') SIZE $REDO_SIZE ,
          GROUP 4 ('+$DATA_DG','+$FRA_DG') SIZE $REDO_SIZE
  MAXINSTANCES 1
  MAXLOGHISTORY 1000
  MAXLOGFILES 16
  MAXLOGMEMBERS 5
  MAXDATAFILES 2048
  DATAFILE  SIZE 50M autoextend on
  EXTENT MANAGEMENT LOCAL
  SYSAUX DATAFILE SIZE 60m autoextend on
  DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE SIZE 50M autoextend on
  UNDO TABLESPACE $UNDO_TABLESPACE_NAME DATAFILE SIZE 50M autoextend on;
spool off
" > ${DB_BASE}/${ORACLE_SID}/createdb/createdb_${ORACLE_SID}.sql

echo "Done"

echo "connecting to sqlplus....."
echo "starting the instance nomount stage"
sql_func "startup nomount"

var=`sql_func "select status from v\\$instance;"`
echo $var

if [ $var != "STARTED" ]; then
  echo "Instance not started. Terminating Script"
else
  echo "Done"
  echo "creating Database"
  sql_func "@${DB_BASE}/${ORACLE_SID}/createdb/createdb_${ORACLE_SID}.sql"
fi

var=`sql_func "select status from v\\$instance;"`
echo $var

if [ $var != "OPEN" ]; then
  echo "DATABASE is not opened. Terminating Script"
else
  echo "Done"
fi

#Executing scripts....

echo "Executing catalog.sql"
sql_func "@$ORACLE_HOME/rdbms/admin/catalog.sql"
var=`sql_func "select distinct status from registry$ where comp_name='Oracle Database Catalog Views';"`

if [ $var = 1 ]; then
  echo "Done"
else
  echo "Error In executing catalog.sql. Terminating script"
  exit 1
fi

echo "Executing catblock.sql"
sql_func "@$ORACLE_HOME/rdbms/admin/catblock.sql"
var=`sql_func "select distinct status from registry$ where comp_name='Oracle Database Catalog Views';"`

if [ $var = 1 ]; then
  echo "Done"
else
  echo "Error In executing catblock. Terminating script"
  exit 1
fi

echo "Executing catproc.sql"
sql_func "@$ORACLE_HOME/rdbms/admin/catproc.sql"
var=`sql_func "select distinct status from registry$;"`

if [ $var = 1 ]; then
  echo "Done"
else
  echo "Error In executing catalog.sql. Terminating script"
  exit 1
fi

echo "Executing catoctk.sql"
sql_func "@$ORACLE_HOME/rdbms/admin/catoctk.sql"
echo "Done"

if [ $var = 1 ]; then
  echo "Done"
else
  echo "Error In executing catalog.sql. Terminating script"
  exit 1
fi

echo "Executing owminst.plb"
sql_func "@$ORACLE_HOME/rdbms/admin/owminst.plb;"
var=`sql_func "select distinct status from registry$ where cname="Oracle Workspace Manager";"`

if [ $var = 1 ]; then
  echo "Done"
else
  echo "Error In executing owminst.sql. Terminating script"
  exit 1
fi

if [ $var = 1 ]; then
  echo "Done"
else
  echo "Error In executing catalog.sql. Terminating script"
  exit 1
fi

echo "Executing hlpbld.sql"
sql_func "@$ORACLE_HOME/sqlplus/admin/help/hlpbld.sql helpus.sql"
echo "Done"

if [ $var = 1 ]; then
  echo "Done"
else
  echo "Error In executing catalog.sql. Terminating script"
  exit 1
fi


echo "Executing catctx.sql"
sql_func "@$ORACLE_HOME/ctx/admin/catctx.sql $SYSTEM_PWD sysaux temp noblock"
echo "Done"

if [ $var = 1 ]; then
  echo "Done"
else
  echo "Error In executing catalog.sql. Terminating script"
  exit 1
fi




echo "Executing initjvm.sql"
sql_func "@$ORACLE_HOME/javavm/install/initjvm.sql"
echo "Done"

if [ $var = 1 ]; then
  echo "Done"
else
  echo "Error In executing catalog.sql. Terminating script"
  exit 1
fi


echo "Executing initxml.sql"
sql_func "@$ORACLE_HOME/xdk/admin/initxml.sql"
echo "Done"

if [ $var = 1 ]; then
  echo "Done"
else
  echo "Error In executing catalog.sql. Terminating script"
  exit 1
fi

echo "Executing xmlja.sql"
sql_func "@$ORACLE_HOME/xdk/admin/xmlja.sql"
echo "Done"

if [ $var = 1 ]; then
  echo "Done"
else
  echo "Error In executing catalog.sql. Terminating script"
  exit 1
fi
echo "Executing catjava.sql"
sql_func "@$ORACLE_HOME/rdbms/admin/catjava.sql"
echo "Done"

if [ $var = 1 ]; then
  echo "Done"
else
  echo "Error In executing catalog.sql. Terminating script"
  exit 1
fi
echo "Executing catexf.sql"
sql_func "@$ORACLE_HOME/rdbms/admin/catexf.sql"
echo "Done"

if [ $var = 1 ]; then
  echo "Done"
else
  echo "Error In executing catalog.sql. Terminating script"
  exit 1
fi
echo "Executing utlrp.sql"
sql_func "@$ORACLE_HOME/rdbms/admin/utlrp.sql"
echo "Done"

if [ $var = 1 ]; then
  echo "Done"
else
  echo "Error In executing catalog.sql. Terminating script"
  exit 1
fi
echo "Executing utlsampl.sql"
sql_func "@$ORACLE_HOME/rdbms/admin/utlsampl.sql"
echo "Done"

if [ $var = 1 ]; then
  echo "Done"
else
  echo "Error In executing catalog.sql. Terminating script"
  exit 1
fi

echo "Scripts Execution : Done"


No comments:

Post a Comment