spool C:\ewdb_create_log
set echo on
connect INTERNAL/earthworm1
startup nomount pfile=C:\orant\database\initewdb.ora
CREATE DATABASE ewdb
LOGFILE 'C:\orant\database\logewdb01.ora' SIZE 10M,
    'C:\orant\database\logewdb02.ora' SIZE 10M,
    'C:\orant\database\logewdb03.ora' SIZE 10M,
    'C:\orant\database\logewdb04.ora' SIZE 10M,
    'C:\orant\database\logewdb05.ora' SIZE 10M,
    'C:\orant\database\logewdb06.ora' SIZE 10M
MAXLOGFILES 32 
MAXLOGMEMBERS 4
MAXLOGHISTORY 1
DATAFILE 'e:\oradata\ewdb\System01.ora' SIZE 75M
MAXDATAFILES 1020
MAXINSTANCES 1
CHARACTER SET WE8ISO8859P1
NATIONAL CHARACTER SET WE8ISO8859P1;

connect INTERNAL/earthworm1
ALTER DATABASE DATAFILE 'e:\oradata\ewdb\System01.ora' AUTOEXTEND ON;
CREATE ROLLBACK SEGMENT SYSROL TABLESPACE "SYSTEM" STORAGE (INITIAL 100K NEXT 100K);
ALTER ROLLBACK SEGMENT "SYSROL" ONLINE;
@C:\orant\Rdbms80\admin\catalog.sql;
@C:\orant\Rdbms80\admin\catproc.sql
@C:\orant\Rdbms80\admin\caths.sql

REM **************TABLESPACE FOR ROLLBACK*****************
CREATE TABLESPACE RBS DATAFILE 'e:\oradata\ewdb\RBS01.ora' SIZE 500M
DEFAULT STORAGE ( INITIAL 1024K NEXT 1024K MINEXTENTS 2 MAXEXTENTS  UNLIMITED  PCTINCREASE 0);
ALTER DATABASE DATAFILE 'e:\oradata\ewdb\RBS01.ora' AUTOEXTEND ON;

REM ***********Alter system tablespace ********************
ALTER TABLESPACE SYSTEM
DEFAULT STORAGE ( INITIAL 5000K NEXT 5000K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 1);

REM **************TABLESPACE FOR USER*********************
CREATE TABLESPACE user DATAFILE 'E:\oradata\ewdb\user01.ora' SIZE 10M
DEFAULT STORAGE ( INITIAL 50K NEXT 50K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 1);
ALTER DATABASE DATAFILE 'E:\oradata\ewdb\user01.ora' AUTOEXTEND OFF;

REM **************TABLESPACE FOR TEMPORARY*****************
CREATE TABLESPACE TEMPORARY DATAFILE 'F:\oradata\ewdb\temp01.ora' SIZE 100M
DEFAULT STORAGE ( INITIAL 100K NEXT 100K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 1) ;
ALTER DATABASE DATAFILE 'F:\oradata\ewdb\temp01.ora' AUTOEXTEND OFF;

REM **************TABLESPACE FOR INDEX*********************
CREATE TABLESPACE INDX DATAFILE 'e:\oradata\ewdb\Indx.ora' SIZE 10M
DEFAULT STORAGE ( INITIAL 50K NEXT 50K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 1);
ALTER DATABASE DATAFILE 'e:\oradata\ewdb\Indx.ora' AUTOEXTEND OFF;

REM **** Creating two rollback segments ****************
CREATE PUBLIC ROLLBACK SEGMENT RB0 TABLESPACE "RBS"
STORAGE ( INITIAL 50K NEXT 50K MINEXTENTS 2 MAXEXTENTS UNLIMITED);
CREATE PUBLIC ROLLBACK SEGMENT RB1 TABLESPACE "RBS"
STORAGE ( INITIAL 50K NEXT 50K MINEXTENTS 2 MAXEXTENTS UNLIMITED);
CREATE PUBLIC ROLLBACK SEGMENT RB2 TABLESPACE "RBS"
STORAGE ( INITIAL 50K NEXT 50K MINEXTENTS 2 MAXEXTENTS UNLIMITED);
CREATE PUBLIC ROLLBACK SEGMENT RB3 TABLESPACE "RBS"
STORAGE ( INITIAL 50K NEXT 50K MINEXTENTS 2 MAXEXTENTS UNLIMITED);
ALTER ROLLBACK SEGMENT "RB0" ONLINE;
ALTER ROLLBACK SEGMENT "RB1" ONLINE;
ALTER ROLLBACK SEGMENT "RB2" ONLINE;
ALTER ROLLBACK SEGMENT "RB3" ONLINE;
alter user sys temporary tablespace TEMPORARY;
alter user system default tablespace user;
alter rollback segment "SYSROL" offline;

alter user system identified by earthworm;

connect system/earthworm
@C:\orant\DBS\pupbld.sql

spool off
