LoginSignup
4
1

More than 5 years have passed since last update.

Oracle Cloud(OCI)で利用可能なDBのバージョンをcliで確認する方法

Last updated at Posted at 2019-03-11

Oracle Cloud Infrastructure(OCI)のDBaaSで利用可能なDBバージョンのリスト取得方法。

コマンド

oci db version list --db-system-shape <シェイプ名> -c <コンパートメントのOCID>

・必須オプションはコンパートメントのみ
シェイプのオプションを付けないと全シェイプで利用可能なバージョンしか表示されない点に注意
・"--output table"は付けた方が見栄えが良い

出力例

・windows powershellで実行
・oci cliのversionは2.4.41
・phoenixリージョン
・プロファイルを使ってるのでコンパートメントは直接指定してません

PS C:\> oci db version list --db-system-shape VM.Standard2.1 --output table --profile ProfPhx
+-----------------------------+--------------+-----------------+
| is-latest-for-major-version | supports-pdb | version         |
+-----------------------------+--------------+-----------------+
| True                        | False        | 11.2.0.4        |
| False                       | False        | 11.2.0.4.180116 |
| False                       | False        | 11.2.0.4.180417 |
| False                       | False        | 11.2.0.4.180717 |
| True                        | True         | 12.1.0.2        |
| False                       | True         | 12.1.0.2.180116 |
| False                       | True         | 12.1.0.2.180417 |
| False                       | True         | 12.1.0.2.180717 |
| True                        | True         | 12.2.0.1        |
| False                       | True         | 12.2.0.1.180116 |
| False                       | True         | 12.2.0.1.180417 |
| False                       | True         | 12.2.0.1.180717 |
| True                        | True         | 18.0.0.0        |
| False                       | True         | 18.1.0.0        |
| False                       | True         | 18.2.0.0        |
| False                       | True         | 18.3.0.0        |
+-----------------------------+--------------+-----------------+

おまけ

シェイプを指定しないとこうなる

PS C:\> oci db version list --output table --profile ProfPhx
+-----------------------------+--------------+----------+
| is-latest-for-major-version | supports-pdb | version  |
+-----------------------------+--------------+----------+
| True                        | False        | 11.2.0.4 |
| True                        | True         | 12.1.0.2 |
+-----------------------------+--------------+----------+

シェイプ名がわからない場合は適当に書けば教えてくれる

・「BM.Standard2.52」というシェイプは無いのでエラーで候補を教えてくれる

PS C:\> oci db version list --db-system-shape BM.Standard2.52 --output table --profile  ProfPhx
ServiceError:
{
    "code": "InvalidParameter",
    "message": "dbSystemShape must be one of BM.HighIO1.36 or BM.DenseIO1.36 or BM.DenseIO2.52 or BM.RACLocalStorage1.72 or BM.RACLocalStorage1.72 or VM.Standard1.1 or VM.Standard1.2 or VM.Standard1.4 or VM.Standard1.8 or VM.Standard1.16 or VM.Standard2.1 or VM.Standard2.2 or VM.Standard2.4 or VM.Standard2.8 or VM.Standard2.16 or VM.Standard2.24 or Exadata.Quarter1.84 or Exadata.Half1.168 or Exadata.Full1.336 or Exadata.Double1.672 or Exadata.Quarter2.92 or Exadata.Half2.184 or Exadata.Full2.368 or Exadata.Double2.736.",
    "opc-request-id": "2A586D62E9E44898A6CAED6F4FC5428C/xx/389F5BFC41A8C100522CE8C9E7D52309",
    "status": 400
}

参考

・oci cliのマニュアル :Docs » db » version » list
・GitHubのissue:OCI CLI does not pull correct db versions #69
・oci cliのprofileの使い方:Oracle Cloud(OCI)のoci cli設定ファイルの使い方をまとめてみた

以上

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