create_db.sql

 


 rem ======================================================================
 rem Name:  create_PROD.sql
 rem 
 rem Desc:  Create a "PROD" database, including:  
 rem   
 rem   1. Database
 rem   2. Data dictionary
 rem   3. Rollback tablespace and segments
 rem   4. Lawson tablespaces 
 rem   5. "lawson" user
 rem 
 rem 
 rem ======================================================================
 
 
 rem Create the database:
 
 create database PROD
   logfile '/u01/oracle/dbs/PROD_log01.dbf' size 5M,
 	  '/u02/oracle/dbs/PROD_log02.dbf' size 5M,
 	  '/u03/oracle/dbs/PROD_log03.dbf' size 5M,
 	  '/u01/oracle/dbs/PROD_log04.dbf' size 5M,
 	  '/u02/oracle/dbs/PROD_log05.dbf' size 5M,
 	  '/u03/oracle/dbs/PROD_log06.dbf' size 5M
   datafile '/u01/oracle/dbs/PROD_system01.dbf' size 80M;
 
 connect sys/change_on_install
 
 
 rem Create the data dictionary:
 
 @$ORACLE_HOME/rdbms/admin/catalog.sql
 @$ORACLE_HOME/rdbms/admin/catproc.sql
 
 
 rem Create the rollback tablespace and segments:
 
 create tablespace rbs
 datafile '/u01/oracle/dbs/PROD_rbs01.dbf' size 300M;
 
 create rollback segment r01
 tablespace rbs
 storage (initial 10M next 10M minextents 2 maxextents 121 optimal 20M);
 
 create rollback segment r02
 tablespace rbs
 storage (initial 10M next 10M minextents 2 maxextents 121 optimal 20M);
 
 create rollback segment r03
 tablespace rbs
 storage (initial 10M next 10M minextents 2 maxextents 121 optimal 20M);
 
 create rollback segment r04
 tablespace rbs
 storage (initial 10M next 10M minextents 2 maxextents 121 optimal 20M);
 
 create rollback segment r05
 tablespace rbs
 storage (initial 10M next 10M minextents 2 maxextents 121 optimal 20M);
 
 alter rollback segment r01 online;
 alter rollback segment r02 online;
 alter rollback segment r03 online;
 alter rollback segment r04 online;
 alter rollback segment r05 online;
 
 
 rem Create the Lawson tablespaces and user:
 
 create tablespace lawtemp
 datafile '/u01/oracle/dbs/PROD_lawtemp01.dbf' size 50M;
 
 create tablespace lawdata
 datafile '/u02/oracle/dbs/PROD_lawdata01.dbf' size 1024M;
 
 create tablespace lawindex
 datafile '/u03/oracle/dbs/PROD_lawindex01.dbf' size 2000M;
 
 grant connect, resource to lawson identified by lawson;
 
 alter user lawson
 default tablespace lawdata
 temporary tablespace lawtemp;