我就拿一個例子來說,用戶通常都會為了維護(hù)簡單,需要數(shù)據(jù)庫自動隨系統(tǒng)啟動,一句非常簡單的話,但是拿給DBA來說至少得多花半個小
俗話說用戶是上帝,他們有時候提出一個問題非常的簡單,就只需要一句話,一分鐘就完事了,但是拿到我們DBA來說,可能至少得半個小時甚至半個月才能滿足他的一句話,有沒有更好更快的辦法呢,我告訴大家這是有的;
我就拿一個例子來說,用戶通常都會為了維護(hù)簡單,需要數(shù)據(jù)庫自動隨系統(tǒng)啟動,一句非常簡單的話,但是拿給DBA來說至少得多花半個小時的時間來配置實現(xiàn)這個功能。那么今天你看完這篇文檔之后,可以在他的話還沒有說完就可以完成自啟動的配置,非常簡單。
一、配置自動
1、添加啟動項 su - Oracle -c "lsnrctl start" [root@db01 ~]# cat > /home/oracle/.script/.startup < 二、重啟驗證: 三、確定數(shù)據(jù)庫和EM以及監(jiān)聽是否都已經(jīng)起來 ###監(jiān)聽狀態(tài) LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 03-OCT-2014 07:26:22 Copyright (c) 1991, 2011, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) INSTANCE_N HOST_NAME STATUS 至此我們已經(jīng)確定,這樣也可以將數(shù)據(jù)庫配置為自動啟動,且比Oralce推薦的老方法更為簡單,老方法見如下鏈接: Linux 下 Oracle隨系統(tǒng)自動啟動和關(guān)閉(老方法) Oracle 11g 在RedHat Linux 5.8_x64平臺的安裝手冊 Linux-6-64下安裝Oracle 12C筆記 在CentOS 6.4下安裝Oracle 11gR2(x64) Oracle 11gR2 在VMWare虛擬機中安裝步驟 Debian 下 安裝 Oracle 11g XE R2 本文永久更新鏈接地址:
[root@db01 ~]# cat >> /etc/rc.d/rc.local <
su - oracle -c "sqlplus sys/oracle as sysdba @/home/oracle/.script/.startup"
su - oracle -c "emctl start dbconsole"
EOF
2、創(chuàng)建并編輯啟動文件
[root@db01 ~]#su - oracle
[root@db01 ~]#mkdir -p /home/oracle/.script/
alter system register;
exit 0
EOF
[oracle@db01 ~]$ lsnrctl status
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 03-OCT-2014 07:13:54
Uptime 0 days 0 hr. 12 min. 28 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /DBSoft/Product/11.2.3/db_1/network/admin/listener.ora
Listener Log File /DBSoft/diag/tnslsnr/db01/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db01)(PORT=1521)))
Services Summary...
Service "woo" has 1 instance(s).
Instance "woo", status READY, has 1 handler(s) for this service...
Service "wooXDB" has 1 instance(s).
Instance "woo", status READY, has 1 handler(s) for this service...
The command completed successfully
###數(shù)據(jù)庫狀態(tài)
SQL> select instance_name,host_name,status from v$instance;
---------- ---------- ------------
woo db01 OPEN
###EM狀態(tài)
[oracle@db01 ~]$ emctl status dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
https://db01:1158/em/console/aboutApplication
Oracle Enterprise Manager 11g is running.
------------------------------------------------------------------
Logs are generated in directory /DBSoft/Product/11.2.3/db_1/db01_woo/sysman/log
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com