Create Database Oracle9i
Process to create database
1) Create the directory Structure
d:\ORCL\uDump
d:\ORCL\bDump
d:\ORCL\PFile
d:\ORCL\DataFile
d:\ORCL\RedoLog
d:\ORCL\ControlFile
//Optional
d:\ORCL\temp
d:\ORCL\undo
2) Create pfile e.g. initORCL.ora under d:\ORCL\pfile\
Example of init.ora file copy and past the contents in a notepad file and name it as initORCL.ora and put that file under d:\ORCL\pfile
=======================================================================================
##############################################################################
# Database Created as on 25-August-2009
# by Sandip
##############################################################################
###########################################
# Cache and I/O
###########################################
db_block_size=8192
db_cache_size=25165824
db_file_multiblock_read_count=16
###########################################
# Cursors and Library Cache
###########################################
open_cursors=300
###########################################
# Database Identification
###########################################
db_domain=""
db_name=ORCL
###########################################
# Diagnostics and Statistics
###########################################
background_dump_dest=D:\ORCL\bdump
core_dump_dest=D:\ORCL\cdump
timed_statistics=TRUE
user_dump_dest=D:\ORCL\udump
###########################################
# File Configuration
###########################################
control_files=("D:\ORCL\ControlFile\Control01.CTL","D:\ORCL\ControlFile\Control02.CTL")
###########################################
# Instance Identification
###########################################
instance_name=ORCL
###########################################
# Job Queues
###########################################
job_queue_processes=10
###########################################
# MTS
###########################################
dispatchers="(PROTOCOL=TCP) (SERVICE=ORCLXDB)"
###########################################
# Miscellaneous
###########################################
aq_tm_processes=1
compatible=9.2.0.0.0
###########################################
# Optimizer
###########################################
hash_join_enabled=TRUE
query_rewrite_enabled=FALSE
star_transformation_enabled=FALSE
###########################################
# Pools
###########################################
java_pool_size=33554432
#large_pool_size=8388608
shared_pool_size=50331648
###########################################
# Processes and Sessions
###########################################
processes=150
###########################################
# Redo Log and Recovery
###########################################
fast_start_mttr_target=300
###########################################
# Security and Auditing
###########################################
remote_login_passwordfile=EXCLUSIVE
###########################################
# Sort, Hash Joins, Bitmap Indexes
###########################################
pga_aggregate_target=25165824
sort_area_size=524288
###########################################
# System Managed Undo and Rollback Segments
###########################################
undo_management=AUTO
undo_retention=10800
undo_tablespace=UNDOTBS01
############################################################################
=========================================================================================
3) Create andinstance for the database in the Command line by the following command which will also
oradim -new -sid ORCL -intpwd admin -pfile d:\ORCL\pfile\initORCL.ora
4) To indicates what instance to connect to or what TNS alias to use type the following in command line.
set oracle_sid=ORCL
5) start the instance in nomount mode
startup nomount pfile=d:\ORCL\pfile\initORCL.ora
6) Run the Script to create the Database
@d:\ORCL\CreateDB.sql
Example of Script
========================================================================================
CREATE DATABASE ORCL
MAXLOGFILES 6
MAXLOGMEMBERS 4
MAXINSTANCES 2
DATAFILE 'D:\ORCL\DataFile\SYSORCL.DBF' SIZE 200M reuse autoextend on next 15M maxsize unlimited
LOGFILE group 1('D:\ORCL\RedoLog\Log1a.log','D:\ORCL\RedoLog\Log1b.log') SIZE 30M,
group 2('D:\ORCL\RedoLog\Log2a.log','D:\ORCL\RedoLog\Log2b.log') SIZE 30M
UNDO TABLESPACE UNDOTBS01 DATAFILE 'D:\ORCL\DataFile\UNDOTBS01.DBF' SIZE 100M
default temporary tablespace TEMP01 tempfile 'D:\ORCL\DataFile\TEMP01.dbf'size 50M
CHARACTER SET US7ASCII
NATIONAL CHARACTER SET AL16UTF16
/
========================================================================================
7) Oracle, should respond by saying that the database is created.
Once this is done you are ready to load scripts that are needed
to support your Oracle products by typing the following commands.
Now run the following three scripts respectively.They are located in Oracle Directory
@D:\oracle\ora92\rdbms\admin\catalog.sql
@D:\oracle\ora92\rdbms\admin\catproc.sql
@D:\oracle\ora92\rdbms\admin\catexp.sql
connect as system
@D:\oracle\ora92\sqlplus\admin\pupbld.sql
8) Ok, the database is configured. Change the SYSTEM and SYS passwords,
to ensure better security for your database.