Saturday, January 3, 2009

Creation of database using oracle.

Creating a Database Manually
• Decide on a unique instance and database name
• Choose a database character set
• Set the operating system variables
• Edit / Create the initialization parameter file
• Start the instance (nomount)
• Execute the CREATE DATABASE command
• Run scripts to generate the data dictionary and
accomplish post creation steps

Preparing the Parameter File
• Create the new initSID.ora

A Sample PFILE initdb01.ora

# Initialization Parameter File: initdb01.ora
db_name = db01
instance_name = db01
control_files = ( /u03/oradata/db01/control01db01.ctl,
/u03/oradata/db01/control02db01.ctl)
db_block_size = 4096
db_block_buffers = 500
shared_pool_size = 31457280 # 30M Shared Pool
db_files = 1024
max_dump_file_size = 10240
background_dump_dest = /u05/oracle9i/admin/db01/bdump
user_dump_dest = /u05/oracle9i/admin/db01/udump
core_dump_dest = /u05/oracle9i/admin/db01/cdump
undo_management = auto
undo_tablespace = undtbs

• Modify the initSID.ora by editing the
parameters

Starting the Instance
• Connect as SYSDBA to an idle instance
• Start the instance in NOMOUNT stage

SQL>STARTUP NOMOUNT

DATABASE CREATION SCRIPT

create a text file and name it as newdb.sql type the following in it

create database db01
logfile
GROUP 1 ('/u01/oradata/db01/log_01_db01.rdo') SIZE 15M,
GROUP 2 ('/u01/oradata/db01/log_02_db01.rdo') SIZE 15M,
GROUP 3 ('/u01/oradata/db01/log_03_db01.rdo') SIZE 15M
datafile '/u01/oradata/db01/system_01_db01.dbf' SIZE 100M
undo tablespace UNDO
datafile '/u01/oradata/db01/undo_01_db01.dbf' SIZE 40M
default temporary tablespace TEMP
tempfile '/u01/oradata/db01/temp_01_db01.dbf' SIZE 20M
extent management local uniform size 128k
character set AL32UTF8
national character set AL16UTF16;

execute the script as

SQL>@newdb.sql

execute the catalog.sql script in the $ORACLE_HOME/admin directory to populate the data dictionary tables.

Now Your DATABASE IS READY TO USE

No comments: