After the installation of Oracle Software on the system, We can create the database either manually or using DBCA.
Here, we are seeing how to create a database manually.
Setting Parameters :
#groupadd -g 500 dba #passwd oracle
# Add the following lines
SQL > exit
Here, we are seeing how to create a database manually.
Setting Parameters :
Login as root user
#useradd -u 501 -g 500 -s /bin/bash -d /home oracle
#chmod -R 777 /home
#chown -R oracle:dba /home
#vi /etc/sysctl.conf
# ADD THE FOLLOWING LINES
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144
Run the following command to change the current kernel parameters:
/sbin/sysctl -p
#init 6 (restart the system)
Login as oracle user
$vi .bash_profile
export ORACLE_HOME=/home/oracle/product/10.2.0/db_1
export ORACLE_SID=demo
$. .bash_profile
$sqlplus '/as sysdba'
connected to an idle instance
$cd $ORACLE_HOME/dbs
Copy the init.ora file to init$ORACLE_SID.ora and then open the init$ORACLE_SID.ora and modify the following parameters
db_name=demo
shared_pool_size=90m
control_files=/home/demo/control1.ctl,/home/demo/control2.ctl
dbs~] $cp init.ora init$ORACLE_SID.ora
dbs~] $ vi init$ORACLE_SID.oraBefore the modification of the init file, it looks like
Make the necessary changes,
Add the new paths and new name for the database ex: demo
User_dump_dest=/home/prd/udump
Core_dump_dest=/home/prd/cdump
Background_dump_dest=/home
After changing the parameter in the parameter file ,just save and exit.
Note: we can create a directory at oracle home
i.e $cd
$mkdir demo
$cd demo
$mkdir udump bdump cdump
connect as sysdba and start the database in nomount mode
$ . .bash_profile
$sqlplus / as sysdba
SQL> startup nomount
Database is created in nomount stage.
Here sga created and background processes are started.
To know the base tables
SQL>select * from user$;
To know the users
SQL>select name from user$;
When database instance is started issue the create database script at SQL prompt.
Execute the following scripts.
SQL>@$ORACLE_HOME/rdbms/admin/catalog.sql
Or
SQL>@$ORACLE_HOME/rdbms/admin/catalog.sql
Or
SQL>@/home/oracle/product/10.2.0/db_1/rdbms/admin/catalog.sql
and
SQL>@?/rdbms/admin/catproc.sql
Connect system/manger
SQL> @?/sqlplus/admin/pupbld.sql
Now you have created a manual database and is ready to use :)







No comments:
Post a Comment