1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

OCI Database Management でいろんな場所のDBを管理する: DB on OCI 編

Last updated at Posted at 2025-08-19

はじめに

OCI Database Management は Enterprise Manager Cloud Control (EMCC) のクラウド版、ぐらいの理解ですが、きちんと理解したいので色々と試していこうと思います。
まずは OCI Computeインスタンス上に構築した OracleDB を管理対象にしてみます。
(下記の「IaaS上に直接構築された Oracle Database の場合は…」に相当)
スクリーンショット 2025-08-15 092716.png

なお、下記の DB on OCI (右下) に当たるため、有償です。(価格は同資料の次頁をご覧ください)
スクリーンショット 2025-08-15 150747.png

管理エージェントのインストール

下記を参考に対象の Computeインスタンスに管理エージェントをインストールしていきます。

管理エージェント・ソフトウェアのDL

ここでは OCI CLI を使用してDLします。
OCI CLI のインストールについて知りたい方は、下記をご確認ください。

Object Storage からソフトウェアをDLするため、oci management-agent agent-image list --compartment-id <tenancyId>を実行して object-namespace を確認します。
<tenancyID> は、自身の OCIコンソールの右上「プロファイル」から「テナンシ: xxxx」を選択して確認してください。

[opc@handson-vm01 ~]$ oci management-agent agent-image list --compartment-id ocid1.tenancy.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
{
  "data": [
    (snip)
    {
      "checksum": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "id": "ocid1.managementagentimage.oc1..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "image-object-storage-details": {
        "checksum": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "object-bucket": "agent_images",
        "object-name": "Linux-x86_64/latest/oracle.mgmt_agent.rpm",
        "object-namespace": "xxxxxxxxxx",    ★
        "object-url": "https://objectstorage.ap-tokyo-1.oraclecloud.com/n/xxxxxxxxxx/b/agent_images/o/Linux-x86_64/latest/oracle.mgmt_agent.rpm"
      },
      "lifecycle-state": "ACTIVE",
      "object-url": "https://objectstorage.ap-tokyo-1.oraclecloud.com/n/xxxxxxxxxx/b/agent_images/o/Linux-x86_64/latest/oracle.mgmt_agent.rpm",
      "package-architecture-type": "X86_64",
      "package-type": "RPM",
      "platform-name": "Linux-x86_64",
      "platform-type": "LINUX",
      "size": 110560185.0,
      "version": "250704.1404"
    },
    (snip)
  ]
}

確認できた object-namespace を使用して、ソフトウェアをDLします。

[opc@handson-vm01 ~]$ oci os object get --namespace xxxxxxxxxx --bucket-name agent_images --name Linux-x86_64/latest/oracle.mgmt_agent.rpm --file oracle.mgmt_agent.rpm
Downloading object  [####################################]  100%
[opc@handson-vm01 ~]$ ls -la
total 2739740
drwx------. 4 opc  opc        4096 Aug 15 10:40 .
drwxr-xr-x. 5 root root         46 Jul 31 15:54 ..
-rw-------. 1 opc  opc        3688 Aug 14 18:26 .bash_history
-rw-r--r--. 1 opc  opc          18 May 23  2024 .bash_logout
-rw-r--r--. 1 opc  opc         286 Jul 28 16:21 .bash_profile
-rw-r--r--. 1 opc  opc         376 May 23  2024 .bashrc
-rw-r--r--. 1 root root      17624 Jul 28 15:55 compat-libcap1-1.10-7.el7.x86_64
-rw-r--r--. 1 root root     194824 Jul 28 15:55 compat-libstdc++-33-3.2.3-72.el7
drwx------. 2 opc  opc          91 Jul 28 15:49 .oci
-rw-rw-r--. 1 opc  opc  2694664264 Jul 28 15:55 oracle-database-ee-19c-1.0-1.x86
-rw-r--r--. 1 root root      18204 Jul 28 15:56 oracle-database-preinstall-19c-1
-rw-rw-r--. 1 opc  opc   110560185 Aug 15 10:40 oracle.mgmt_agent.rpm    ★
drwx------. 2 opc  opc          29 Jul 28 15:29 .ssh
-rw-------. 1 opc  opc        1272 Jul 28 16:21 .viminfo

インストール・キーの作成

このまま管理エージェントをインストールする前に、OCIコンソール上でインストール・キーを作成する必要があります。

OCIコンソールの左上のナビゲーション・メニューから、監視および管理 > ダウンロードとキー の「キーの作成」を選択してキーを作成します。
image.png

作成したキー (xxxx.rsp) はDLし、自身の Object Storage などにULしてください。
image.png

管理エージェントのインストール

Computeインスタンスに戻り、管理エージェントをインストールします。(JDK 8 が必要だったため、java-1.8.0-openjdk-devel を事前にインストール済みです)

[opc@handson-vm01 ~]$ sudo rpm -ivh oracle.mgmt_agent.rpm
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Checking pre-requisites
        Checking if any previous agent service exists
        Checking if OS has systemd or initd
        Checking available disk space for agent install
        Checking if /opt/oracle/mgmt_agent directory exists
        Checking if 'mgmt_agent' user exists
                'mgmt_agent' user already exists, the agent will proceed installation without creating a new one.
        Checking Java version
                JAVA_HOME is not set or not readable to root
                Trying default path /usr/bin/java
                Java version: 1.8.0_462 found at /usr/bin/java
        Checking agent version
Updating / installing...
   1:oracle.mgmt_agent-250704.1404-1  ################################# [100%]

Executing install
        Unpacking software zip
        Copying files to destination dir (/opt/oracle/mgmt_agent)
        Initializing software from template
        Checking if JavaScript engine is available to use
        Creating mgmt_agent daemon
        Agent Install Logs: /opt/oracle/mgmt_agent/installer-logs/installer.log.0

        Setup agent using input response file (run as any user with 'sudo' privileges)
        Usage:
                sudo /opt/oracle/mgmt_agent/agent_inst/bin/setup.sh opts=[FULL_PATH_TO_INPUT.RSP]

Agent install successful

[opc@handson-vm01 ~]$

先ほど作成してULしたキーをDLします。

[opc@handson-vm01 ~]$ oci os object get --namespace xxxxxxxx --bucket-name handson-bucket --name dbmng_handson_20250815.rsp --file ./dbmng_handson_20250815.rsp
Downloading object  [####################################]  100%
[opc@handson-vm01 ~]$ ls -la
total 2739744
drwx------. 4 opc  opc        4096 Aug 15 10:53 .
drwxr-xr-x. 5 root root         46 Jul 31 15:54 ..
-rw-------. 1 opc  opc        3688 Aug 14 18:26 .bash_history
-rw-r--r--. 1 opc  opc          18 May 23  2024 .bash_logout
-rw-r--r--. 1 opc  opc         286 Jul 28 16:21 .bash_profile
-rw-r--r--. 1 opc  opc         376 May 23  2024 .bashrc
-rw-r--r--. 1 root root      17624 Jul 28 15:55 compat-libcap1-1.10-7.el7.x86_64
-rw-r--r--. 1 root root     194824 Jul 28 15:55 compat-libstdc++-33-3.2.3-72.el7
-rw-rw-r--. 1 opc  opc        1373 Aug 15 10:53 dbmng_handson_20250815.rsp       ★
drwx------. 2 opc  opc          91 Jul 28 15:49 .oci
-rw-rw-r--. 1 opc  opc  2694664264 Jul 28 15:55 oracle-database-ee-19c-1.0-1.x86
-rw-r--r--. 1 root root      18204 Jul 28 15:56 oracle-database-preinstall-19c-1
-rw-rw-r--. 1 opc  opc   110560185 Aug 15 10:40 oracle.mgmt_agent.rpm
drwx------. 2 opc  opc          29 Jul 28 15:29 .ssh
-rw-------. 1 opc  opc        1272 Jul 28 16:21 .viminfo
[opc@handson-vm01 ~]$
[opc@handson-vm01 ~]$ cp dbmng_handson_20250815.rsp /tmp

DLしたキーを指定してsetup.shを実行します。

[opc@handson-vm01 ~]$ sudo /opt/oracle/mgmt_agent/agent_inst/bin/setup.sh opts=/tmp/dbmng_handson_20250815.rsp

Executing configure

        Parsing input response file
        Validating install key
        Generating communication wallet
        Generating security artifacts
        Registering Management Agent

Starting agent...
Agent started successfully


Agent setup completed and the agent is running.
In the future agent can be started by directly running: sudo systemctl start mgmt_agent
Please use OCI CLI or OCI Management Agent console to validate the successful activation of your agent.

Please make sure that you delete /tmp/dbmng_handson_20250815.rsp or store it in secure location.

[opc@handson-vm01 ~]$

OCIコンソールの左上のナビゲーション・メニューから、監視および管理 > エージェント を選択して、インストールしたエージェントの状態を確認できます。
image.png

外部データベースの登録

ナビゲーション・メニュー > 監視および管理 > データベース管理 から「2. 診断と管理の有効化」の「外部データベース」を選択します。
image.png

「外部データベースの登録」を選択し、任意のコンテナ・データベース表示名を入力して登録します。
image.png

管理対象データベース一覧に戻ると↑で登録したもの (ここでは ECD-piyo) が表示されます。
ステータス列の「接続」を選択し、各種情報を入力してコネクタを追加します。
image.png

入力情報に誤りなどがなければ、ステータスが「接続済」に変わります。
image.png

「診断と管理」列の「有効化」を選択し、必要事項を入力して診断と管理を有効にします。(ここから課金発生?)
image.png

ナビゲーション・メニュー > 監視および管理 > 診断と管理 を選択すると、追加したDBの情報が表示されるようになりました。
image.png

image.png

無効に戻すと下記のようになりました。
image.png

次回以降、別の場所のDBの追加や、確認できる内容の深堀をしていきます。

1
0
0

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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?