A sample script

The following SQL script will create a database called DB1 using the OFA architecture. You will find a copy of this script at the O’Reilly web site (see the Preface for details).

REM * ***********************************************************
REM * Script to create DB1 instance with db_block_size = 8192
REM *
REM *  Created:   Dave Kreines - 10/18/98
REM *
REM *
REM * ***********************************************************
spool /disk00/oracle/software/7.3.4/dbs/crdbDB1.log

REM * Start the instance (ORACLE_SID must be set to <DB1>).
REM *
connect internal
startup nomount pfile=/disk00/oracle/software/7.3.4/dbs/initDB1.ora

REM * Create the <DB1> database.
REM *
create database "DB1"
    maxinstances 2
    maxlogfiles  32
    maxdatafiles 1000
    character set "US7ASCII"
datafile '/disk00/oracle/oradata/DB1/system01.dbf' size 50M
logfile  '/disk01/oracle/oradata/DB1/log01.log' size 512K,
         '/disk01/oracle/oradata/DB1/log02.log' size 512K,
         '/disk01/oracle/oradata/DB1/log03.log' size 512K,
         '/disk01/oracle/oradata/DB1/log04.log' size 512K;

REM * Now perform all commands necessary to create
REM * the final database after the CREATE DATABASE command has
REM * succeeded.

REM * install data dictionary:
@/disk00/oracle/software/7.3.4/rdbms/admin/catalog.sql

REM * install procedural components:
@/disk00/oracle/software/7.3.4/rdbms/admin/catproc.sql

REM * Create additional rollback segment in SYSTEM since
REM * at least one non-system rollback segment is required
REM * before creating a tablespace.
REM *
create rollback segment SYSROLL tablespace system
storage (initial 25K next 25K minextents 2 maxextents 99);

REM * Put SYSROLL online without shutting
REM * down and restarting the database.
REM *
alter rollback segment SYSROLL online;

REM * Create a tablespace for rollback segments.
REM *
create tablespace ROLLBACK
 datafile '/disk01/oracle/oradata/DB1/rbs01.dbf' size 25M
 default storage (
  initial      500K
  next         500K
  pctincrease  0
  minextents   2
);

REM * Create the "real" rollback segments.
REM *
create rollback segment RBS01 tablespace ROLLBACK
storage (initial 500K next 500K minextents 2 optimal 1M);
create rollback segment RBS02 tablespace ROLLBACK
storage (initial 500K next 500K minextents 2 optimal 1M);
create rollback segment RBS03 tablespace ROLLBACK
storage (initial 500K next 500K minextents 2 optimal 1M);
create rollback segment RBS04 tablespace ROLLBACK
storage (initial 500K next 500K minextents 2 optimal 1M);

REM * Use ALTER ROLLBACK SEGMENT ONLINE to put rollback segments online
REM * without shutting down and restarting the database.
REM *
alter rollback segment RBS01 online;
alter rollback segment RBS02 online;
alter rollback segment RBS03 online;
alter rollback segment RBS04 online;

REM * Since we've created and brought online 4 more rollback segments,
REM * we no longer need the rollback segment in the SYSTEM tablespace.
REM * We could delete it, but we will leave it here in case we need it
REM * in the future.
alter rollback segment SYSROLL offline;

REM * Create a tablespace for temporary segments.
create tablespace TEMP
 datafile '/disk02/oracle/oradata/DB1/temp01.dbf' size 25M
 default storage (
 initial     100K
 next        100K
 maxextents  UNLIMITED
 pctincrease 0
);

REM * Create a tablespace for database tools.
REM *
create tablespace TOOLS
 datafile '/disk03/oracle/oradata/DB1/tools01.dbf' size 25M
 default storage (
 initial     50K
 next        50K
 maxextents  UNLIMITED
 pctincrease 0
);

REM * Create tablespaces for user activity.
REM *
create tablespace DATA
 datafile '/disk04/oracle/oradata/DB1/data01.dbf' size 100M
 default storage (
   initial     250K
   next        250K
   maxextents  UNLIMITED
   pctincrease 0
);

REM * Create tablespaces for indexes.
REM *
create tablespace INDEXES
 datafile '/disk05/oracle/oradata/DB1/index01.dbf' size 100M
 default storage (
   initial     250K
   next        250K
   maxextents  UNLIMITED
   pctincrease 0
);

REM * Alter SYS and SYSTEM users, because Oracle will make SYSTEM
REM * the default and temporary tablespace by default, and we don't
REM * want that.
REM *
alter user sys temporary tablespace TEMP;
alter user system default tablespace TOOLS temporary tablespace TEMP;

REM * Now run the Oracle-supplied scripts we need for this DB.
REM *
@/disk00/oracle/software/7.3.4/rdbms/admin/catexp.sql
@/disk00/oracle/software/7.3.4/rdbms/admin/dbmspool.sql
@/disk00/oracle/software/7.3.4/rdbms/admin/prvtpool.plb

REM * Now run the Oracle-supplied script to create the DBA views
REM * for the SYSTEM account.  Change to SYSTEM first.
REM *
connect system/manager
@/disk00/oracle/software/7.3.4/rdbms/admin/catdbsyn.sql

REM * All done, so close the log file and exit.
REM *
spool off
exit
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.25.140