What all to start for oracle database server

oracle

I am a Db guy familiar with Postgresql and Mysql. I have just started with Oracle and I have installed oracle 11g R2 on a RHEL-6 server. The installation was successful (the runInstaller script). During the install I had opted for Create and configure a database and I gave the DB the name "orcl".

After everything finished successfully, when I issued "ps aux | grep -i 'oracle'" in my shell (bash), I had got a log of processes (dont' remember the names of all of them). However, I stopped the server and now I want to know how I can start the oracle service. I have seen many commands to start Oracle(this link, so I am confused what are the necessary things that I must start. If it was Postgres or MySQL, it would have been only /etc/init.d/(mysqld|postgres) start.

So what are the things that I should start ? and please give me a brief a description of what that command does.

Best Answer

If you have the entries for your instance added to /etc/oratab (that should be "orcl:/your/oracle/home:Y" ) and you did run the root.sh in the end of that installation and the root.sh placed the environment scripts in /usr/locla/bin (the default), you can issue:

  1. ORACLE_SID=orcl
  2. ORAENV_ASK=NO
  3. . /usr/local/bin/oraenv
  4. unset ORAENV_ASK
  5. $ORACLE_HOME/bin/dbstart

What oraenv does is mainly setting environment variables like ORACLE_HOME, ORACLE_BASE and PATH. PATH is made up of $ORACLE_HOME/bin. You could add the environment setup to your .profile and of course, you can start the database manually using sqlplus.

The dbstart script starts all databases that are registered in the oratab file, that have a 'Y' in the third column.

Manually starting, after the environment has been setup for a specific instance as shown above:

sqlplus / as sysdba
startup

If you want to switch to a different database just issue . oraenv (if /usr/local/bin is in the PATH) and give it the ORACLE_SID of the database that you want to manage.

Most databases will be accessed using a client from an other machine/VM. In that case you also might want to start the listener: lsnrctl start