spool d:\orazion\sim\setup_SIM201_1.log

PROMPT Creating Tablespace 'SIM201_INDEX' 
CREATE TABLESPACE SIM201_INDEX  
DATAFILE 'd:\orazion\sim\index\SIM201_INDEX.dbf' SIZE 100M
/
 
PROMPT Creating Tablespace 'SIM201_DATA' 
CREATE TABLESPACE SIM201_DATA  
DATAFILE 'd:\orazion\sim\data\SIM201_DATA.dbf' SIZE 200M
DEFAULT STORAGE (INITIAL 1M NEXT 1M MAXEXTENTS 10)
/

prompt -- create SIM201 schema owner
@D:\temp\SIM\SIM201_SERVER\create_SIM201_usr.sql

prompt -- create document/graphic directory
@D:\temp\SIM\SIM201_SERVER\create_directory.sql

prompt -- grant connect to storet and storet1
@D:\temp\SIM\SIM201_SERVER\grant_connect.sql

prompt -- Create User Roles
@D:\temp\SIM\SIM201_SERVER\create_user_roles.sql

PROMPT -- Grant roles to users
@D:\temp\SIM\SIM201_SERVER\grant_roles_to_users.sql

PROMPT -- Grants for directory
@D:\temp\SIM\SIM201_SERVER\grants_to_directories.sql

connect storet/sto2et@ZION

prompt -- grant storet to SIM201
@D:\temp\SIM\SIM201_SERVER\grant_storet_to_SIM201.sql

connect storet1/sto2et1@ZION

prompt -- grant storet1 to SIM201
@D:\temp\SIM\SIM201_SERVER\grant_storet1_to_SIM201.sql

connect SIM201/SIM201@ZION

prompt -- create SIM201 tables
@D:\temp\SIM\SIM201_SERVER\SIM201.tab

prompt -- create SIM201 synonyms for storet and storet1
@D:\temp\SIM\SIM201_SERVER\create_STORET_syns

prompt -- create SIM201 constraints
@D:\temp\SIM\SIM201_SERVER\SIM201.con

prompt -- create SIM201 sequences
@D:\temp\SIM\SIM201_SERVER\SIM201.sqs

spool off

spool D:\temp\SIM\SIM201_SERVER\setup_SIM201_2.log

prompt -- create SIM201 indexes
@D:\temp\SIM\SIM201_SERVER\SIM201.ind

prompt -- create SIM201 procedures and packages
prompt --
prompt -- SIM2_commit:
@D:\temp\SIM\SIM201_SERVER\sim2_commit.plb
show errors
prompt --
prompt -- SIM2_import_pkg:
@D:\temp\SIM\SIM201_SERVER\sim2_import_pkg.plb
show errors
prompt --
prompt -- sim2_export_pkg:
@D:\temp\SIM\SIM201_SERVER\sim2_export_pkg.plb
show errors
prompt --
prompt -- sim2_import_station_pkg:
@D:\temp\SIM\SIM201_SERVER\sim2_import_station_pkg.plb
show errors

spool off 

spool D:\temp\SIM\SIM201_SERVER\setup_SIM201_3.log

prompt --
prompt -- sim_import_wells_pkg:
@D:\temp\SIM\SIM201_SERVER\sim_import_wells_pkg.plb
show errors

prompt --
prompt -- sim_import_locations_pkg:
@D:\temp\SIM\SIM201_SERVER\sim_import_locations_pkg.plb
show errors

prompt --
prompt -- sim_interface_extras_pkg:
@D:\temp\SIM\SIM201_SERVER\sim_interface_extras_pkg.plb
show errors

spool off 

spool D:\temp\SIM\SIM201_SERVER\setup_SIM201_4.log

prompt --
prompt -- sim_import_result_extras:
@D:\temp\SIM\SIM201_SERVER\sim_import_result_extras.plb
show errors
prompt --
prompt -- sim_import_result_checks:
@D:\temp\SIM\SIM201_SERVER\sim_import_result_checks.plb
show errors
prompt --
prompt -- sim2_import_result_pkg:
@D:\temp\SIM\SIM201_SERVER\sim2_import_result_pkg.plb
show errors
prompt --
prompt -- sim2_import_project_pkg:
@D:\temp\SIM\SIM201_SERVER\sim2_import_project_pkg.plb
show errors
prompt --

prompt -- sim2_export_station_pkg:
@D:\temp\SIM\SIM201_SERVER\sim2_export_station_pkg.plb
show errors
prompt --

prompt -- sim2_export_result_pkg:
@D:\temp\SIM\SIM201_SERVER\sim2_export_result_pkg.plb
show errors
prompt --

prompt -- sim2_export_project_pkg:
@D:\temp\SIM\SIM201_SERVER\sim2_export_project_pkg.plb
show errors
prompt --

prompt -- sim_export_well_pkg:
@D:\temp\SIM\SIM201_SERVER\sim_export_well_pkg.plb
show errors

prompt --
prompt -- sim_export_location_pkg:
@D:\temp\SIM\SIM201_SERVER\sim_export_location_pkg.plb
show errors

prompt --
prompt -- sim2_station_sort:
@D:\temp\SIM\SIM201_SERVER\sim2_station_sort.plb
show errors
prompt --

prompt -- grant SIM to roles
@D:\temp\SIM\SIM201_SERVER\grant_sim_to_roles

connect storuser/storuser@ZION

prompt -- create sim synonyms on STORUSER
@D:\temp\SIM\SIM201_SERVER\SIM201.syn

prompt -- update GPS coordinate columns in STORET
@D:\temp\SIM\SIM201_SERVER\update_decimal_coord.sql

prompt -- update missing uom in STORET
@D:\temp\SIM\SIM201_SERVER\update_uom.sql

connect system/sto2et@ZION

PROMPT -- revoke connect from storet and storet1
@D:\temp\SIM\SIM201_SERVER\REVOKE_CONNECT.sql

spool off

spool D:\temp\SIM\SIM201_SERVER\done_Setup_SIM201.log
prompt done_Setup_SIM201 
spool off 
quit
