LoginSignup
6
1

More than 3 years have passed since last update.

[Oracle Cloud] Enterprise Manager Express を有効化して接続してみた

Last updated at Posted at 2020-08-07

はじめに

Oracle Cloud で提供されている Oracle Database の マネージドサービス「Database Cloud Service(略して DBCS と言うことが多い)」では、標準でモニタリングに利用できる Enterprise Manager Express が付いていきます。DBCS を使っている環境であれば、設定を有効にするだけで使えます。Oracle Database の Edition によっては、使えない機能はいくつか出てきますが、画面自体は どの Edition でもログインできます。

では、Enterprise Manager Exrpess の有効化の手順を紹介します。(忘れがちなので備忘録のため残しておきます)

Enterprise Manager Express を有効化

まず、DBCS の OS に SSH ログインして、SQL*Plus で接続します。

[opc@oradb19ee ~]$ sudo su - oracle
Last login: Thu Aug  6 00:54:39 UTC 2020
[oracle@oradb19ee ~]$
[oracle@oradb19ee ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Aug 6 01:14:33 2020
Version 19.7.0.0.0

Copyright (c) 1982, 2020, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.7.0.0.0

SQL>

5500 Port で、Enterprise Manager Express を有効にします。

SQL> exec DBMS_XDB_CONFIG.SETHTTPSPORT(5500);

PL/SQL procedure successfully completed.

SQL>

確認

SQL> select dbms_xdb_config.getHttpsPort() from dual;

DBMS_XDB_CONFIG.GETHTTPSPORT()
------------------------------
                          5500

SQL>

SQL*Plus を終了

exit

lsnrctl から、HTTP の文字列で grep して、正常にリッスンしていることを確認

[oracle@oradb19ee ~]$ lsnrctl status | grep HTTP
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=oradb19ee.pubsubnet01.vcn.oraclevcn.com)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/product/19.0.0.0/dbhome_1/admin/oradb19_nrt1r2/xdb_wallet))(Presentation=HTTP)(Session=RAW))
[oracle@oradb19ee ~]$

root ユーザーへスイッチし、iptables を stop します (OCI 側の Firewall で制限しているため、iptables を無効にしても良い判断)

systemctl stop iptables
systemctl disable iptables

Network Security Group

Oracle Cloud 側の Firewall を開放します。
Enterprise Manager Express で有効にした Port の 5500 を Open します

1596676711449.png

wallet の権限設定

このタイミングで正常に Enterprise Manager Express にアクセスできるはずですが、自分の環境では、次のエラーが発生してアクセスが出来ませんでした

1596756502557.png

以下の URL に該当していたので、wallet に関する権限設定をしていきます

grid user にログインします

[opc@oradb19ee ~]$ sudo su - grid
Last login: Thu Aug  6 23:28:18 UTC 2020
[grid@oradb19ee ~]$

wallet の場所を確認します

/u01/app/oracle/product/19.0.0.0/dbhome_1/admin/oradb19_nrt1r2/xdb_wallet ということがわかりました

[grid@oradb19ee ~]$ lsnrctl status | grep xdb_wallet
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=oradb19ee.pubsubnet01.vcn.oraclevcn.com)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/product/19.0.0.0/dbhome_1/admin/oradb19_nrt1r2/xdb_wallet))(Presentation=HTTP)(Session=RAW))

oracle user にログインします

[grid@oradb19ee ~]$ exit
logout
[opc@oradb19ee ~]$ sudo su - oracle
Last login: Thu Aug  6 23:29:31 UTC 2020
[oracle@oradb19ee ~]$

cd して権限を確認します

[oracle@oradb19ee ~]$ cd /u01/app/oracle/product/19.0.0.0/dbhome_1/admin/oradb19_nrt1r2/xdb_wallet
[oracle@oradb19ee xdb_wallet]$
[oracle@oradb19ee xdb_wallet]$ ls -la
total 16
drwxr-xr-x 2 oracle asmadmin 4096 Aug  4 09:18 .
drwxr-xr-x 3 oracle asmadmin 4096 Aug  4 09:18 ..
-rw------- 1 oracle asmadmin 3912 Aug  4 09:18 cwallet.sso
-rw------- 1 oracle asmadmin 3867 Aug  4 09:18 ewallet.p12

chmodで、asmadmin グループに read 権限を付与します

chmod 640 /u01/app/oracle/product/19.0.0.0/dbhome_1/admin/oradb19_nrt1r2/xdb_wallet/*

確認します。asmadmin の read 権限が付与されていることを確認

[oracle@oradb19ee xdb_wallet]$ ls -la
total 16
drwxr-xr-x 2 oracle asmadmin 4096 Aug  4 09:18 .
drwxr-xr-x 3 oracle asmadmin 4096 Aug  4 09:18 ..
-rw-r----- 1 oracle asmadmin 3912 Aug  4 09:18 cwallet.sso
-rw-r----- 1 oracle asmadmin 3867 Aug  4 09:18 ewallet.p12
[oracle@oradb19ee xdb_wallet]$

JET 版アクセス

ここまで設定したことで、 Enterprise Manager Expressにアクセスが可能です。次のURLで可能です。

sys ユーザーと、DBCS を作成した時に指定したパスワードいれて、Log in をします

1596757037443.png

JET 版で見える画面

ログイン直後

1596757888852.png

メニューから選択可能なものは、Performance Hub のみに見える

1596757956200.png

Performance Hub の画面

1596757918782.png

Performance Hub の Monitored SQL

1596758056479.png

Flash 版に切り替え

Flash はサポート切れる関係上、非推奨になっています。ただ、機能的には見える画面が多いので、切り替え方法も確認してみます。

SQL*Plus で接続して次のコマンドを入れます

@?/rdbms/admin/execemx emx

実行例

SQL> @?/rdbms/admin/execemx emx

Session altered.


no rows selected

old   1: select nvl( '&1','omx') p1 from dual
new   1: select nvl( 'emx','omx') p1 from dual

P1
---
emx


PL/SQL procedure successfully completed.


Session altered.

SQL>

ちなみに JET 版に戻すときは次のコマンドです

@?/rdbms/admin/execemx omx

Flash 版アクセス

JET 版と同じURL を入れてアクセスすると、Flash 版に変わっています

ログイン画面

1596758276258.png

Flash 版で見える画面

ログイン直後

1596758324628.png

このあたりの画面は、今は Flash 版にしかないように見える

特に、SQL Tuning Advisor は便利なので、JET版の進化を期待したい

1596758591301.png

参考URL

6
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
1