oracle啟動腳本

在linux下配置oracle自動啟動腳本:

孝義網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián),孝義網(wǎng)站設(shè)計制作,有大型網(wǎng)站制作公司豐富經(jīng)驗。已為孝義成百上千提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\外貿(mào)網(wǎng)站制作要多少錢,請找那個售后服務(wù)好的孝義做網(wǎng)站的公司定做!

[root@test ~]# vim /etc/init.d/oracle
#!/bin/bash
#chkconfig:35 99 01
case "$1" in
        start)
                echo -e "\n\t\t `date +%F` `date +%T`"
                echo -e "\t\t 正在啟動lsnrctl start...."
                su - oracle -c 'lsnrctl start' &>>/var/log/oracle
                echo -e "\t\t 正在啟動dbstart...."
                su - oracle -c 'dbstart' &>>/var/log/oracle
                echo -e "\t\t 正在啟動emctl start dbconsole...."
                su - oracle -c 'emctl start dbconsole' &>>/var/log/oracle
                echo -e "\t\t\t 啟動成功?。?
                echo -e "\t\t `date +%F` `date +%T`\n"
          ;;
        stop)
                echo -e "\n\t\t `date +%F` `date +%T`"
                echo -e "\t\t 正在關(guān)閉emctl stop dbconsole...."
                su - oracle -c 'emctl stop dbconsole' &>>/var/log/oracle
                echo -e "\t\t 正在關(guān)閉dbshut...."
                su - oracle -c 'dbshut' &>>/var/log/oracle
                echo -e "\t\t 正在關(guān)閉lsnrctl stop...."
                su - oracle -c 'lsnrctl stop' &>>/var/log/oracle
                echo -e "\t\t\t 關(guān)閉完畢??!"
                echo -e "\t\t `date +%F` `date +%T`\n"
         ;;
          *)
                echo -e "\n\t\t Usage:oracle{start|stop} 該服務(wù)暫時只添加了啟動|關(guān)閉\n"
         ;;
esac
[root@test ~]# chmod a+x /etc/init.d/oracle 
[root@test ~]# ll /etc/init.d/oracle
-rwxr-xr-x 1 root root 1012 10月 16 23:38 /etc/init.d/oracle
[root@test ~]# chkconfig --add oracle
[root@test ~]# chkconfig --list oracle
oracle          0:關(guān)閉 1:關(guān)閉 2:關(guān)閉 3:啟用 4:關(guān)閉 5:啟用 6:關(guān)閉
[root@test ~]# service oracle stop
   2015-10-17 09:11:04
   正在關(guān)閉emctl stop dbconsole....
   正在關(guān)閉dbshut....
   正在關(guān)閉lsnrctl stop....
    關(guān)閉完畢??!
   2015-10-17 09:12:30
[root@test ~]# service oracle stll
   Usage:oracle{start|stop} 該服務(wù)暫時只添加了啟動|關(guān)閉
[root@test ~]# service oracle start
   2015-10-17 09:12:41
   正在啟動lsnrctl start....
   正在啟動dbstart....
   正在啟動emctl start dbconsole....
    啟動成功!!
   2015-10-17 09:18:47
[root@test ~]# su - oracle
[oracle@test ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sat Oct 17 09:20:15 2015
Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select status from v$instance;
STATUS
------------
OPEN
SQL>

——————————————————————————————————

#description:auto_run    //用linux5版本做實驗時,oracle啟動腳本中需要添加才能在chkconfig中添加oracle服務(wù),否則會報服務(wù)不支持

網(wǎng)頁標題:oracle啟動腳本
網(wǎng)頁路徑:http://bm7419.com/article2/pscpoc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)建站、建站公司、商城網(wǎng)站、App開發(fā)、網(wǎng)站建設(shè)、網(wǎng)站設(shè)計公司

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

營銷型網(wǎng)站建設(shè)