oracle em

WIN的事件查看器:
An error occured while trying to initialize the service.

手工启动:emctl start dbconsole
Environment variable ORACLE_SID not defined. Please define it.
当执行set OARCLE_SID=orcl,继续报错
Unable to determine local host from URL REPOSITORY_URL=http://localhost:%EM_UPLOAD_PORT%/em/upload/





注意以下地方:


1: 主机名:
C:\WINDOWS\system32\drivers\etc\hosts

2: EM链接JDBC:
$ORACLE_HOME\oc4j\j2ee
OC4J_DBConsole_fox-kook_kook
OC4J_DBConsole_localhost_kook (从fox-kook主机名复制这个目录为localhost)

3: 监听修改为主机名的连接方式,不要以IP方式。
$ORACLE_HOME\NETWORK\ADMIN\listener.ora

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = kook.glfsoft.com)
      (ORACLE_HOME = G:\oracle\product\10.2.0\db_1)
      (SID_NAME = kook)
    )
  )

LISTENER =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = fox-kook)(PORT = 1521))
  )

$ORACLE_HOME\NETWORK\ADMIN\tnsnames.ora同样。
KOOK =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = fox-kook)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = kook.glfsoft.com)
    )
  )



最终实现,IP更改不会影响到Oracle的EM启动问题。


附重建EM的命令组

引用

创建一个EM资料库
emca -repos create
重建一个EM资料库
emca -repos recreate
删除一个EM资料库
emca -repos drop
配置数据库的 Database Control
emca -config dbcontrol db
删除数据库的 Database Control配置
emca -deconfig dbcontrol db
重新配置db control的端口,默认端口在1158
emca -reconfig ports
emca -reconfig ports -dbcontrol_http_port 1160
emca -reconfig ports -agent_port 3940
先设置ORACLE_SID环境变量后,启动EM console服务
emctl start dbconsole
先设置ORACLE_SID环境变量后,停止EM console服务
emctl stop dbconsole
先设置ORACLE_SID环境变量后,查看EM console服务的状态
emctl status dbconsole

配置dbconsole的步骤
emca -repos create
emca -config dbcontrol db
emctl start dbconsole
重新配置dbconsole的步骤
emca -repos drop
emca -repos create
emca -config dbcontrol db
emctl start dbconsole

你可能感兴趣的:(oracle,windows,jdbc)