creatdb.sql

-- 
-- Title :       createdb.sql 
-- Description : Build an empty database. 
-- 
-- Usage/Notes : Required answers for SYS,
--               SYSTEM and SID. 
--               Adjust directory names as 
--               appropriate. 
-- 
-- Copyright :   ABCdba.com 2004 
-- 
 
ACCEPT syspw PROMPT 'Enter SYS password : '
ACCEPT systpw PROMPT 'Enter SYSTEM password : '
ACCEPT sid PROMPT 'Enter SID name : '
 
SET VERIFY OFF
SET ECHO ON
 
SPOOL createdb.log
 
STARTUP NOMOUNT
/
 
CREATE DATABASE &sid
USER SYS IDENTIFIED BY &syspw
USER SYSTEM IDENTIFIED BY &systpw
MAXDATAFILES 1024
MAXINSTANCES 1
MAXLOGFILES 32
MAXLOGMEMBERS 4
MAXLOGHISTORY 100
CHARACTER SET UTF8
DATAFILE '/u01/oradata/&sid/system_01.dbf'
SIZE 500m
EXTENT MANAGEMENT LOCAL
LOGFILE
GROUP 1 ('/u01/oradata/&sid/redo001a.dbf')
SIZE 50m,
GROUP 2 ('/u01/oradata/&sid/redo002a.dbf')
SIZE 50m,
GROUP 3 ('/u01/oradata/&sid/redo003a.dbf')
SIZE 50m,
GROUP 4 ('/u01/oradata/&sid/redo004a.dbf')
SIZE 50m
UNDO TABLESPACE undo
DATAFILE '/u01/oradata/&sid/undo_01.dbf'
SIZE 500m
DEFAULT TEMPORARY TABLESPACE temp
TEMPFILE '/u01/oradata/&sid/temp_01.dbf'
SIZE 500m
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1m
/
 
SET ECHO OFF
 
PROMPT
PROMPT
PROMPT Now running CATALOG. Please wait....
PROMPT
PROMPT
 
SET TERMOUT OFF
 
@${ORACLE_HOME}/rdbms/admin/catalog
 
SET TERMOUT ON
 
PROMPT
PROMPT
PROMPT Now running CATPROC. Please wait....
PROMPT
PROMPT
 
SET TERMOUT OFF
 
@${ORACLE_HOME}/rdbms/admin/catproc
 
SET TERMOUT ON
 
SET ECHO ON
 
CREATE TABLESPACE tools
DATAFILE '/u01/oradata/&sid/tools_01.dbf' SIZE 500m
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
SEGMENT SPACE MANAGEMENT AUTO
/
 
CREATE TABLESPACE users
DATAFILE '/u01/oradata/&sid/users_01.dbf' SIZE 500m
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
SEGMENT SPACE MANAGEMENT AUTO
/
 
CREATE TABLESPACE indx
DATAFILE '/u01/oradata/&sid/indx_01.dbf' SIZE 500m
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
SEGMENT SPACE MANAGEMENT AUTO
/
 
CREATE USER ops$oracle IDENTIFIED EXTERNALLY
DEFAULT TABLESPACE users
/
 
GRANT DBA TO ops$oracle
/
 
CONN system/&systpw
 
SET ECHO OFF
 
PROMPT
PROMPT
PROMPT Now running PUPBLD. Please wait....
PROMPT
PROMPT
 
SET TERMOUT OFF
 
@?/sqlplus/admin/pupbld.sql
 
SET TERMOUT ON
 
SPOOL OFF

© copyright 2001-2014 ABCdba.com | all rights reserved