Oracle DB startup details

After installing Oracle DB 11g R2, we have to create a BD using :

$ dbca

If you don’t have (yet) the environment variables, you have to create at .bash_profile :


After creating the database we have to configure the listener to allow TCP connections :

$ netmgr

After NetManager opens, go to Oracle Net Configuration > Local > Listeners > LISTENER and provide the SID as you defined in the DB creation steps. Save the configuration and close the NetManager.

After that, we have to start the listener as :

$ lsnrctl start && dbstart

Automatic statartup script

Depending on your system, you have to create script at startup scripts; we can create (on Fedora/RedHat) the script /etc/init.d/oracle as :

# /etc/rc.d/init.d/oracle
# Description: Starts and stops the Oracle database, listeners and Enterprise Manager
# See how we were called.
case "$1" in
echo "Starting Oracle"
echo -n "Starting Oracle Databases: "
su angellore -c dbstart >> /tmp/oracle.log
echo "Done."

echo -n "Starting Oracle Listeners: "
su angellore -c "lsnrctl start" >> /tmp/oracle.log
echo "Done."

echo -n "Starting Oracle Enterprise Manager: "
su angellore -c "emctl start dbconsole" >> /tmp/oracle.log
echo "Done."
touch /var/lock/subsys/oracle
echo "Shutting Down Oracle"
echo -n "Shutting Down Oracle Enterprise Manager: "
su angellore -c "emctl stop dbconsole" >> /tmp/oracle.log
echo "Done."

echo -n "Shutting Down Oracle Listeners: "
su angellore -c "lsnrctl stop" >> /tmp/oracle.log
echo "Done."

rm -f /var/lock/subsys/oracle
echo -n "Shutting Down Oracle Databases: "
su angellore -c dbshut >> /tmp/oracle.log
echo "Done."
echo "Usage: oracle {start|stop|restart}"

Finally, in /etc/oratab we have to tell oracle that out instance has to be started up at boot time :

# This file is used by ORACLE utilities. It is created by
# and updated by the Database Configuration Assistant when creating
# a database.

# A colon, ‘:’, is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, ‘#’, are comments.
# Entries are of the form:
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , «Y», or should not,
# «N», be brought up at system boot time.
# Multiple entries with the same $ORACLE_SID are not allowed.

If you have problems with the shared memory at startup time, you have to create more shared memory space as :

$ mount -t tmpfs shmfs -o size=4g /dev/shm && echo "shmfs /dev/shm tmpfs size=4g 0" >> /etc/fstab

Deja una respuesta

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de

Estás comentando usando tu cuenta de Salir /  Cambiar )

Google photo

Estás comentando usando tu cuenta de Google. Salir /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Salir /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Salir /  Cambiar )

Conectando a %s