REM * This script takes care off all commands necessary to create
REM * an OFA compliant database after the CREATE DATABASE command has
REM * succeeded.

REM * Set terminal output and command echoing on; log output of this script.
REM *
#set termout on
#set echo on
#spool 2-rdbms.lst

REM * The database should already be started up at this point with:
REM * pfile=/home/oracle/admin/test/pfile/inittest_0.ora

connect internal

REM # install data dictionary views:
@/home/oracle/8.0.5/rdbms/admin/catalog.sql

REM * Create additional rollback segment in SYSTEM before creating tablespace.
REM *
connect internal
create rollback segment r0 tablespace system
storage (initial 16k next 16k minextents 2 maxextents 20);

REM * Use ALTER ROLLBACK SEGMENT ONLINE to put r0 online without shutting
REM * down and restarting the database.
REM *
alter rollback segment r0 online;

REM * Create a tablespace for rollback segments.
REM * Rollback segment configuration guidelines:
REM *   1 rollback segments for every 4 concurrent xactions.
REM *   No more than 50 rollback segments.
REM *   All rollback segments the same size.
REM *   Between 2 and 4 homogeneously-sized extents per rollback segment.
REM * Attempt to keep rollback segments to 4 extents.
REM *
create tablespace rbs datafile
 '/home/oracle/oradata/test/rbs01.dbf' size   15M
default storage (
 initial   128k
 next   128k
 pctincrease    0
 minextents    2
);

REM * Create a tablespace for temporary segments.
REM * Temporary tablespace configuration guidelines:
REM *   Initial and next extent sizes = k * SORT_AREA_SIZE, k in {1,2,3,...}.
REM *
create tablespace temp datafile
 '/home/oracle/oradata/test/temp01.dbf' size   20M
default storage (
 initial      256k
 next         256k
        pctincrease  0
);

REM * Create a tablespace for database tools.
REM *
create tablespace tools datafile
 '/home/oracle/oradata/test/tools01.dbf' size   25M;

REM * Create a tablespace for miscellaneous database user activity.
REM *
create tablespace users datafile
 '/home/oracle/oradata/test/users01.dbf' size   20M;

REM * Create rollback segments.
REM *
create rollback segment r01 tablespace rbs;
create rollback segment r02 tablespace rbs;
create rollback segment r03 tablespace rbs;
create rollback segment r04 tablespace rbs;

REM * Use ALTER ROLLBACK SEGMENT ONLINE to put rollback segments online
REM * without shutting down and restarting the database.  Only put one
REM * of the rollback segments online at this time so that it will always
REM * be the one used.  When the user shuts down the database and starts
REM * it up with initSID.ora, all four will be brought online.
REM *
alter rollback segment r01 online;
REM * alter rollback segment r02 online;
REM * alter rollback segment r03 online;
REM * alter rollback segment r04 online;

REM * Since we've created and brought online 2 more rollback segments,
REM * we no longer need the second rollback segment in the SYSTEM tablespace.
alter rollback segment r0 offline;
drop rollback segment r0;

REM * Alter SYS and SYSTEM users.
REM *
alter user sys temporary tablespace temp;
#revoke resource from system;
#revoke resource on system from system;
#grant resource on tools to system;
alter user system default tablespace tools temporary tablespace temp;

spool off