No great genius has ever existed without some touch of madness.

Monday 31 October 2011

Creating Oracle database manually


SPECIFYING INSTANCE SID
D:\oracle\product\10.1.0\Db_1>oradim -new -sid %ORACLE_SID% -intpwd MYSECRETPASSWORD -startmode M

CREATING INITIALIZATION PARAMETER FILE


Open the notepad and write various parameters:
db_name='test'
db_cache_size=176160768
java_pool_size=4194304
large_pool_size=4194304
shared_pool_size=96468992
streams_pool_size=0
audit_file_dest='D:\oracle\product\10.2.0\admin\test\adump'
background_dump_dest='D:\oracle\product\10.2.0\admin\test\bdump'
compatible='10.2.0.1.0'
control_files='D:\oracle\product\10.2.0\oradata\test\control01.ctl','D:\oracle\product\10.2.0\oradata\test\control02.ctl','D:\oracle\product\10.2.0\oradata\test\control03.ctl'
core_dump_dest='D:\oracle\product\10.2.0\admin\test\cdump'
db_block_size=8192
db_domain=''
db_file_multiblock_read_count=16

db_recovery_file_dest='D:\oracle\product\10.2.0\flash_recovery_area'
db_recovery_file_dest_size=2147483648
job_queue_processes=10
open_cursors=300
pga_aggregate_target=95420416
processes=150
remote_login_passwordfile='EXCLUSIVE'
sga_target=287309824
undo_management='AUTO'
undo_tablespace='UNDOTBS1'
user_dump_dest='D:\oracle\product\10.2.0\admin\test\udump'

and save this as inittest.ora

STARTING THE INSTANCE
D:\oracle\product\10.1.0\Db_1>sqlplus /nolog
 
SQL*Plus: Release 10.1.0.2.0 - Production on Sat Mar 5 16:05:15 2005
 
Copyright (c) 1982, 2004, Oracle.  All rights reserved.
 
SQL> connect sys/MYSECRETPASSWORD as sysdba
Connected to an idle instance.

SQL*Plus tells us that we're connected to an idle instance. That means that it is not yet started. So, let's start the instance. We have to start the instance without mounting (nomount) as there is no database we could mount at the moment.
SQL> startup nomount
ORACLE instance started.
 
Total System Global Area  113246208 bytes
Fixed Size                   787708 bytes
Variable Size              61864708 bytes
Database Buffers           50331648 bytes
Redo Buffers                 262144 bytes
This created the SGA (System Global Area) and the background processes.
 
 
CREATING THE DATABASE

SQL>create database test
logfile   
group 1 ('D:\oracle\product\10.2.0\oradata\test\redo1.log') size 10M,
group 2 ('D:\oracle\product\10.2.0\oradata\test\redo2.log') size 10M,
group 3 ('D:\oracle\product\10.2.0\oradata\test\redo3.log') size 10M
datafile 'D:\oracle\product\10.2.0\oradata\test\system.dbf
size 50M
autoextend on
next 10M maxsize unlimited
 extent management local
 sysaux datafile 'D:\oracle\product\10.2.0\oradata\test\sysaux.dbf'
 size 10M
 autoextend on
 next 10M
 maxsize unlimited
 undo tablespace undotbs1
 datafile 'D:\oracle\product\10.2.0\oradata\test\undotbs1.dbf'
 size 10M
 default temporary tablespace temp
 tempfile 'D:\oracle\product\10.2.0\oradata\test\temp.dbf'
 size 10M
 character set AL32UTF8
national character set  AL16UTF16;

COMPLETING THE DATABASE CREATION


Now,run
SQL>@ D:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\catalog.sql
SQL> @D:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\catproc.sql
catalog.sql creates the data dictionary.
catproc.sql creates all structures required for PL/SQL.

CONGRATS!!! YOU HAVE SUCCESSFULLY CREATED THE DATABSE

No comments:

Post a Comment