日期:2014-05-16 浏览次数:20622 次
一
启动电脑,到登陆界面,电脑报有个服务启动失败,电脑没有新装软件,周六还没有问题,怎么突然报这个错误?于是到事件查看器中看看什么问题,显示是OracleDBConsoleorcl启动失败,到服务里一看,确实没有启动。手动启动一下,报错误码2
我装的是10g,于是到ORACLEproduct10.2.0db_1test_orclsysmanlog目录看一下log里写了什么,打开OracleDBConsoleorclsrvc.log.
log最后记录的是:
————–
[OracleDBConsoleorcl]
————
EMDROOT=c:oracleproduct10.2.0db_1
ORACLE_HOME=c:oracleproduct10.2.0db_1
EMDSTATE=c:oracleproduct10.2.0db_1wangzh_orcl
CONSOLE_CFG=dbconsole
TRACE_LEVEL=16
TIMEOUT=15
12/10/07
10:56:03 Start pending…
12/10/07 10:56:03 Verifying dbconsole is not
started already. Command line
"c:oracleproduct10.2.0db_1binemctl.bat" istatus
dbconsole
12/10/07 10:56:04 dbconsole launch commandline is
"c:oracleproduct10.2.0db_1binemctl.bat" istart
dbconsole
12/10/07 10:56:04 Tracking process
launch…
12/10/07 10:56:34 dbconsole exited with retCode
2.
12/10/07 10:56:34 Check
c:oracleproduct10.2.0db_1test_orclsysmanlogemdbconsole.nohup
for
details
日志让看emdbconsole.nohup文件,目录里没有这个文件呀。
手动执行一下emctl.bat,于是启动控制台,执行emctl.bat
istart
dbconsole,报错,ORACLE_SID没有定义,打开emctl.bat看看,这里是定义环境变量的地方,其中已经设置了这些:
if
not defined REMOTE_EMDROOT (set
ORACLE_HOME=Ec:oracleproduct10.2.0db_1)
if not defined
REMOTE_EMDROOT (set EMDROOT=%ORACLE_HOME%)
if defined
REMOTE_EMDROOT (set ORACLE_HOME=%REMOTE_EMDROOT%)
if defined
REMOTE_EMDROOT (set EMDROOT=%ORACLE_HOME%)
if defined
REMOTE_EMDROOT (set
LOCAL_EMDROOT=c:oracleproduct10.2.0db_1)
……
后边还有一条设置:
if
not defined DBCONSOLE_SERVICE_NAME (set
DBCONSOLE_SERVICE_NAME=OracleDBConsole%ORACLE_SID%),用到了ORACLE_SID,但没有看到前面设置,只能手动设置ORACLE_SID试试,于是加了一条设置:
if
defined REMOTE_EMDROOT (set ORACLE_SID=orcl)
orcl是我的数据库实例名
到服务中启动OracleDBConsoleorcl,ok,没有报错;
重新启动计算机,也没有报错,OracleDBConsoleorcl服务也启动了。
二
今天机器死机了,然后OracleDBConsoleORCL服务就起不来了,在一阵瞎搞后,还终于被我找到了解决办法,方法如下: 运行Database Configuration Assistant程序,选择“配置数据库选项”重新配置Database Control 配置工具,配置完后端口号会变(我原来是1158,后来被改为5500),可以在.\oracle\product\10.2.0\db_1\cfgtoollogs\emca\orcl\文件夹下,最后生成的一个日志文件下找到新的Database Control 的URL;运行即可。 ******************************************************************************************************** (原来经常改IP会导致OracleDBConsoleORCL无法启动,)一下是正规的解决方案: 修改你的主机参数文件
修改一下:
C:\WINDOWS\system32\drivers\etc下的host文件. 如果没有的话就自己加一个IP和你的计算机名对应,如果已有了就把你的IP地址和你的计算机名对应起来. 如: # copyright (c) 1993-1999 microsoft corp. # # this is a sample hosts file used by microsoft tcp/ip for windows. # # this file contains the mappings of ip addresses to host names. each # entry should be kept on an individual line. the ip address should # be placed in the first column followed by the corresponding host name. # the ip address and the host name should be separated by at least one # space. # # additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # for example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host 127.0.0.1 localhost 192.168.1.104 wang-decjedi4h9 |
三
手工从cmd命令行启动:
C:\Documents and Settings\wangnc>emctl start dbconsole
Environment variable
ORACLE_SID not defined. Please define it.