判斷oracle是否啟動

gholay發表於2013-12-29
判斷oracle是否啟動:
方法一. 通過linux命令判斷
ps -ef|grep ora
如果檢視得到oracle相關程式,一般認定為已經啟動了。
[root@gl ~]# ps -ef|grep ora
root      3630  3587  0 05:10 ?        00:00:14 hald-addon-storage: polling /dev/hdc
oracle    4038     1  0 11:43 ?        00:00:02 ora_vkrm_DB11G
oracle    4467 12570  1 11:44 ?        00:00:49 /data/oracle/jdk/bin/java -server -Xmx192M -XX:MaxPermSize=200M -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -DORACLE_HOME=/data/oracle -Doracle.home=/data/oracle/oc4j -Doracle.oc4j.localhome=/data/oracle/gl.localdomain_DB11G/sysman -DEMSTATE=/data/oracle/gl.localdomain_DB11G -Doracle.j2ee.dont.use.memory.archive=true -Djava.protocol.handler.pkgs=HTTPClient -Doracle.security.jazn.config=/data/oracle/oc4j/j2ee/OC4J_DBConsole_gl.localdomain_DB11G/config/jazn.xml -Djava.security.policy=/data/oracle/oc4j/j2ee/OC4J_DBConsole_gl.localdomain_DB11G/config/java2.policy -Djavax.net.ssl.KeyStore=/data/oracle/sysman/config/OCMTrustedCerts.txt-Djava.security.properties=/data/oracle/oc4j/j2ee/home/config/jazn.security.props -DEMDROOT=/data/oracle/gl.localdomain_DB11G -Dsysman.md5password=true -Drepapi.oracle.home=/data/oracle -Ddisable.checkForUpdate=true -Doracle.sysman.ccr.ocmSDK.websvc.keystore=/data/oracle/jlib/emocmclnt.ks -Dice.pilots.html4.ignoreNonGenericFonts=true -Djava.awt.headless=true -jar /data/oracle/oc4j/j2ee/home/oc4j.jar -config /data/oracle/oc4j/j2ee/OC4J_DBConsole_gl.localdomain_DB11G/config/server.xml
oracle    4638     1  0 05:24 ?        00:00:03 /data/oracle/bin/tnslsnr LISTENER -inherit
oracle    4696     1  0 11:45 ?        00:00:00 oracleDB11G (LOCAL=NO)
oracle    4703     1  0 11:45 ?        00:00:04 oracleDB11G (LOCAL=NO)
oracle    4755     1  0 05:26 ?        00:00:09 ora_pmon_DB11G
oracle    4757     1  0 05:26 ?        00:00:12 ora_vktm_DB11G
oracle    4759     1  0 11:46 ?        00:00:01 oracleDB11G (LOCAL=NO)
oracle    4761     1  0 05:26 ?        00:00:00 ora_gen0_DB11G
oracle    4763     1  0 05:26 ?        00:00:00 ora_diag_DB11G
oracle    4765     1  0 05:26 ?        00:00:00 ora_dbrm_DB11G
oracle    4766     1  0 11:46 ?        00:00:05 oracleDB11G (LOCAL=NO)
oracle    4767     1  0 05:26 ?        00:00:01 ora_psp0_DB11G
oracle    4769     1  0 05:26 ?        00:00:17 ora_dia0_DB11G
oracle    4771     1  0 05:26 ?        00:00:01 ora_mman_DB11G
oracle    4773     1  0 05:26 ?        00:00:06 ora_dbw0_DB11G
oracle    4775     1  0 05:26 ?        00:00:11 ora_lgwr_DB11G
oracle    4777     1  0 05:26 ?        00:00:09 ora_ckpt_DB11G
oracle    4779     1  0 05:26 ?        00:00:10 ora_smon_DB11G
oracle    4781     1  0 05:26 ?        00:00:00 ora_reco_DB11G
oracle    4783     1  0 05:26 ?        00:00:08 ora_mmon_DB11G
oracle    4785     1  0 05:26 ?        00:00:03 ora_mmnl_DB11G
oracle    4787     1  0 05:26 ?        00:00:00 ora_d000_DB11G
oracle    4789     1  0 05:26 ?        00:00:00 ora_s000_DB11G
oracle    4815     1  0 05:26 ?        00:00:00 ora_arc0_DB11G
oracle    4818     1  0 05:26 ?        00:00:05 ora_arc1_DB11G
oracle    4820     1  0 05:26 ?        00:00:00 ora_arc2_DB11G
oracle    4822     1  0 05:26 ?        00:00:00 ora_arc3_DB11G
oracle    4823     1  0 11:46 ?        00:00:00 oracleDB11G (LOCAL=NO)
oracle    4827     1  0 05:27 ?        00:00:00 ora_qmnc_DB11G
oracle    4831     1  0 05:27 ?        00:00:00 ora_q000_DB11G
oracle    4833     1  0 05:27 ?        00:00:01 ora_q001_DB11G
oracle    4849     1  0 05:27 ?        00:00:09 ora_cjq0_DB11G
oracle    5387     1  0 05:32 ?        00:00:00 ora_smco_DB11G
oracle    6070     1  0 12:03 ?        00:00:00 ora_w000_DB11G
oracle    9039     1  0 12:44 ?        00:00:00 oracleDB11G (LOCAL=NO)
root      9342  9312  0 12:47 pts/2    00:00:00 su - oracle
oracle    9343  9342  0 12:47 pts/2    00:00:00 -bash
oracle    9515     1  0 12:49 ?        00:00:00 ora_j000_DB11G
oracle    9517     1  0 12:49 ?        00:00:00 ora_j001_DB11G
oracle    9585 12570  0 12:50 ?        00:00:00 sh -c /data/oracle/bin/emdctl status agent  300 >/dev/null 2>&1
oracle    9586  9585  9 12:50 ?        00:00:00 /data/oracle/bin/emdctl status agent 300
oracle   12570     1  0 06:45 ?        00:00:05 /data/oracle/perl/bin/perl /data/oracle/bin/emwd.pl dbconsole /data/oracle/gl.localdomain_DB11G/sysman/log/emdb.nohup
oracle   12599 12570  0 06:45 ?        00:00:34 /data/oracle/bin/emagent
oracle   12621     1  0 06:45 ?        00:00:21 oracleDB11G (LOCAL=NO)
oracle   12867     1  0 06:45 ?        00:00:09 oracleDB11G (LOCAL=NO)
oracle   14843     1  0 07:03 ?        00:00:08 oracleDB11G (LOCAL=NO)
oracle   14991     1  0 07:03 ?        00:00:18 oracleDB11G (LOCAL=NO)
oracle   15089     1  0 07:03 ?        00:00:00 oracleDB11G (LOCAL=NO)
oracle   15108     1  0 07:03 ?        00:00:00 oracleDB11G (LOCAL=NO)
oracle   15110     1  0 07:03 ?        00:00:00 oracleDB11G (LOCAL=NO)
root     21496 21466  0 08:27 pts/4    00:00:00 su - oracle
oracle   21497 21496  0 08:27 pts/4    00:00:00 -bash
oracle   21534 21497  0 08:28 pts/4    00:00:03 sqlplus       
oracle   21536 21534  0 08:28 ?        00:00:01 oracleDB11G (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle   23936     1  0 09:00 ?        00:00:05 oracleDB11G (LOCAL=NO)
[root@gl ~]# 

方法二,通過檢視監聽來判斷

[oracle@gl ~]$ lsnrctl status


LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 29-DEC-2013 12:48:03


Copyright (c) 1991, 2009, Oracle.  All rights reserved.


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=gl.localdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                28-DEC-2013 13:23:09
Uptime                    0 days 23 hr. 24 min. 54 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /data/oracle/network/admin/listener.ora
Listener Log File         /data/diag/tnslsnr/gl/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=gl.localdomain)(PORT=1521)))
Services Summary...
Service "DB11G" has 1 instance(s).
  Instance "DB11G", status READY, has 1 handler(s) for this service...
Service "DB11GXDB" has 1 instance(s).
  Instance "DB11G", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@gl ~]$ 

如上可以看出,已經有一個例項“DB11G”狀態已經為ready狀態了,說明已經啟動。



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29196873/viewspace-1065376/,如需轉載,請註明出處,否則將追究法律責任。

相關文章