rem

SET ECHO OFF

--PROMPT 
--PROMPT specify log path as parameter 5:
--DEFINE log_path = &5
--PROMPT

-- The first dot in the spool command below is 
-- the SQL*Plus concatenation character

--DEFINE spool_file = &log_path.hr_main.log
DEFINE spool_file = myhr_main.log
SPOOL &spool_file

REM =======================================================
REM cleanup section
REM =======================================================

--GRANT CREATE SESSION, CREATE VIEW, ALTER SESSION, CREATE SEQUENCE TO hr;
--GRANT CREATE SYNONYM, CREATE DATABASE LINK, RESOURCE TO hr;
--GRANT execute ON sys.dbms_stats TO hr;

ALTER SESSION SET NLS_LANGUAGE=American;
ALTER SESSION SET NLS_TERRITORY=America;

--
-- create tables, sequences and constraint
--

@ E:\sqldeveloper\human_resources/hr_cre

-- 
-- populate tables
--

@ E:\sqldeveloper\human_resources/hr_popul

--
-- create indexes
--

@ E:\sqldeveloper\human_resources/hr_idx

--
-- create procedural objects
--

@ E:\sqldeveloper\human_resources/hr_code

--
-- add comments to tables and columns
--

@ E:\sqldeveloper\human_resources/hr_comnt

--
-- gather schema statistics
--

--@?/demo/schema/human_resources/hr_analz

spool off
