重庆思庄Oracle、Redhat认证学习论坛

标题: Oracle12c环境下的EM配置和使用方法 [打印本页]

作者: jiawang    时间: 2019-12-24 17:24
标题: Oracle12c环境下的EM配置和使用方法
本帖最后由 jiawang 于 2019-12-24 17:38 编辑

Oracle12c环境中,EM不需要单独安装配置了,创建数据库的时候勾选EM express即可。登陆方式也发生了变化,原来的http://localhost:1158/em或者https://localhost:1158/em登陆总是会遇到问题,解决方法需要使用到XDB,需要手动设置端口。

查看监听
[oracle@localhost admin]$ lsnrctl status   
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 24-DEC-2019 17:05:57
Copyright (c) 1991, 2016, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                28-AUG-2018 13:07:15
Uptime                    483 days 3 hr. 58 min. 44 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/product/12.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=5500))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "orcl" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully

数据库安装配置好em后,默认端口号为5500;
SQL> select dbms_xdb_config.gethttpsport() from dual;
DBMS_XDB_CONFIG.GETHTTPSPORT()
------------------------------
                          5500


设置em端口:

可以通过以下命令将em端口从5500更改为5502

exec dbms_xdb_config.setHTTPSport();

SQL> EXEC DBMS_XDB_CONFIG.SETHTTPPORT(5502);

PL/SQL procedure successfully completed


查询EM Express的访问端口

SQL> select dbms_xdb_config.gethttpport() from dual;

DBMS_XDB_CONFIG.GETHTTPPORT()

-----------------------------

                         5502

如果你使用的是http协议,则网址格式为:http://localhost:port/em

例如http://192.168.0.140:5502/em,同理如果是https协议,将http改成https即可。