目录
1 软件环境
- VirtualBox 5.2
- Oracle Linux 6.7
- Oracle 12.1.0.2
2 概述
2.1官方文档
【官方文档】
https://docs.oracle.com/database/121/ADMIN/cdb_create.htm#ADMIN14210
2.2 EM Express 12c体系结构
2.3 EM Express 12c配置方法
配置HTTP或HTTPS监听监听程序端口:
- 验证dispatchers参数
dispatchers="(PROTOCOL=TCP)(SERVICE=<sid>XDB)" |
- 配置EM Express端口
exec DBMS_XDB_CONFIG.SETHTTPSPORT(5500); |
- URL访问EM Express
https://database-hostname:portnumber/em/ |
3 non-CDB 配置EM Express
3.1 查看监听器状态
[oracle@strong ~]$ lsnrctl status
EM Express默认端口是5500,说明EM Express已配置。
3.2 查看数据库配置
SQL> SELECT NAME, CDB, CON_ID FROM V$DATABASE;
3.3 查看EM Express配置
SQL> SELECT DBMS_XDB_CONFIG.GETHTTPPORT() FROM DUAL;
SQL> SELECT DBMS_XDB_CONFIG.GETHTTPSPORT FROM DUAL;
3.4 访问EM Express
https://192.168.56.102:5500/em/
3.5主页
3.6 菜单
3.6.1 配置
3.6.2 存储
3.6.3 安全
3.6.4 性能
3.7 退出
4 CDB 配置EM Express
目标:配置容器数据库CDB1使用EM Express,使用HTTP协议,端口为5500。 |
4.1 启动监听
[oracle@strong ~]$ lsnrctl start
4.2 启动容器数据库CDB1
[oracle@strong ~]$ export ORACLE_SID=cdb1
[oracle@strong ~]$ echo $ORACLE_SID
[oracle@strong ~]$ sqlplus / as sysdba
4.3 查看并启动PDBS
SQL> show pdbs
SQL> alter pluggable database all open;
SQL> show pdbs;
4.4 查看监听器状态
[oracle@strong ~]$ lsnrctl status
4.5 查看EM Express配置
SQL> SELECT DBMS_XDB_CONFIG.GETHTTPPORT() FROM DUAL;
SQL> SELECT DBMS_XDB_CONFIG.GETHTTPSPORT FROM DUAL;
DBCA建库时,未勾选创建EM Express,故未配置,端口都为0。
4.6 CDB1配置EM Express
SQL> exec DBMS_XDB_CONFIG.setHTTPPort(5500);
SQL> SELECT DBMS_XDB_CONFIG.GETHTTPPORT() FROM DUAL;
4.7 查看监听器状态
[oracle@strong ~]$ lsnrctl status
4.8 访问EM Express
5 PDB 配置EM Express
目标:配置容器数据库PDB1使用EM Express,使用HTTP协议,端口为5501。 |
5.1 切换到PDB1
SQL> conn sys/system@192.168.56.102:1521/pdb1 as sysdba
SQL> show pdbs;
5.2 查看EM Express配置
SQL> SELECT DBMS_XDB_CONFIG.GETHTTPPORT() FROM DUAL;
SQL> SELECT DBMS_XDB_CONFIG.GETHTTPSPORT FROM DUAL;
5.3 PDB1配置EM Express
SQL> exec DBMS_XDB_CONFIG.setHTTPPort(5501);
SQL> SELECT DBMS_XDB_CONFIG.GETHTTPPORT() FROM DUAL;
5.4 查看监听器
[oracle@strong ~]$ lsnrctl status