ECHO OFF

SET PATH=%PATH%;c:\oracle\ora81\bin;C:\ORANT\bin;
SET SIM_USERNAME=system
SET SIM_PASSWORD=sto2et
SET SIM_DATABASE=storet

C:
cd C:\storet\orasto2\SIM\SIM201_inst

del done_remove_SIM201.log
ECHO ON

if "%SIM_DATABASE%" == "" goto remove
SQLPLUS.EXE system/%SIM_PASSWORD%@%SIM_DATABASE% @Remove_SIM201
goto remove2 
:remove 
SQLPLUS.EXE system/%SIM_PASSWORD% @Remove_SIM201
:remove2 

:do2
if not exist done_remove_SIM201.log goto do2

cd C:
del C:\storet\orasto2\SIM\SIM201_INDEX\SIM201_idx.ora
del C:\storet\orasto2\SIM\SIM201_DATA\SIM201_dta.ora
ECHO OFF

del done_setup_SIM201.log 
rem setup of SIM201 

ECHO ON
cd C:\storet\orasto2\SIM\SIM201_inst

if "%SIM_DATABASE%" == "" goto setup
SQLPLUS.EXE system/%SIM_PASSWORD%@%SIM_DATABASE% @setup_SIM201 %SIM_DATABASE%
goto setup2 
:setup 
SQLPLUS.EXE system/%SIM_PASSWORD% @setup_SIM201_DBNull 
:setup2 


:do3 
if not exist done_setup_SIM201.log goto do3

if "%SIM_DATABASE%" == "" goto dbnull
 sqlldr SIM201/SIM201@%SIM_DATABASE% sim_config 
 sqlldr SIM201/SIM201@%SIM_DATABASE% sim_imp_defs
 sqlldr SIM201/SIM201@%SIM_DATABASE% sim_imp_fmts 
 sqlldr SIM201/SIM201@%SIM_DATABASE% sim_imp_cols 
 sqlldr SIM201/SIM201@%SIM_DATABASE% sim_imp_allow_values
 sqlldr SIM201/SIM201@%SIM_DATABASE% sim_imp_instrs 
 sqlldr SIM201/SIM201@%SIM_DATABASE% sim_imp_instr_choices 
 sqlldr SIM201/SIM201@%SIM_DATABASE% sim_imp_fmt_choices 
 sqlldr SIM201/SIM201@%SIM_DATABASE% sim_imp_cfg
 sqlldr SIM201/SIM201@%SIM_DATABASE% sim_imp_cfg_dets
 sqlldr SIM201/SIM201@%SIM_DATABASE% sim_imp_cfg_instrs
 sqlldr SIM201/SIM201@%SIM_DATABASE% sim_translations
 imp SIM201/SIM201@%SIM_DATABASE% file=sim_help.dmp ignore=y grants=n
 goto dbnull2
:dbnull 
 sqlldr SIM201/SIM201 sim_config 
 sqlldr SIM201/SIM201 sim_imp_defs
 sqlldr SIM201/SIM201 sim_imp_fmts 
 sqlldr SIM201/SIM201 sim_imp_cols 
 sqlldr SIM201/SIM201 sim_imp_allow_values
 sqlldr SIM201/SIM201 sim_imp_instrs 
 sqlldr SIM201/SIM201 sim_imp_instr_choices 
 sqlldr SIM201/SIM201 sim_imp_fmt_choices 
 sqlldr SIM201/SIM201 sim_imp_cfg
 sqlldr SIM201/SIM201 sim_imp_cfg_dets
 sqlldr SIM201/SIM201 sim_imp_cfg_instrs
 sqlldr SIM201/SIM201 sim_translations
 imp SIM201/SIM201 file=sim_help.dmp ignore=y grants=n

:dbnull2

Echo done_load_data_SIM201 > done_load_data_SIM201.log 


Echo off
Echo
Echo Sim Setup complete. 
Echo
Echo Please view the log files: C:\storet\orasto2\SIM\SIM201_inst\setup_SIM201.log for any errors. 

EXIT

