{"id":1020,"date":"2012-08-15T15:44:00","date_gmt":"2012-08-15T07:44:00","guid":{"rendered":"http:\/\/rmohan.com\/?p=1020"},"modified":"2012-08-15T15:44:00","modified_gmt":"2012-08-15T07:44:00","slug":"oracle-startpup-script","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=1020","title":{"rendered":"Oracle Startpup script"},"content":{"rendered":"<div>Oracle Startup script used for Automatic start up of oracle db after rebooting the machine. I have already explained how to install oracle 11g in previous posts and just note how to add a startup script with respect to that settings<\/p>\n<p>For automatically restart the oracle after system reboot\u00a0 create a file called oracle ( any name ) in \/etc\/init.d\/ and give executable permission and paste the code into it. And make a link to \/etc\/rc5.d\/\u00a0 for that<\/p>\n<p># cd \/etc\/rc5.d<br \/>\n# ll<br \/>\n# ln -s ..\/init.d\/oracle S86oracle<\/p>\n<div># vim \/etc\/init.d\/oracle &#8212;&#8211; and paste the below script into it. and then make the above link into it.<\/div>\n<\/div>\n<div># Oracle Startpup script<\/div>\n<div>ORACLE_HOME=\/home\/oracle\/app\/oracle\/product\/11.2.0\/dbhome_1<br \/>\nORA_OWNER=oracle<br \/>\ncase &#8220;$1&#8221; in<br \/>\n&#8216;start&#8217;) #If the system is starting, then&#8230;<br \/>\necho -e &#8220;\\e[34mStarting ORACLE&#8230;\\e[0m&#8221;<\/div>\n<div>#Start the listener<br \/>\nsu &#8211; $ORA_OWNER -c &#8220;$ORACLE_HOME\/bin\/lsnrctl start 2&gt;&amp;1&gt; \/dev\/null&#8221;<\/div>\n<div>\n<div>#Start the database<\/div>\n<div>\u00a0\u00a0\u00a0\u00a0 su &#8211; $ORA_OWNER -c &#8220;$ORACLE_HOME\/bin\/dbstart 2&gt;&amp;1 &gt; \/dev\/null&#8221;<br \/>\n#\u00a0 su &#8211; $ORA_OWNER -c &#8220;$ORACLE_HOME\/bin\/emctl start dbconsole 2&gt;&amp;1 &gt; \/dev\/null&#8221; #Start OEM<br \/>\n;;<br \/>\n&#8216;stop&#8217;)\u00a0\u00a0 #If the system stops, that is we&#8217;re shutting down our OS, then&#8230;<br \/>\necho -e &#8220;\\e[34mStopping ORACLE&#8230;\\e[0m&#8221;<br \/>\n#\u00a0 su &#8211; $ORA_OWNER -c &#8220;$ORACLE_HOME\/bin\/emctl stop dbconsole 2&gt;&amp;1 &gt; \/dev\/null&#8221;<br \/>\nsu &#8211; $ORA_OWNER -c &#8220;$ORACLE_HOME\/bin\/dbshut 2&gt;&amp;1 &gt; \/dev\/null&#8221;<br \/>\nsu &#8211; $ORA_OWNER -c &#8220;$ORACLE_HOME\/bin\/lsnrctl stop 2&gt;&amp;1 &gt; \/dev\/null&#8221;<br \/>\n;;<br \/>\nesac<\/div>\n<div><strong>OR<\/strong><\/p>\n<p><strong>\u00a0<\/strong># Oracle Startpup script<\/div>\n<div><\/div>\n<div>ORACLE_HOME=\/home\/oracle\/oracle\/product\/10.2.0\/db_1<br \/>\nORA_OWNER=oracle<br \/>\ncase &#8220;$1&#8221; in<br \/>\n&#8216;start&#8217;) #If the system is starting, then&#8230;<br \/>\necho -e &#8220;e[34mStarting ORACLE&#8230;e[0m&#8221;<br \/>\nsu &#8211; $ORA_OWNER -c &#8220;$ORACLE_HOME\/bin\/lsnrctl start 2&gt;&amp;1&gt; \/dev\/null&#8221;<br \/>\n#Start the listener<br \/>\nsu &#8211; $ORA_OWNER -c &#8220;$ORACLE_HOME\/bin\/dbstart 2&gt;&amp;1 &gt; \/dev\/null&#8221;<br \/>\n#Start the database<br \/>\nsu &#8211; $ORA_OWNER -c &#8220;$ORACLE_HOME\/bin\/emctl start dbconsole 2&gt;&amp;1 &gt;<br \/>\n\/dev\/null&#8221; #Start<br \/>\nOEM<br \/>\n;;<br \/>\n&#8216;stop&#8217;) #If the system is stops, that is we&#8217;re shutting down our OS,<br \/>\nthen&#8230;<br \/>\necho Oracle startup script<br \/>\nORACLE_HOME=\/home\/oracle\/oracle\/product\/10.2.0\/db_1<br \/>\nORA_OWNER=oracle<br \/>\ncase &#8220;$1&#8221; in<br \/>\n&#8216;start&#8217;) #If the system is starting, then&#8230;<br \/>\necho -e &#8220;e[34mStarting ORACLE&#8230;e[0m&#8221;<br \/>\nsu &#8211; $ORA_OWNER -c &#8220;$ORACLE_HOME\/bin\/lsnrctl start 2&gt;&amp;1&gt; \/dev\/null&#8221;<br \/>\n#Start the listener<br \/>\nsu &#8211; $ORA_OWNER -c &#8220;$ORACLE_HOME\/bin\/dbstart 2&gt;&amp;1 &gt; \/dev\/null&#8221;<br \/>\n#Start the database<br \/>\nsu &#8211; $ORA_OWNER -c &#8220;$ORACLE_HOME\/bin\/emctl start dbconsole 2&gt;&amp;1 &gt;<br \/>\n\/dev\/null&#8221; #Start<br \/>\nOEM<br \/>\n;;<br \/>\n&#8216;stop&#8217;) #If the system is stops, that is we&#8217;re shutting down our OS,<br \/>\nthen&#8230;<br \/>\necho -e &#8220;e[34mStopping ORACLE&#8230;e[0m&#8221;<br \/>\nsu &#8211; $ORA_OWNER -c &#8220;$ORACLE_HOME\/bin\/emctl stop dbconsole 2&gt;&amp;1 &gt;<br \/>\n\/dev\/null&#8221;<br \/>\nsu &#8211; $ORA_OWNER -c &#8220;$ORACLE_HOME\/bin\/dbshut 2&gt;&amp;1 &gt; \/dev\/null&#8221;<br \/>\nsu &#8211; $ORA_OWNER -c &#8220;$ORACLE_HOME\/bin\/lsnrctl stop 2&gt;&amp;1 &gt; \/dev\/null&#8221;<br \/>\n;;<br \/>\nesac<br \/>\n-e &#8220;e[34mStopping ORACLE&#8230;e[0m&#8221;<br \/>\nsu &#8211; $ORA_OWNER -c &#8220;$ORACLE_HOME\/bin\/emctl stop dbconsole 2&gt;&amp;1 &gt;<br \/>\n\/dev\/null&#8221;<br \/>\nsu &#8211; $ORA_OWNER -c &#8220;$ORACLE_HOME\/bin\/dbshut 2&gt;&amp;1 &gt; \/dev\/null&#8221;<br \/>\nsu &#8211; $ORA_OWNER -c &#8220;$ORACLE_HOME\/bin\/lsnrctl stop 2&gt;&amp;1 &gt; \/dev\/null&#8221;<br \/>\n;;<br \/>\nesac<\/div>\n<\/div>\n<div><\/div>\n<p>&nbsp;<\/p>\n<div>Change the path according to your path<\/div>\n<div><\/div>\n<div>Save the file as oracle in \/etc\/init.d directory and make it executable. This script starts the listener, database and enterprise manager.<\/div>\n<p># vim \/etc\/init.d\/oracle<br \/>\n# chmod 755 \/etc\/init.d\/oracle<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Oracle Startup script used for Automatic start up of oracle db after rebooting the machine. I have already explained how to install oracle 11g in previous posts and just note how to add a startup script with respect to that settings<\/p>\n<p>For automatically restart the oracle after system reboot create a file called oracle ( [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1020"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1020"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1020\/revisions"}],"predecessor-version":[{"id":1021,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1020\/revisions\/1021"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1020"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1020"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}