Wednesday, February 8, 2012

Booting Oracle 11g R2 Database Server on CentOS 6.2

This is a how to autostart the Oracle 11g R2 Database Server on CentOS 6.2. I assume you have done the following:

  1. Install an Oracle-ready CentOS 6.2 Linux box
  2. Install the Oracle 11g R2 Database Server on the CentOS 6.2 Linux box
  3. Configure a network listener for Oracle 11g R2 Database Server on the CentOS 6.2 Linux box
  4. Create a fresh Oracle 11g R2 database on the CentOS 6.2 Linux box 

So, it's time to run the three installed components as Linux daemons. These components are: listener, database and enterprise manager. The main programs concerning the start and stop tasks for these components can be found at $ORACLE_HOME/bin, and they are:

  • listener: lsnrctl {start|stop|...}
  • database: dbstart / dbshut
  • ent. manager: emctl {start|stop|...}


  1. Login as the bozz user (a sudoer)  in the server and create the archive /etc/init.d/oracle with the following content:
  2. #!/bin/bash
    
    # oracle: Start/Stop Oracle Database 11g R2
    #
    # chkconfig: 345 90 10
    # description: The Oracle Database Server is an RDBMS created by Oracle Corporation
    #
    # processname: oracle
    
    . /etc/rc.d/init.d/functions
    
    LOCKFILE=/var/lock/subsys/oracle
    ORACLE_HOME=/opt/app/oracle/product/11.2.0/db_1/
    ORACLE_USER=oracle
    
    case "$1" in
    'start')
       if [ -f $LOCKFILE ]; then
          echo $0 already running.
          exit 1
       fi
       echo -n $"Starting Oracle Database:"
       su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl start"
       su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
       su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl start dbconsole"
       touch $LOCKFILE
       ;;
    'stop')
       if [ ! -f $LOCKFILE ]; then
          echo $0 already stopping.
          exit 1
       fi
       echo -n $"Stopping Oracle Database:"
       su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl stop"
       su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
       su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
       rm -f $LOCKFILE
       ;;
    'restart')
       $0 stop
       $0 start
       ;;
    'status')
       if [ -f $LOCKFILE ]; then
          echo $0 started.
          else
          echo $0 stopped.
       fi
       ;;
    *)
       echo "Usage: $0 [start|stop|status]"
       exit 1
    esac
    
    exit 0
    
    
  3. First, ensure that the init.d script can be executed manually:
  4. $ sudo chmod +x /etc/init.d/oracle
    $ sudo /etc/init.d/oracle start 
    
    if so, then stop it:
    $ sudo /etc/init.d/oracle stop
    
  5. Use chkconfig to register the init.d script on runlevels 3, 4 and 5:
    $ sudo chkconfig --add oracle
    
    then verify if is marked as on in the runleves 3, 4 and 5:
    $ chkconfig --list oracle
    oracle             0:off    1:off    2:off    3:on    4:on    5:on    6:off
    
  6. Reboot and enjoy!

95 comments:

  1. Dear Eduardo,

    Thank you so much for the articles about installing Oracle!
    It is really helpful tutorial.
    Thanks again!

    ReplyDelete
  2. This worked really well for me too. I appreciate your good work.

    ReplyDelete
    Replies
    1. Thak you very much! Any kind of feedback will be appreciated!

      Delete
  3. Dear Eduardo,

    This is really wonderful. It helped me a lot...I've been struggling on bringing up Oracle, Weblogic in one Linux machine for a while but always got some problems.

    I really appreciate your great work.

    Thanks.

    ReplyDelete
    Replies
    1. I really appreciate all the feedback. Feel free to send any suggestion and/or improvement.
      Regards
      Ed

      Delete
  4. is there a need to modify oratab as well so that this works?
    db01:/usr/oracle/app/product/11.2.0/dbhome_1:Y

    ReplyDelete
    Replies
    1. si es necesario, buena acotaciĆ³n, en el script tampoco es necesario levantar el listener pues este lo hace solo

      Delete
  5. Once again Great instruction thank you so much
    Afshin

    ReplyDelete
  6. this was exactly what I needed! Many thanks for the post.

    ReplyDelete
  7. Thanks for sharing your innovative ideas..Its really useful and interesting...

    Regards...

    Salesforce Developer Training in Chennai

    ReplyDelete
  8. I get a lot of great information from this blog. Thank you for your sharing this informative blog. Recently I did PHP course at a leading academy. If you are looking for best PHP Training Institute in Chennai visit FITA IT training academy which offer real timePHP Course in Chennai.

    ReplyDelete
  9. Really awesome blog. Software testing is a method of executing the application or program with the intent of searching the software errors. Testing Training in Chennai offering this course at reasonable cost.





    ReplyDelete
  10. There are lots of information about latest technology and how to get trained in them, like Big Data Training in Chennai have spread around the web, but this is a unique one according to me. The strategy you have updated here will make me to get trained in future technologies(Big Data Training Chennai). By the way you are running a great blog. Thanks for sharing this.

    ReplyDelete
  11. Hi this is Yasmin from Chennai. I am regular contributor of
    your blog. You have done really great job. Thanks for sharing this informative
    post. Keep blogging.
    Regards

    Oracle Apps Training in Chennai | Oracle Apps Training in Chennai

    ReplyDelete
  12. Thanku for sharing sharing about oracle booting..
    SAS Institute introduced the SAS Certified Professional Program,training proper understanding of how the SAS software works. Among the five certification programs that SAS Institute has come up with, SAS training can be considered as the entry point into the big data and the data analytics industry.
    SAS online training in hyderabad

    ReplyDelete
  13. This comment has been removed by the author.

    ReplyDelete
  14. This comment has been removed by the author.

    ReplyDelete
  15. It's beneficial blogs article, and I've never browser on this subject relevant topics content is really well.
    Selenium Training in Chennai
    Selenium Training Course in Chennai

    ReplyDelete
  16. You have shared useful information. Thanks for sharing your valuable knowledge with us.
    Oracle dba training | Oracle dba training syllabus

    ReplyDelete
  17. It's beneficial blogs article, and I've never browser on this subject relevant topics content is really well.


    Oracle Weblogic Server Training

    ReplyDelete
  18. Really It's A Great Pleasure reading your Article,learned a lot of new things,we have to keep on updating it,Urgent Care in Chicago.By getting them into one place.Really thanks for posting.Very Thankful for the Informative Post.Really Thanks For Posting.

    ReplyDelete
  19. Thanks For Sharing Such an Informative Post....

    Vizag Real Estate

    ReplyDelete
  20. After seeing your article I want to say that the presentation is very good and also a well-written article with some very good information which is very useful for the readers....thanks for sharing it and do share more posts like this.
    java training in chennai | java training in bangalore

    java online training | java training in pune

    java training in chennai | java training in bangalore

    ReplyDelete
  21. Really great post, I simply unearthed your site and needed to say that I have truly appreciated perusing your blog entries. I want to say thanks for great sharing.
    python training in tambaram
    python training in annanagar
    python training in Bangalore

    ReplyDelete
  22. Thanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital information. 
    DevOps online Training

    ReplyDelete
  23. Hmm, it seems like your site ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I as well as an aspiring blog writer, but I’m still new to the whole thing. Do you have any recommendations for newbie blog writers? I’d appreciate it.

    Best Selenium Training in Chennai | Selenium Training Institute in Chennai | Besant Technologies

    Selenium Training in Bangalore | Best Selenium Training in Bangalore

    AWS Training in Bangalore | Amazon Web Services Training in Bangalore

    ReplyDelete
  24. Expected to form you a next to no word to thank you once more with respect to the decent recommendations you've contributed here.
    safety courses in chennai

    ReplyDelete
  25. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    Java training in Chennai | Java training in Bangalore

    Java online training | Java training in Pune

    ReplyDelete
  26. Marvelous and fascinating article. Incredible things you've generally imparted to us. Much obliged. Simply keep making this kind out of the post.

    Oracle DBA training in Chennai
    Oracle DBA Training

    ReplyDelete

  27. When I initially commented, I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get several emails with the same comment. Is there any way you can remove people from that service? Thanks.

    AWS Training in Bangalore | Amazon Web Services Training in Bangalore

    Amazon Web Services Training in Pune | Best AWS Training in Pune

    AWS Online Training | Online AWS Certification Course - Gangboard

    Top 110 AWS Interview Question and Answers

    ReplyDelete
  28. I'm getting a lot of information from posts like these. Glad to come across such interesting and informative posts like this. Keep posting. Regards.
    Oracle DBA Training in Chennai | Oracle Apps DBA Training in Chennai | Best Oracle DBA Training in Chennai | Oracle DBA Training

    ReplyDelete
  29. It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command
    Data Science Training in Indira nagar
    Data Science Training in btm layout
    Python Training in Kalyan nagar
    Data Science training in Indira nagar
    Data Science Training in Marathahalli | Data Science training in Bangalore

    ReplyDelete
  30. Your blog information are really creative and useful for the readers.I ever read such kind of nice article yet.hope you will add more innovative ideas on your post.
    Android Training courses near me
    Android Training in Amjikarai
    Android Training in Thirumangalam
    best android training institute in bangalore with placement

    ReplyDelete
  31. Nice article i have ever read information's like this.it's really awesome the way you have delivered your ideas.i hope you will add more content in your blog.
    AWS Training in Guindy
    AWS Training in Saidapet
    AWS Certification Training in Anna nagar
    AWS Training in Ambattur

    ReplyDelete
  32. Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
    rpa training in bangalore
    best rpa training in bangalore
    rpa training in pune
    rpa online training

    ReplyDelete
  33. I really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Definitely a great post I would like to read this
    Microsoft Azure online training
    Selenium online training
    Java online training
    uipath online training
    Python online training

    ReplyDelete
  34. This is very great thinks. It was very comprehensive post and powerful concept. Thanks for your sharing with us. Keep it up..
    Oracle DBA Training in Chennai | Oracle DBA Training Institute in Chennai

    ReplyDelete
  35. I learned World's Trending Technology from certified experts for free of cost. I Got a job in decent Top MNC Company with handsome 14 LPA salary, I have learned the World's Trending Technology from Data science training in btm layout experts who know advanced concepts which can help to solve any type of Real-time issues in the field of Python. Really worth trying hkbk group of institutions

    ReplyDelete
  36. Hey Nice Blog!! Thanks For Sharing!!! Wonderful blog & good post. It is really very helpful to me, waiting for a more new post. Keep Blogging ! Here is the best angularjs training online with free Bundle videos .

    contact No :- 9885022027.
    SVR Technologies


    ReplyDelete
  37. I have to search sites with relevant information on given topic and provide them to teacher our opinion and the article.

    data analytics courses

    data science interview questions

    business analytics courses

    data science course in mumbai

    ReplyDelete
  38. This Blog Provides Very Useful and Important Information.
    AWS Training In Hyderabad

    ReplyDelete
  39. Thanks for giving great kind of information. So useful and practical for me. Thanks for your excellent blog, nice work keep it up thanks for sharing the knowledge. good jobs
    Ai & Artificial Intelligence Course in Chennai
    PHP Training in Chennai
    Ethical Hacking Course in Chennai Blue Prism Training in Chennai
    UiPath Training in Chennai

    ReplyDelete
  40. Excellent post. I learned a lot from this blog and I suggest my friends to visit your blog to learn new concept about technology.Best data science courses in hyerabad

    ReplyDelete
  41. This comment has been removed by the author.

    ReplyDelete
  42. This was incredibly an exquisite implementation of your ideas ExcelR Business Analytics Courses

    ReplyDelete
  43. I recently came across your article and have been reading along. I want to express my admiration of your writing skill and ability to make readers read from the beginning to the end. I would like to read newer posts and to share my thoughts with you.
    data science training in Hyderabad

    ReplyDelete
  44. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
    Best RPA Training in Pune

    ReplyDelete
  45. Really awesome blog!!! I finally found a great post here.I really enjoyed reading this article. Thanks for sharing valuable information.
    Point cloud to 3D Model London
    Point cloud to 3D Model
    Reverse Engineering Services in London

    ReplyDelete

  46. Great to become visiting your weblog once more, it has been a very long time for me. Pleasantly this article i've been sat tight fosuch a long time. I will require this post to add up to my task in the school, and it has identical subject along with your review. Much appreciated, great offer. data science course in nagpur

    ReplyDelete
  47. Very Informative blog thank you for sharing. Keep sharing.

    Best software training institute in Chennai. Make your career development the best by learning software courses.

    power bi training in chennai
    microsoft azure training in chennai
    Xamarin Training Course in Chennai
    Best Docker Training in Chennai

    ReplyDelete
  48. Really an awesome blog and informative content. Keep sharing more bogs with us. If you want to become a data science course training, the follow the given below link.
    Data Science Institute in Hyderabad

    ReplyDelete
  49. Get Data Science Certification from top-ranked universities UTM, Malaysia, and IBM. We provide extensive training for the future-ready workforce.
    data science training in malaysia

    ReplyDelete
  50. Hi,
    This comprehensive guide to autostarting the Oracle 11g R2 Database Server on CentOS 6.2 is incredibly useful. It simplifies a complex process, making it accessible to users. The step-by-step instructions and clear script make it easy to follow. Great job!
    Data Analytics Courses in Nashik

    ReplyDelete
  51. fantastic tutorial For anyone wishing to simplify their setup, your step-by-step instructions on autostarting the Oracle 11g R2 Database Server on CentOS 6.2 are really beneficial. I appreciate you giving your knowledge!
    Data Analytics Courses in Agra

    ReplyDelete
  52. Amazing blog!! I really loved it. You have simplified this topic so wonderfully.
    Visit - Data Analytics Courses in Delhi

    ReplyDelete
  53. good blog
    Data Analytics Courses In Vadodara

    ReplyDelete
  54. Thank you so much for providing this brief tutorial on Booting Oracle 11g R2 Database Server on CentOS 6.2. I really loved this topic. Keep posting more.
    Visit - Data Analytics Courses in Delhi

    ReplyDelete
  55. It provides clear instructions and insights to make the process seamless. A great guide for anyone looking to set up Oracle on CentOS.
    Digital marketing courses in illinois

    ReplyDelete
  56. Thanks for providing step by step guide on how to restart Oracle 11g R2 Database Server on CentOS 6.2.
    Digital Marketing Courses in Italy

    ReplyDelete
  57. This comment has been removed by the author.

    ReplyDelete
  58. Thank you for sharing fantastic tutorial on how to autostart the Oracle 11g R2 Database Server on CentOS 6.2
    Digital marketing courses in woking

    ReplyDelete