You are on page 1of 3

DATABASE CREATION

Posted by Narashim Reddy .R on July 27, 2009

1 Votes

STEPS:
1.[oracle@reddy ~]$ vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
ORACLE_HOME=/home/oracle/oracle/product/10.2.0/db_1
LD_LIBRARY_PATH=$ORACLE_HOME/lib
PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH
:wq!
[oracle@reddy ~]$ . .bash_profile (To Run the bash_profile)
2.[oracle@reddy ~]$ export ORACLE_SID=rub (Exporting The SID
Name)
3.[oracle@reddy ~]$ cd $ORACLE_HOME/dbs
[oracle@reddy dbs]$ vi initrub.ora
*.background_dump_dest=/home/oracle/rub/bdump
*.compatible=10.2.0.1.0
*.control_files=/home/oracle/rub/control/c1.ctl
*.db_block_size=4096
*.db_name=rub7
*.log_archive_dest=/home/oracle/rub/archive
*.log_archive_format=arch_%t_%r_%s.arc

*.log_archive_start=true
*.remote_login_passwordfile=exclusive
*.shared_pool_size=250m
*.undo_management=auto
*.user_dump_dest=/home/oracle/rub/udump
:wq!
4.[oracle@reddy ~]$ mkdir rub
[oracle@reddy rub]$ mkdir udump bdump datafiles control archive
[oracle@reddy ~]$ cd rub/
[oracle@reddy rub]$ touch dbc.sql
[oracle@reddy rub]$ ls
archive bdump control datafiles dbc.sql udump
[oracle@reddy rub]$ vi dbc.sql
create database rub
user sys identified by rub
user system identified by rub
logfile group 1(/home/oracle/rub/datafiles/redo01.log)size 10m,
group 2(/home/oracle/rub/datafiles/redo02.log)size 10m
maxlogfiles 4
maxlogmembers 4
maxloghistory 10
maxdatafiles 100
maxinstances 1
character set US7ASCII
national character set AL16UTF16
datafile /home/oracle/rub/datafiles/system01.dbf
size 500m reuse extent management local
sysaux datafile /home/oracle/rub/datafiles/sysaux01.dbf
size 500m reuse
default temporary tablespace temp
tempfile /home/oracle/rub/datafiles/temp01.dbf
size 200m reuse
undo tablespace undotbs1
datafile /home/oracle/rub/datafiles/undotbs1.dbf
size 500m reuse autoextend on maxsize unlimited ;
:wq!
[oracle@reddy rub]$ cd
[oracle@reddy ~]$ sqlplus sys as sysdba

SQL*Plus: Release 10.2.0.1.0 Production on Tue Nov 4 14:31:31


2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
Production
With the Partitioning, OLAP and Data Mining options
SQL> create spfile from pfile;
File created.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 348127232 bytes
Fixed Size 1219328 bytes
Variable Size 289408256 bytes
Database Buffers 50331648 bytes
Redo Buffers 7168000 bytes
SQL> @/home/oracle/rub/dbc.sql
Database created
SQL> @?/rdbms/admin/catalog.sql
SQL> @?/rdbms/admin/catproc.sql

You might also like