Re: Installing a new Oracle SID

From: Martin Jarvis <smj_at_jbecpor.demon.co.uk>
Date: Wed, 17 Feb 1993 14:43:19 +0000
Message-ID: <C2LKw8.DEG_at_jbecpor.demon.co.uk>


: Has anyone ever put together a scrip that automates the process
: of setting up a new SID/database? I presently use oracle.install
: and answer no to most of the questions. It would be nice to be able
: to do something like:

No problem !! I keep a script for each database on our machine. The scripts runs under SQL*DBA and creates a single database. It assumes a certain directory structure is present. It runs on a Sun.

#***************************************************************************
# This SQL*DBA script will create the ITSL database.
# Caution, incorrect use could seriously corrupt the database.
#
# Created Martin Jarvis, Feb 1992
# Revised Martin Jarvis, Apr 1992 - Oracle upgrade to V6.0.33
# Revised for port to Hydrogen, Aug 1992
#***************************************************************************

# Save output to a file in case of problems...
set echo on
spool ?/dbs/ITSL/scripts/create_db.lis

# Start the Oracle instance

startup nomount pfile = initITSL.ora  

# Connect internal (log on as SYS)

connect internal  

# Create and initialise the databse and redo logs
create database ITSL

   datafile '?/dbs/ITSL/system/system_1.dbf' size 5m    logfile '?/dbs/ITSL/redo/ITSL_1.rdo' size 2m,

           '?/dbs/ITSL/redo/ITSL_2.rdo' size 2m;  

# Alter default storage parameters on SYSTEM tablespace
alter tablespace system default storage (pctincrease 0);  

# Alter storage parameters on SYSTEM rollback segment
alter rollback segment system storage (pctincrease 0);  

# Install data dictionary views and export/import views
set termout off
set echo off  

_at_?/rdbms/admin/catalog.sql
_at_?/rdbms/admin/expvew.sql
set echo on
set termout on

# Do rest of work as SYSTEM user

connect system/manager  

# Create DBA synonyms for SYSTEM

set termout off
set echo off
_at_?/rdbms/admin/dba_syn.sql
set echo on
set termout on

#create temporary rollback segment in order to create tablespaces
create rollback segment rs_temp;

#shutdown and restart the database to enable new rollback segments
host cp initITSL.ora initITSL.tmp
host echo rollback_segments = rs_temp >> initITSL.tmp disconnect
shutdown
startup pfile = initITSL.tmp
connect system/manager
host rm initITSL.tmp

#Create additional tablspaces

create tablespace rb_segs_1

   datafile '?/dbs/ITSL/system/rb_segs_1.dbf' size 3m;

create tablespace temp_segs_1

   datafile '?/dbs/ITSL/system/temp_segs_1.dbf' size 1m;

#Create additional rollback segments

create rollback segment rs_1

   tablespace rb_segs_1
   storage (initial 100k next 100k pctincrease 0 minextents 5);

create rollback segment rs_2

   tablespace rb_segs_1
   storage (initial 100k next 100k pctincrease 0 minextents 5);  

create rollback segment rs_3

   tablespace rb_segs_1
   storage (initial 100k next 100k pctincrease 0 minextents 5);  

#Shutdown and restart database to enable new rollback segments
host echo rollback_segments = rs_1, rs_2, rs_3 >> initITSL.ora disconnect
shutdown
startup pfile = initITSL.ora
connect system/manager  

# Drop the temporary rollback segment rs_temp
drop rollback segment rs_temp;  

# Make sure that all users use the temps_segs_1 tablespace for temp storage
alter user sys temporary tablespace temp_segs_1; alter user system temporary tablespace temp_segs_1;  

# Turn off spooling

spool off
exit
#----------------------------------------------------------------------------

Regards,

Martin


   Martin Jarvis                         |    John Brown E & C Ltd,
   smj_at_jbecpor.demon.co.uk               |    1 Buckingham Street, 
   Martin Jarvis /JBEC-Portsmouth, IT | Portsmouth, Hampshire, UK
Received on Wed Feb 17 1993 - 15:43:19 CET

Original text of this message