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!

113 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. 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
  27. 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
  28. 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
  29. 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
  30. 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
  31. 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
  32. 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
  33. 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
  34. 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
  35. 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
  36. 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
  37. This Blog Provides Very Useful and Important Information.
    AWS Training In Hyderabad

    ReplyDelete
  38. 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
  39. 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
  40. This comment has been removed by the author.

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

    ReplyDelete
  42. 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
  43. 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
  44. 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

  45. 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
  46. 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
  47. 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
  48. 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
  49. 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
  50. 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
  51. Amazing blog!! I really loved it. You have simplified this topic so wonderfully.
    Visit - Data Analytics Courses in Delhi

    ReplyDelete
  52. good blog
    Data Analytics Courses In Vadodara

    ReplyDelete
  53. 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
  54. 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
  55. 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
  56. This comment has been removed by the author.

    ReplyDelete
  57. 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
  58. This is the best article I've been through today and it need to be appreciated because of its and patience. Thank you for the information.
    Data science courses in Ghana

    ReplyDelete
  59. This blog offers a clear and practical guide for autostarting Oracle 11g R2 on CentOS 6.2. The step-by-step instructions are well-organized and make the process easy to follow. Great job on providing a useful solution with detailed explanations and commands
    data analytics courses in dubai

    ReplyDelete
  60. Great guide for setting up Oracle 11g R2 on CentOS! Clear instructions like these help make complex installations easier. Keep sharing such valuable content!
    Data Science Courses in Singapore

    ReplyDelete
  61. This is a comprehensive guide on booting the Oracle 11g R2 Database Server on CentOS 6.2. Setting up the init.d script for autostarting the database components is a smart move to ensure everything runs smoothly after a reboot. It’s great to see detailed steps for starting, stopping, and checking the status of the database. For anyone interested in data analytics, don't forget to check out the courses offered in Ghana by IIM Skills. They provide valuable insights and training that can complement your database management skills! Data Analytics Courses in Ghana

    ReplyDelete
  62. This blog provides a clear and practical guide to autostarting the Oracle 11g R2 Database Server on CentOS 6.2. It outlines the steps to create and configure an init.d script that controls the Oracle services (listener, database, and enterprise manager).

    The script ensures that these components are properly started and stopped as Linux daemons, with instructions for setting the correct permissions, manually testing the script, and configuring it to start at boot using chkconfig.

    Overall, it's a concise and effective guide for automating the startup of Oracle services on CentOS, making server management simpler.
    data analytics courses in dubai

    ReplyDelete
  63. Great article! The information about data science courses is very relevant. I can’t wait to check out these data science courses in Faridabad to enhance my skills. Thanks for the resource!

    ReplyDelete

  64. Great job sharing this detailed guide on booting Oracle 11g R2 on CentOS! Your insights make complex database setups more approachable for others. Keep up the excellent work in simplifying technical processes!
    Data Science Courses in Singapore

    ReplyDelete
  65. Incredible insights! Your writing always leaves me inspired.

    Data science courses in Gujarat

    ReplyDelete
  66. This blog post provides a clear and concise guide to booting the Oracle 11g R2 database server. The step-by-step instructions are easy to follow, making it an excellent resource for both beginners and experienced users. The author's expertise shines through, and the inclusion of troubleshooting tips adds great value. Overall, a very informative and helpful read for anyone working with Oracle databases. Great job!

    data analytics courses in dubai

    ReplyDelete
  67. Great article about oracle booting. Well explained with details. Am sure will help many software and server professionals. I gained much insight about the topic. Thank you for sharing such an informative article.
    Data science courses in Kochi

    ReplyDelete
  68. I appreciate the clarity and depth you’ve provided. Keep up the great work!
    Data science courses in Bhutan

    ReplyDelete
  69. I found Booting Oracle 11g R2 Dtabase Server article incredibly informative! You covered all the key points in a concise yet detailed manner. I feel much more knowledgeable after reading it. Great content.
    Online Data Science Course


    ReplyDelete
  70. "This post about the Data Science Course in Dadar is fantastic!
    The curriculum appears to be comprehensive and up-to-date.
    I love that it emphasizes practical skills and applications.
    Such local courses make it easier for aspiring data scientists.
    I’m eager to learn more about registration!"

    ReplyDelete
  71. "I’m really excited about the Data Science Course in Dadar!
    The course structure looks thorough and well-organized.
    I appreciate the emphasis on hands-on projects that enhance learning.
    It’s great to have such valuable resources available locally.
    I’ll definitely be exploring enrollment options!"

    ReplyDelete
  72. This is a clear and concise guide on how to set up Oracle 11g R2 to automatically start on CentOS 6.2. The step-by-step instructions make it easy to follow, from creating the init script to using chkconfig to ensure the services are configured properly. The use of the Oracle daemons—listener, database, and enterprise manager—ensures that the database services start and stop cleanly with the system. Great guide for anyone managing Oracle databases on a Linux server! Rebooting after configuration and seeing everything work smoothly is always satisfying. Thanks for sharing!
    Data science courses in Mysore

    ReplyDelete
  73. This post has inspired me to rethink my approach to certain aspects of my life. Your insights have prompted some much-needed reflection

    Data science courses in Mumbai

    ReplyDelete
  74. The post on Eduardo Lago's blog about booting the Oracle 11g R2 database server is very informative! It provides clear instructions and troubleshooting tips for database administrators. The detailed steps help demystify the process, making it easier for users to manage their Oracle environments effectively. Thanks for sharing such valuable information!

    Data science courses in Bangalore.

    ReplyDelete
  75. Booting an Oracle 11g R2 Database Server on CentOS 6.2 involves initializing Oracle services and ensuring proper configurations. To start, verify that Oracle environment variables, such as ORACLE_HOME and ORACLE_SID, are correctly set. Proper configuration and system run-level settings will help streamline the Oracle booting process.
    Thank you for blog.
    Data science Courses in Germany

    ReplyDelete