はじめに
Azure CLI(azコマンド)を使用して、Autonomous AI Databaseを作成してみました。
1. Autonomous AI Databaseを作成するためのazコマンド
az oracle-database autonomous-database create
2. 主なパラメータ
| パラメーター | 設定項目 | 値 |
|---|---|---|
| --name | データベース名 | 文字列 |
| --resource-group | リソースグループ | 文字列 |
| --location | リージョン | japaneast、japanwest等 |
| --db-workload | ワークロードタイプ | DW / OLTP / AJD / APEX |
| --db-version | データベース・バージョン | 19c / 23ai |
| --compute-model | コンピュート・モデル | ECPU |
| --compute-count | ECPU数 | 2以上の数字 |
| --cpu-auto-scaling | CPU自動スケーリング | true / false |
| --data-storage-size-in-tbs | ストレージサイズ(TB) ※--db-workloadにDWを指定した場合に使用 |
1以上の数字 |
| --data-storage-size-in-gbs | ストレージサイズ(GB) ※--db-workloadにDW以外を指定した場合に使用 |
20以上の数字 |
| --store-auto-scaling | ストレージ自動スケーリング | true / false |
| --backup-retention-period-in-days | 自動バックアップ保持期間 | 1以上の数字 |
| --admin-password | adminユーザのパスワード | 12文字以上30文字以内 |
| --license-model | ライセンス・モデル | BringYourOwnLicense / LicenseIncluded |
| --database-edition | BYOLするライセンスのエディション ※--license-modelにBringYourOwnLicenseを指定した場合に使用 |
EnterpriseEdition / StandardEdition |
| --character-set | データベースのキャラクタセット | AL32UTF8 / JA16SJISTILDE 等 |
| --ncharacter-set | データベースの各国語キャラクタセット | AL16UTF16 / UTF8 |
| --is-mtls-connection-required | MTLS接続が必須 | true / false |
| --vnet-id | VNetのリソースID | |
| --subnet-id | サブネットのリソースID | |
| --autonomous-maintenance-schedule-type | メンテナンスパッチレベル | Early / Regular(現在はRegularのみ指定可能) |
| --customer-contacts | メンテナンス連絡先の電子メール | JSON配列で指定 |
| --regular | 通常のデータベース作成時に指定 | なし |
| --no-wait | 処理完了まで待たずにコマンドを終了 | true / false |
その他のパラメータについては、こちらのマニュアルに記載があります。
3. コマンドの実行
今回は、azコマンドで2ECPU/20GBの19cのAutonomous Transaction Processingを作成してみました。
また、ライセンスタイプはBYOLとし、BYOLするライセンスはEnterprise Edtionとしました。
以下が実行するコマンドです。
az oracle-database autonomous-database create \
--name ADBatAzure1 \
--display-name ADBatAzure \
--resource-group ODAA \
--location japaneast \
--db-workload OLTP \
--db-version 19c \
--compute-model ECPU \
--compute-count 2 \
--cpu-auto-scaling true \
--data-storage-size-in-gbs 20 \
--store-auto-scaling false \
--backup-retention-period-in-days 1 \
--admin-password Welcome12345# \
--license-model BringYourOwnLicense \
--database-edition StandardEdition \
--character-set JA16SJISTILDE \
--ncharacter-set AL16UTF16 \
--is-mtls-connection-required false \
--vnet-id /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ODAA/providers/Microsoft.Network/virtualNetworks/VNet1 \
--subnet-id /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ODAA/providers/Microsoft.Network/virtualNetworks/VNet1/subnets/ADB_Subnet \
--autonomous-maintenance-schedule-type Regular \
--customer-contacts '[{"email":"xxxxxxxxx@xxxx.com"}]' \
--regular \
--no-wait true
こちらのコマンドを、Cloud Shellから実行してみます。
user [ ~ ]$ az oracle-database autonomous-database create \
--name ADBatAzure1 \
--display-name ADBatAzure \
--resource-group ODAA \
--location japaneast \
--db-workload OLTP \
--db-version 19c \
--compute-model ECPU \
--compute-count 2 \
--cpu-auto-scaling true \
--data-storage-size-in-gbs 20 \
--store-auto-scaling false \
--backup-retention-period-in-days 1 \
--admin-password Welcome12345# \
--license-model BringYourOwnLicense \
--database-edition StandardEdition \
--character-set JA16SJISTILDE \
--ncharacter-set AL16UTF16 \
--is-mtls-connection-required false \
--vnet-id /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ODAA/providers/Microsoft.Network/virtualNetworks/VNet1 \
--subnet-id /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ODAA/providers/Microsoft.Network/virtualNetworks/VNet1/subnets/ADB_Subnet \
--autonomous-maintenance-schedule-type Regular \
--customer-contacts '[{"email":"kaoru.yamakawa@oracle.com"}]' \
--regular \
--no-wait true
user [ ~ ]$
--no-waitパラメータをtrueに設定したので、Autonomous Databaseの作成完了を待たず、実行後すぐにプロンプトが返ってきます。
4.コマンド実行結果の確認
Azure PortalでAutonomous AI Databaseの一覧を確認してみます。

azコマンドで作成したADBatAzure1のプロビジョニングが開始されたことが確認できました。
ただし、--display-nameで指定した表示名は反映されないようです。
ADBatAzure1の名前をクリックして、概要画面で設定内容を確認してみます。
az oracle-database autonomous-database createコマンドのパラメータで指定した通りにプロビジョニングされていることが確認できました。
以上で、Azure CLIでAutonomous AI Databaseを作成できることが確認できました。

