{"id":3364,"date":"2016-08-20T08:53:48","date_gmt":"2016-08-20T06:53:48","guid":{"rendered":"https:\/\/adrhc.go.ro\/wordpress\/?p=3364"},"modified":"2016-09-02T14:47:03","modified_gmt":"2016-09-02T12:47:03","slug":"ubuntu-and-oracle","status":"publish","type":"post","link":"https:\/\/adrhc.go.ro\/blog\/ubuntu-and-oracle\/","title":{"rendered":"Ubuntu and Oracle"},"content":{"rendered":"<pre class=\"brush:bash shell;toolbar: false\">\r\n# see also https:\/\/wiki.centos.org\/HowTos\/Oracle12onCentos7\r\n# see also https:\/\/adrhc.go.ro\/wordpress\/centos-and-oracle\/\r\n\r\n# Follow this (works with Ubuntu 16.04 too):\r\n# http:\/\/www.techienote.com\/install-oracle-12c-on-ubuntu\/\r\n\r\n# systemd oracle.service (working when only one db is automatically started with \/etc\/oratab)\r\n[Unit]\r\nDescription=Oracle 12c\r\nAfter=local-fs.target\r\nWants=local-fs.target\r\n\r\n[Service]\r\nType=forking\r\n\r\nUser=oracle\r\nGroup=oinstall\r\n\r\nRuntimeDirectory=oracle\r\nPIDFile=\/run\/oracle\/oracle.pid\r\n\r\nRestart=on-failure\r\nRestartSec=3\r\n\r\nTimeoutSec=0\r\n\r\nExecStart=\/u01\/app\/oracle\/product\/12.1.0\/dbhome_1\/bin\/dbstart \/u01\/app\/oracle\/product\/12.1.0\/dbhome_1\r\nExecStop=\/u01\/app\/oracle\/product\/12.1.0\/dbhome_1\/bin\/dbshut \/u01\/app\/oracle\/product\/12.1.0\/dbhome_1\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n\r\n# modify dbstart and dbshut in order to create \/run\/oracle\/oracle.pid needed by oracle.service\r\n# \/u01\/app\/oracle\/product\/12.1.0\/dbhome_1\/bin\/dbstart\r\nstartinst() {\r\n...\r\n      if [ $? -eq 0 ] ; then\r\n        echo \"\" \r\n\t\tOS_PID=$(sqlplus -S \/ AS SYSDBA &lt;&lt;EOF\r\nselect SPID from v\\$process where PNAME = 'PMON';\r\nEOF\r\n)\r\n\t\tOS_PID=$(echo \"$OS_PID\" | \/bin\/grep -P \"\\d+\")\r\n        echo \"$0: ${INST} \\\"${ORACLE_SID}\\\" warm started (PID $OS_PID).\" \r\n\t\tif [ -d \/run\/oracle ]; then\r\n\t\t\techo \"$OS_PID\" > \/run\/oracle\/oracle.pid\r\n\t\t\techo \"created \/run\/oracle\/oracle.pid\"\r\n\t\tfi\r\n      else\r\n        $LOGMSG \"\" \r\n        $LOGMSG \"Error: ${INST} \\\"${ORACLE_SID}\\\" NOT started.\" \r\n      fi\r\n# \/u01\/app\/oracle\/product\/12.1.0\/dbhome_1\/bin\/dbshut\r\n  if test $? -eq 0 ; then\r\n\tif [ -f \/run\/oracle\/oracle.pid ]; then\r\n\t\t# see \/u01\/app\/oracle\/product\/12.1.0\/dbhome_1\/bin\/dbstart\r\n\t\trm -fv \/run\/oracle\/oracle.pid\r\n\tfi\r\n    echo \"${INST} \\\"${ORACLE_SID}\\\" shut down.\"\r\n  else\r\n    echo \"${INST} \\\"${ORACLE_SID}\\\" not shut down.\"\r\n  fi\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p># see also https:\/\/wiki.centos.org\/HowTos\/Oracle12onCentos7 # see also https:\/\/adrhc.go.ro\/wordpress\/centos-and-oracle\/ # Follow this (works with Ubuntu 16.04 too): # http:\/\/www.techienote.com\/install-oracle-12c-on-ubuntu\/ # systemd oracle.service (working when only one db is automatically started with \/etc\/oratab) [Unit] Description=Oracle 12c After=local-fs.target Wants=local-fs.target [Service] Type=forking User=oracle Group=oinstall [&hellip;]<\/p>\n<div class=\"link-more\"><a href=\"https:\/\/adrhc.go.ro\/blog\/ubuntu-and-oracle\/#more-3364\" class=\"more-link\">Continue reading &#10142; <span class=\"screen-reader-text\">Ubuntu and Oracle<\/span><\/a><\/div>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,12,8,11,33],"tags":[],"class_list":["post-3364","post","type-post","status-publish","format-standard","hentry","category-configuration","category-database","category-howto","category-linux","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/3364","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/comments?post=3364"}],"version-history":[{"count":0,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/3364\/revisions"}],"wp:attachment":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/media?parent=3364"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/categories?post=3364"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/tags?post=3364"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}