Siebel Analytics Performance Tuning Guide > The ETL Process > Drop and Recreate Indexes >

Create and Drop Batch Scripts


The following examples illustrate typical batch files.

Oracle

This example accepts the SQL file as a parameter and includes a hard-coded Oracle database connection.

@echo off
echo .............................. >> index.log
echo %1 >> c:\indexes\index.log
echo start date >> c:\indexes\index.log
date /T >> c:\indexes\index.log
time /T >> c:\indexes\index.log
echo .............................. >> index.log
set cmd=SQLPLUS ORAPERF/ORAPERF@PERFSUN5 @c:\indexes\%1.sql
%cmd% >> c:\indexes\index.log
echo .............................. >> index.log
echo End date >> c:\indexes\index.log
date /T >> c:\indexes\index.log
time /T >> c:\indexes\index.log
echo .............................. >> index.log
@echo on

CAUTION:  You need to modify the hard-coded connection username and password so that they meet the security policies at your installation.

You need to include this script as a post-session script to drop or re-create indexes. The index drop and create scripts can go against the OLTP or the data warehouse so you need to have the appropriate connect information as required. The batch executes the script c:\indexes\%1.sql.

IBM DB2

This example illustrates a script for IBM DB2.

@echo off
set DB2CLP=-1617278812
set DB_CONNECT_STRING=OLAP703
set DB_USER=siebel
set DB_PWD=siebtest
db2 connect to %DB_CONNECT_STRING% user %DB_USER% using %DB_PWD%
db2 -tvf %1 > %1.log
db2 disconnect %DB_CONNECT_STRING%
exit

To get the db2clp parameter, enter "echo %DB2CLP%" in the
IBM Db2 -> db2 command window. You do not need to connect.

NOTE:  Scripts that create and drop indexes shipped with Siebel Analytics are available on the Siebel SupportWeb.

Even though these scripts can be executed at the end of any session, it is suggested that you create dummy sessions and attach the postsession script to those sessions.


 Siebel Analytics Performance Tuning Guide 
 Published: 18 April 2003