一、常见错误 二、配置示例 三、常用命令
oracle11g EM 启动报错及解决方法
一、常见错误1、 Environment variable ORACLE_UNQNAME not defined. Please set1、原因2、解决方法
2、EM Configuration issue. /opt/app/oracle/product/11.2.0/dbhome_1/lsl1_lishulei not found.1、 原因2、 解决方案,重新配置dbconsole重新配置dbconsole的步骤
二、配置示例三、常用命令
一、常见错误
1、 Environment variable ORACLE_UNQNAME not defined. Please set
Environment variable ORACLE_UNQNAME not defined. Please set
1、原因
这个参数是ORACLE11gR2新出的。所以在安装前必须先设置好此变量。否则在安装后面阶段配置EM时会报错
2、解决方法
在启动的时候先设置一下oracle_unqname 解决方法: 在启动的时候先设置一下oracle_unqname
set ORACLE_UNQNAME=
$ORACLE_SID
如果还是失败,在环境变量中添加:
vi ~
/.bash_profile
在最后添加:
export ORACLE_UNQNAME=
$ORACLE_SID
退出、执行
source ~
/.bash_profile
2、EM Configuration issue. /opt/app/oracle/product/11.2.0/dbhome_1/lsl1_lishulei not found.
EM Configuration issue. /opt/app/oracle/product/11.2.0/dbhome_1/lsl1_lishulei not found.
1、 原因
配置dbconsole时,未选择相应路径
2、 解决方案,重新配置dbconsole
重新配置dbconsole的步骤
emca
-repos drop
emca
-repos create
emca
-config dbcontrol db
emctl
start dbconsole
二、配置示例
[oracle@lsl1 ~]$ emctl
Environment variable ORACLE_UNQNAME not defined
. Please
set ORACLE_UNQNAME to database unique name
.
[oracle@lsl1 ~]$
echo $ORACLE_SID
lishulei
[oracle@lsl1 ~]$
set ORACLE_UNQNAME=
$ORACLE_SID
[oracle@lsl1 ~]$ emctl
EM Configuration issue
. /opt
/app
/oracle
/product
/11
.2
.0
/dbhome_1
/lsl1_lishulei not found
.
[oracle@lsl1 ~]$ emctl
EM Configuration issue
. /opt
/app
/oracle
/product
/11
.2
.0
/dbhome_1
/lsl1_lishulei not found
.
[oracle@lsl1 ~]$ vi ~
/.bash_profile
[oracle@lsl1 ~]$ emctl
start dbconsole
OC4J Configuration issue
. /opt
/app
/oracle
/product
/11
.2
.0
/dbhome_1
/oc4j
/j2ee
/OC4J_DBConsole_lsl1_lishulei not found
.
[oracle@lsl1 ~]$ emca
-repos create
EMCA 开始于 2020
-10
-21 21:16:44
EM Configuration Assistant
, 11
.2
.0
.3
.0 正式版
版权所有
(c
) 2003
, 2011
, Oracle。保留所有权利。
输入以下信息:
数据库 SID: lishulei
监听程序端口号: 1521
SYS 用户的口令: 456
SYSMAN 用户的口令: 3
是否继续?
[是
(Y
)/否
(N
)]: y
2020
-10
-21 21:17:07 oracle
.sysman
.emcp
.EMConfig perform
信息: 正在将此操作记录到
/opt
/app
/oracle
/cfgtoollogs
/emca
/lishulei
/emca_2020_10_21_21_16_44
.log。
2020
-10
-21 21:17:07 oracle
.sysman
.emcp
.EMReposConfig createRepository
信息: 正在创建 EM 资料档案库
(此操作可能需要一段时间
)...
2020
-10
-21 21:23:05 oracle
.sysman
.emcp
.EMReposConfig invoke
信息: 已成功创建资料档案库
已成功完成 Enterprise Manager 的配置
EMCA 结束于 2020
-10
-21 21:23:05
[oracle@lsl1 ~]$ emctl
start dbconsole
OC4J Configuration issue
. /opt
/app
/oracle
/product
/11
.2
.0
/dbhome_1
/oc4j
/j2ee
/OC4J_DBConsole_lsl1_lishulei not found
.
[oracle@lsl1 config]$ emca
-config dbcontrol db
EMCA 开始于 2020
-10
-21 21:43:36
EM Configuration Assistant
, 11
.2
.0
.3
.0 正式版
版权所有
(c
) 2003
, 2011
, Oracle。保留所有权利。
输入以下信息:
数据库 SID: lishulei
监听程序端口号: 1521
监听程序 ORACLE_HOME
[ /opt
/app
/oracle
/product
/11
.2
.0
/dbhome_1
]: lsl1_lishulei
SYS 用户的口令:
DBSNMP 用户的口令:
SYSMAN 用户的口令:
通知的电子邮件地址
(可选
):
通知的发件
(SMTP
) 服务器
(可选
):
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
--
已指定以下设置
数据库 ORACLE_HOME
................ /opt
/app
/oracle
/product
/11
.2
.0
/dbhome_1
本地主机名
................ lsl1
监听程序 ORACLE_HOME
................ lsl1_lishulei
监听程序端口号
................ 1521
数据库 SID
................ lishulei
通知的电子邮件地址
...............
通知的发件
(SMTP
) 服务器
...............
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
---
--
是否继续?
[是
(Y
)/否
(N
)]: y
2020
-10
-21 21:45:28 oracle
.sysman
.emcp
.EMConfig perform
信息: 正在将此操作记录到
/opt
/app
/oracle
/cfgtoollogs
/emca
/lishulei
/emca_2020_10_21_21_43_36
.log。
2020
-10
-21 21:45:41 oracle
.sysman
.emcp
.EMReposConfig uploadConfigDataToRepository
信息: 正在将配置数据上载到 EM 资料档案库
(此操作可能需要一段时间
)...
2020
-10
-21 21:46:26 oracle
.sysman
.emcp
.EMReposConfig invoke
信息: 已成功上载配置数据
2020
-10
-21 21:46:27 oracle
.sysman
.emcp
.ParamsManager getLocalListener
警告: 检索 lsl1 的监听程序时出错
2020
-10
-21 21:46:28 oracle
.sysman
.emcp
.util
.DBControlUtil secureDBConsole
信息: 正在保护 Database Control
(此操作可能需要一段时间
)...
2020
-10
-21 21:46:34 oracle
.sysman
.emcp
.util
.PlatformInterface executeCommand
警告: 执行
/opt
/app
/oracle
/product
/11
.2
.0
/dbhome_1
/bin
/emctl secure dbconsole
-host lsl1
-sid lishulei 时出错
2020
-10
-21 21:46:34 oracle
.sysman
.emcp
.EMDBPostConfig performConfiguration
警告: 保护 Database control 时出错。
2020
-10
-21 21:46:34 oracle
.sysman
.emcp
.EMDBPostConfig setWarnMsg
信息: 保护 Database Control 时出错。Database Control 已在非安全模式下启动。要保护 Database Control
, 请执行以下命令:
1
) 将环境变量 ORACLE_UNQNAME 设置为 数据库的唯一名称
2
) /opt
/app
/oracle
/product
/11
.2
.0
/dbhome_1
/bin
/emctl stop dbconsole
3
) /opt
/app
/oracle
/product
/11
.2
.0
/dbhome_1
/bin
/emctl config emkey
-repos
-sysman_pwd < SYSMAN 用户的口令 >
4
) /opt
/app
/oracle
/product
/11
.2
.0
/dbhome_1
/bin
/emctl secure dbconsole
-sysman_pwd < SYSMAN 用户的口令 >
5
) /opt
/app
/oracle
/product
/11
.2
.0
/dbhome_1
/bin
/emctl
start dbconsole
要保护 EM 密钥
, 请运行
/opt
/app
/oracle
/product
/11
.2
.0
/dbhome_1
/bin
/emctl config emkey
-remove_from_repos
-sysman_pwd < SYSMAN 用户的口令 >
2020
-10
-21 21:46:34 oracle
.sysman
.emcp
.util
.DBControlUtil startOMS
信息: 正在启动 Database Control
(此操作可能需要一段时间
)...
2020
-10
-21 21:46:39 oracle
.sysman
.emcp
.EMDBPostConfig performConfiguration
信息: 已成功启动 Database Control
2020
-10
-21 21:46:39 oracle
.sysman
.emcp
.EMDBPostConfig performConfiguration
信息: >>>>>>>>>>> Database Control URL 为 http:
//lsl1:1158
/em <<<<<<<<<<<
保护 Database Control 时出错。Database Control 已在非安全模式下启动。要保护 Database Control
, 请执行以下命令:
1
) 将环境变量 ORACLE_UNQNAME 设置为 数据库的唯一名称
2
) /opt
/app
/oracle
/product
/11
.2
.0
/dbhome_1
/bin
/emctl stop dbconsole
3
) /opt
/app
/oracle
/product
/11
.2
.0
/dbhome_1
/bin
/emctl config emkey
-repos
-sysman_pwd < SYSMAN 用户的口令 >
4
) /opt
/app
/oracle
/product
/11
.2
.0
/dbhome_1
/bin
/emctl secure dbconsole
-sysman_pwd < SYSMAN 用户的口令 >
5
) /opt
/app
/oracle
/product
/11
.2
.0
/dbhome_1
/bin
/emctl
start dbconsole
要保护 EM 密钥
, 请运行
/opt
/app
/oracle
/product
/11
.2
.0
/dbhome_1
/bin
/emctl config emkey
-remove_from_repos
-sysman_pwd < SYSMAN 用户的口令 >
[oracle@lsl1 config]$
三、常用命令
Oracle11G的EM采用了web方式,并且分成了2个产品,database control和grid control。Grid control需要下载单独的光盘安装。在用DBCA建库的时候,可以选择是否启用dbcontrol,启用的话需要在数据库中建立一个sysman的 schema,用于保存EM的一些数据,这个就是EM的资料库(repository)。使用命令行工具emca可以创建,修改,重建或者删除 dbcontrol的配置。
emca
-repos create
emca
-repos recreate
emca
-repos drop
emca
-config dbcontrol db
emca
-deconfig dbcontrol db
emca
-reconfig ports
emca
-reconfig ports
-dbcontrol_http_port 1160
emca
-reconfig ports
-agent_port 3940
emctl
start dbconsole
emctl stop dbconsole
emctl status dbconsole