0

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.

1
  • $ORACLE_HOME/bin/dbstart (as oracle user)
    – ibre5041
    Commented Nov 8, 2013 at 10:27

1 Answer 1

2

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

7
  • Thanks! I assume that oraenv and dbstart are the only necessary commands that I should issue. I also, understand from your post that, dbstart simply starts the database engine but not any databases(which means we have to start all the databases on our own). If so, can you please mention how I can start the databases using sqlplus ?
    – M-D
    Commented Nov 8, 2013 at 11:02
  • Edited my answer to answer your questions. In Oracle 11g, every database has at least one Oracle Instance (set of processes) to serve the database. So, after dbstart your databases are running. Don't confuse database and schema. In one database we can have multiple schema's that each contains their own tables and procedures.
    – user953
    Commented Nov 8, 2013 at 11:11
  • Thanks jk, got it now. Can you please suggest a good dba book that has everything from Beginning to Intermediary level ?
    – M-D
    Commented Nov 8, 2013 at 11:16
  • There are many books but I can recommend diving into this: oracle.com/pls/db112/homepage, start with 2day dba.
    – user953
    Commented Nov 8, 2013 at 11:38
  • the step 5. $ORACLE_HOME/bin/dbstart $ORACLE_HOME. Do not forget to start the listener too.
    – ibre5041
    Commented Nov 8, 2013 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.