[Oracle Cloud] Oracle DB のマネージドサービス (Database Cloud Service) に、パッチを適用してみた

# はじめに

Oracle Cloud Infrastructure(以下OCI)には、Oracle DB のマネージドサービスがいくつかあります。

今までオンプレミスで使ってきた Oracle DB と同じような操作感で扱うことのできる Database Cloud Service や、パフォーマンスチューニングやアップグレードなど様々な自動機能が備わっている Autonomous DB があります。今回は、Database Cloud Service に備わっている、パッチ適用支援機能を使う方法を紹介します。

パッチ適用支援機能は、「このパッチを適用可能だよ」といった形で 適用可能なパッチを OCI Console に表示してくれます。ユーザー側で、パッチ適用したいタイミングを見計らうことが出来ます。適用するパッチによって、Oracle DB インスタンスの再起動が必要有無が変わるので、適切なタイミングで行うのが良いでしょう。



# パッチ適用の順番

Database Cloud Service には、2種類のパッチが提供されています。

- DB System のパッチ適用 : クラスタ全体に関わる、Clusterware、Grid Infrastructure のパッチ適用が含まれる
- Database のパッチ適用 : Oracle Database インスタンス自体のパッチ適用が含まれる



パッチ適用を行う順番は、DB System を先に行い、次に Database を行います。先に Database を行うと、パッチ適用がエラーとなります。

それでは、以下のバージョンでパッチ適用を行っていきます。

- DB System Version : 19.5.0.0.191015 → 19.6.0.0.200114
- Database Version : 11.2.0.4.191015 → 11.2.0.4.200114



# DB System Version のパッチ適用

Oracle DB の インスタンスにログインすることで、Version を含めた詳細情報を確認することが出来ます。SSH で root ユーザーにログインします。

```
[opc@s2db ~]$ sudo su - 
Last login: Wed Jan 29 21:57:46 UTC 2020 on pts/0
[root@s2db ~]# 
```



root ユーザーでは、dbcli コマンドの実行が可能です。dbcli で現在の Grid Infrastructure のバージョンや、DB System のバージョン表示が出来ます。パッチ適用前のバージョンを確認します。

```
[root@s2db bin]# dbcli describe-component 
System Version  
---------------
19.4.3.0.0

Component                                Installed Version    Available Version   
---------------------------------------- -------------------- --------------------
GI                                        19.5.0.0.191015       19.6.0.0.200114     
DB                                        11.2.0.4.191015       11.2.0.4.200114     

[root@s2db bin]# 
```



OCI コンソール上でパッチを適用します。Database Cloud Service の Detail ページで、Patches を表示します。すると、現在の インスタンスに適用可能な Patch が表示されています。パッチの行から、Apply を選択することでパッチ適用が開始されます。

![1580338801129.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/104247/c72dcac4-5e31-37e8-4537-836e0ceb8721.png)



Oracle DB のインスタンス上で、パッチ適用の進捗詳細を確認できます。`dbcli list-jobs` コマンドで、パッチ適用を含めた、今までのジョブ履歴を表示できます。一番下が最新の Job になっており、`Server Patching` と表示されています。この ID をメモります。

```
[root@s2db ~]# dbcli list-jobs

ID                                       Description                                                                 Created                             Status    
---------------------------------------- --------------------------------------------------------------------------- ----------------------------------- ----------
c42eba53-b654-4e2e-87f6-ecb37d7d7e97     Provisioning service creation                                               January 29, 2020 10:55:13 AM UTC    Success   
6191e968-ccfd-45d2-9ff0-d31eb0cb2f32     SSH keys update                                                             January 29, 2020 11:23:58 AM UTC    Success   
40041626-53e5-4948-859b-01dc6ffb6e4e     SSH key delete                                                              January 29, 2020 11:25:54 AM UTC    Success   
1c57f6ac-b013-4cba-834f-9cfee35bd41c     Authentication key update for DCS_ADMIN                                     January 29, 2020 11:27:56 AM UTC    Success   
ec85f0a2-1b07-443d-9b19-354f7ca71a19     create object store:bkqDXJmEDvRwFwKnyEUV                                    January 29, 2020 11:40:47 AM UTC    Success   
b20864d8-6252-482b-a0e8-78ba7e6ac002     create backup config:bkqDXJmEDvRwFwKnyEUV_BC                                January 29, 2020 11:41:07 AM UTC    Success   
59bdbb9d-73ed-4ba8-934f-1b2016634cf6     update database : s2db                                                      January 29, 2020 11:41:41 AM UTC    Success   
166a4d03-213f-4abe-90b7-0d61f3a5504e     Create Regular-L0 Backup with TAG-DBTRegular-L015802974408954ll for Db:s2db in OSS:bkqDXJmEDvRwFwKnyEUV January 29, 2020 11:43:25 AM UTC    Success   
faf715e4-d265-45c6-bf29-fb39acde4bd3     Delete Backup for Database name: s2db_nrt1tb                                January 29, 2020 11:45:22 AM UTC    Success   
baa2d914-349f-4fc7-bb8f-d3da143e5765     DB Home Prechecks                                                           January 29, 2020 3:19:58 PM UTC     Failure   
208eae5f-0c34-4f4f-965f-51e17566f7e1     DB Home Patching: Home Id is 500224b0-b425-4601-8e95-9202d7f01028           January 29, 2020 3:43:34 PM UTC     Failure   
988455af-524f-4398-8bb1-afc2840ac7ab     Server Patching                                                             January 29, 2020 3:48:02 PM UTC     Running   
↑ Server Patching が新たに追加されて、パッチ処理が走っている

[root@s2db ~]# 
```



ID を指定して `dbcli describe-job` コマンドを実行することで、対象の Job の詳細確認が出来ます。パッチ適用の中で何を実行しているのか、どれくらい時間が掛かっているかを読み取ることが出来ます。なお、記事の環境では、パッチ適用に約40分ほど掛かりました。

```
[root@s2db ~]# dbcli describe-job -i 988455af-524f-4398-8bb1-afc2840ac7ab -j
{
  "jobId" : "988455af-524f-4398-8bb1-afc2840ac7ab",
  "status" : "Success",
  "message" : null,
  "reports" : [ {
    "taskId" : "TaskZJsonRpcExt_380",
    "taskName" : "Create Patching Repository Directories[s2db]",
    "taskResult" : "Successfully created repository directories",
    "startTime" : "January 29, 2020 15:48:02 PM UTC",
    "endTime" : "January 29, 2020 15:48:02 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskSequential_379",
    "jobId" : "988455af-524f-4398-8bb1-afc2840ac7ab",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 15:48:02 PM UTC"
  }, {
    "taskId" : "TaskZJsonRpcExt_383",
    "taskName" : "Download latest patch metadata[s2db]",
    "taskResult" : "Successfully downloaded latest patch metadata",
    "startTime" : "January 29, 2020 15:48:02 PM UTC",
    "endTime" : "January 29, 2020 15:48:22 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskSequential_382",
    "jobId" : "988455af-524f-4398-8bb1-afc2840ac7ab",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 15:48:22 PM UTC"
  }, {
    "taskId" : "TaskZJsonRpcExt_389",
    "taskName" : "Update Patching Repository[s2db]",
    "taskResult" : "Successfully updated patching repository",
    "startTime" : "January 29, 2020 15:48:22 PM UTC",
    "endTime" : "January 29, 2020 15:50:21 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskSequential_388",
    "jobId" : "988455af-524f-4398-8bb1-afc2840ac7ab",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 15:50:21 PM UTC"
  }, {
    "taskId" : "TaskZJsonRpcExt_340",
    "taskName" : "Opatch updation[s2db]",
    "taskResult" : "Successfully applied all actions",
    "startTime" : "January 29, 2020 15:50:22 PM UTC",
    "endTime" : "January 29, 2020 15:50:26 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskParallel_339",
    "jobId" : "988455af-524f-4398-8bb1-afc2840ac7ab",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 15:50:26 PM UTC"
  }, {
    "taskId" : "TaskZJsonRpcExt_343",
    "taskName" : "Patch conflict check[s2db]",
    "taskResult" : "Successfully analyzed patch /u01/odaPatchingTempDir/30501910 for /u01/app/19.0.0.0/grid",
    "startTime" : "January 29, 2020 15:50:26 PM UTC",
    "endTime" : "January 29, 2020 15:52:23 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskSequential_342",
    "jobId" : "988455af-524f-4398-8bb1-afc2840ac7ab",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 15:52:23 PM UTC"
  }, {
    "taskId" : "TaskZJsonRpcExt_346",
    "taskName" : "apply clusterware patch[s2db]",
    "taskResult" : "Successfully applied the patch on /u01/app/19.0.0.0/grid on node s2db",
    "startTime" : "January 29, 2020 15:52:23 PM UTC",
    "endTime" : "January 29, 2020 16:20:58 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskSequential_345",
    "jobId" : "988455af-524f-4398-8bb1-afc2840ac7ab",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 16:20:58 PM UTC"
  }, {
    "taskId" : "TaskZJsonRpcExt_349",
    "taskName" : "Updating GiHome version[s2db]",
    "taskResult" : "successfully updated dbHome version",
    "startTime" : "January 29, 2020 16:20:58 PM UTC",
    "endTime" : "January 29, 2020 16:21:34 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskParallel_348",
    "jobId" : "988455af-524f-4398-8bb1-afc2840ac7ab",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 16:21:34 PM UTC"
  }, {
    "taskId" : "TaskZJsonRpcExt_392",
    "taskName" : "Update System version[s2db]",
    "taskResult" : "",
    "startTime" : "January 29, 2020 16:21:43 PM UTC",
    "endTime" : "January 29, 2020 16:21:43 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskSequential_391",
    "jobId" : "988455af-524f-4398-8bb1-afc2840ac7ab",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 16:21:43 PM UTC"
  } ],
  "createTimestamp" : "January 29, 2020 15:48:02 PM UTC",
  "resourceList" : [ ],
  "description" : "Server Patching",
  "updatedTime" : "January 29, 2020 16:21:43 PM UTC"
}
[root@s2db ~]# 
```



コンポーネントの詳細確認

`System Version` と `GI` がバージョンアップされている

```
[root@s2db ~]# dbcli describe-component 
System Version  
---------------
19.6.0.0.200114

Component                                Installed Version    Available Version   
---------------------------------------- -------------------- --------------------
GI                                        19.6.0.0.200114       up-to-date          
DB                                        11.2.0.4.191015       11.2.0.4.200114     

[root@s2db ~]# 
```



パッチ適用完了後、OCI Console 上でバージョンが上がっているのが確認できます

![1580339774684.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/104247/a7902741-de6d-e345-70e2-fe064b199913.png)



# Database Version のパッチ適用

次は、Database Version をアップデートを行います。先ほどまで見ていた DB System の詳細ページから、Database Details に飛んでパッチを適用します。表示されているパッチから、`Apply` を選択します。

![1580339876235.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/104247/36d079dc-3e04-1b9a-2f31-9bc4f34ddc6e.png)



先ほどと同様に、dbcli で job list を出します。一番下に、`DB Home Patching: Home Id is 500224b0-b425-4601-8e95-9202d7f01028` が表示されています。

```
[root@s2db ~]# dbcli list-jobs

ID                                       Description                                                                 Created                             Status    
---------------------------------------- --------------------------------------------------------------------------- ----------------------------------- ----------
c42eba53-b654-4e2e-87f6-ecb37d7d7e97     Provisioning service creation                                               January 29, 2020 10:55:13 AM UTC    Success   
6191e968-ccfd-45d2-9ff0-d31eb0cb2f32     SSH keys update                                                             January 29, 2020 11:23:58 AM UTC    Success   
40041626-53e5-4948-859b-01dc6ffb6e4e     SSH key delete                                                              January 29, 2020 11:25:54 AM UTC    Success   
1c57f6ac-b013-4cba-834f-9cfee35bd41c     Authentication key update for DCS_ADMIN                                     January 29, 2020 11:27:56 AM UTC    Success   
ec85f0a2-1b07-443d-9b19-354f7ca71a19     create object store:bkqDXJmEDvRwFwKnyEUV                                    January 29, 2020 11:40:47 AM UTC    Success   
b20864d8-6252-482b-a0e8-78ba7e6ac002     create backup config:bkqDXJmEDvRwFwKnyEUV_BC                                January 29, 2020 11:41:07 AM UTC    Success   
59bdbb9d-73ed-4ba8-934f-1b2016634cf6     update database : s2db                                                      January 29, 2020 11:41:41 AM UTC    Success   
166a4d03-213f-4abe-90b7-0d61f3a5504e     Create Regular-L0 Backup with TAG-DBTRegular-L015802974408954ll for Db:s2db in OSS:bkqDXJmEDvRwFwKnyEUV January 29, 2020 11:43:25 AM UTC    Success   
faf715e4-d265-45c6-bf29-fb39acde4bd3     Delete Backup for Database name: s2db_nrt1tb                                January 29, 2020 11:45:22 AM UTC    Success   
baa2d914-349f-4fc7-bb8f-d3da143e5765     DB Home Prechecks                                                           January 29, 2020 3:19:58 PM UTC     Failure   
208eae5f-0c34-4f4f-965f-51e17566f7e1     DB Home Patching: Home Id is 500224b0-b425-4601-8e95-9202d7f01028           January 29, 2020 3:43:34 PM UTC     Failure   
988455af-524f-4398-8bb1-afc2840ac7ab     Server Patching                                                             January 29, 2020 3:48:02 PM UTC     Success   
29876291-5cf6-4ba0-8735-8929ad96d06c     DB Home Patching: Home Id is 500224b0-b425-4601-8e95-9202d7f01028           January 29, 2020 11:19:23 PM UTC    Running   

[root@s2db ~]# 
```



詳細を確認します。記事の環境では、約14分の処理時間が必要でした。

```
[root@s2db ~]# dbcli describe-job -i 29876291-5cf6-4ba0-8735-8929ad96d06c -j
{
  "jobId" : "29876291-5cf6-4ba0-8735-8929ad96d06c",
  "status" : "Success",
  "message" : null,
  "reports" : [ {
    "taskId" : "TaskZJsonRpcExt_1143",
    "taskName" : "Create Patching Repository Directories[s2db]",
    "taskResult" : "Successfully created repository directories",
    "startTime" : "January 29, 2020 23:19:23 PM UTC",
    "endTime" : "January 29, 2020 23:19:23 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskSequential_1142",
    "jobId" : "29876291-5cf6-4ba0-8735-8929ad96d06c",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 23:19:23 PM UTC"
  }, {
    "taskId" : "TaskZJsonRpcExt_1146",
    "taskName" : "Download latest patch metadata[s2db]",
    "taskResult" : "Successfully downloaded latest patch metadata",
    "startTime" : "January 29, 2020 23:19:23 PM UTC",
    "endTime" : "January 29, 2020 23:19:43 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskSequential_1145",
    "jobId" : "29876291-5cf6-4ba0-8735-8929ad96d06c",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 23:19:43 PM UTC"
  }, {
    "taskId" : "TaskZJsonRpcExt_1149",
    "taskName" : "checking GiHome version[s2db]",
    "taskResult" : "Gi is up to date on node s2db",
    "startTime" : "January 29, 2020 23:19:43 PM UTC",
    "endTime" : "January 29, 2020 23:20:45 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskParallel_1148",
    "jobId" : "29876291-5cf6-4ba0-8735-8929ad96d06c",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 23:20:45 PM UTC"
  }, {
    "taskId" : "TaskZJsonRpcExt_1152",
    "taskName" : "Update System version[s2db]",
    "taskResult" : "",
    "startTime" : "January 29, 2020 23:20:45 PM UTC",
    "endTime" : "January 29, 2020 23:20:45 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskSequential_1151",
    "jobId" : "29876291-5cf6-4ba0-8735-8929ad96d06c",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 23:20:45 PM UTC"
  }, {
    "taskId" : "TaskZJsonRpcExt_1155",
    "taskName" : "Update Patching Repository[s2db]",
    "taskResult" : "Successfully updated patching repository",
    "startTime" : "January 29, 2020 23:20:45 PM UTC",
    "endTime" : "January 29, 2020 23:22:12 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskSequential_1154",
    "jobId" : "29876291-5cf6-4ba0-8735-8929ad96d06c",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 23:22:12 PM UTC"
  }, {
    "taskId" : "TaskZJsonRpcExt_1076",
    "taskName" : "Validating dbHome available space[s2db]",
    "taskResult" : "",
    "startTime" : "January 29, 2020 23:22:14 PM UTC",
    "endTime" : "January 29, 2020 23:22:14 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskSequential_1075",
    "jobId" : "29876291-5cf6-4ba0-8735-8929ad96d06c",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 23:22:14 PM UTC"
  }, {
    "taskId" : "TaskZJsonRpcExt_1098",
    "taskName" : "Opatch updation[s2db]",
    "taskResult" : "Successfully applied all actions",
    "startTime" : "January 29, 2020 23:22:14 PM UTC",
    "endTime" : "January 29, 2020 23:22:17 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskParallel_1097",
    "jobId" : "29876291-5cf6-4ba0-8735-8929ad96d06c",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 23:22:17 PM UTC"
  }, {
    "taskId" : "TaskZJsonRpcExt_1101",
    "taskName" : "Patch conflict check[s2db]",
    "taskResult" : "Successfully analyzed patch /u01/odaPatchingTempDir/30501155 for /u01/app/oracle/product/11.2.0.4/dbhome_1",
    "startTime" : "January 29, 2020 23:22:17 PM UTC",
    "endTime" : "January 29, 2020 23:24:11 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskSequential_1100",
    "jobId" : "29876291-5cf6-4ba0-8735-8929ad96d06c",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 23:24:11 PM UTC"
  }, {
    "taskId" : "TaskZJsonRpcExt_1104",
    "taskName" : "db upgrade  to version [s2db]",
    "taskResult" : "Successfully applied all actions on db home /u01/app/oracle/product/11.2.0.4/dbhome_1",
    "startTime" : "January 29, 2020 23:24:11 PM UTC",
    "endTime" : "January 29, 2020 23:33:38 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskSequential_1103",
    "jobId" : "29876291-5cf6-4ba0-8735-8929ad96d06c",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 23:33:38 PM UTC"
  }, {
    "taskId" : "TaskZJsonRpcExt_1106",
    "taskName" : "SqlPatch upgrade",
    "taskResult" : "Datapatch is not aplicable for 11g",
    "startTime" : "January 29, 2020 23:33:38 PM UTC",
    "endTime" : "January 29, 2020 23:33:47 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskSequential_1072",
    "jobId" : "29876291-5cf6-4ba0-8735-8929ad96d06c",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 23:33:47 PM UTC"
  }, {
    "taskId" : "TaskZJsonRpcExt_1112",
    "taskName" : "updating the Database version",
    "taskResult" : "successfully updated Database version",
    "startTime" : "January 29, 2020 23:33:51 PM UTC",
    "endTime" : "January 29, 2020 23:33:55 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskParallel_1111",
    "jobId" : "29876291-5cf6-4ba0-8735-8929ad96d06c",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 23:33:55 PM UTC"
  } ],
  "createTimestamp" : "January 29, 2020 23:19:23 PM UTC",
  "resourceList" : [ ],
  "description" : "DB Home Patching: Home Id is 500224b0-b425-4601-8e95-9202d7f01028",
  "updatedTime" : "January 29, 2020 23:33:56 PM UTC"
}
[root@s2db ~]# 
```



# memo : パッチ適用の順番を間違った場合

パッチ適用の順番を、Database Version  → DB System Version という誤った方法でやった場合、以下のように Failure となる

ジョブ一覧

```
[root@s2db bin]# dbcli list-jobs

ID                                       Description                                                                 Created                             Status    
---------------------------------------- --------------------------------------------------------------------------- ----------------------------------- ----------
c42eba53-b654-4e2e-87f6-ecb37d7d7e97     Provisioning service creation                                               January 29, 2020 10:55:13 AM UTC    Success   
6191e968-ccfd-45d2-9ff0-d31eb0cb2f32     SSH keys update                                                             January 29, 2020 11:23:58 AM UTC    Success   
40041626-53e5-4948-859b-01dc6ffb6e4e     SSH key delete                                                              January 29, 2020 11:25:54 AM UTC    Success   
1c57f6ac-b013-4cba-834f-9cfee35bd41c     Authentication key update for DCS_ADMIN                                     January 29, 2020 11:27:56 AM UTC    Success   
ec85f0a2-1b07-443d-9b19-354f7ca71a19     create object store:bkqDXJmEDvRwFwKnyEUV                                    January 29, 2020 11:40:47 AM UTC    Success   
b20864d8-6252-482b-a0e8-78ba7e6ac002     create backup config:bkqDXJmEDvRwFwKnyEUV_BC                                January 29, 2020 11:41:07 AM UTC    Success   
59bdbb9d-73ed-4ba8-934f-1b2016634cf6     update database : s2db                                                      January 29, 2020 11:41:41 AM UTC    Success   
166a4d03-213f-4abe-90b7-0d61f3a5504e     Create Regular-L0 Backup with TAG-DBTRegular-L015802974408954ll for Db:s2db in OSS:bkqDXJmEDvRwFwKnyEUV January 29, 2020 11:43:25 AM UTC    Success   
faf715e4-d265-45c6-bf29-fb39acde4bd3     Delete Backup for Database name: s2db_nrt1tb                                January 29, 2020 11:45:22 AM UTC    Success   
baa2d914-349f-4fc7-bb8f-d3da143e5765     DB Home Prechecks                                                           January 29, 2020 3:19:58 PM UTC     Failure   
208eae5f-0c34-4f4f-965f-51e17566f7e1     DB Home Patching: Home Id is 500224b0-b425-4601-8e95-9202d7f01028           January 29, 2020 3:43:34 PM UTC     Failure   

[root@s2db bin]# 
```



Failure になった詳細を確認

```
dbcli describe-job -i 208eae5f-0c34-4f4f-965f-51e17566f7e1 -j
```



実行例

エラーを見ると

`Found unsupported Grid Infrastructure version: 19.5.0.0.191015,\n Expected version: 19.6.0.0.200114` と表示されています。Grid Infrastructure の Version を先にアップデートする必要があります。Grid Infrastructure の Version は、OCI Console 上で、DB System の Patch を当てることでバージョンアップされます。

```
[root@s2db bin]# dbcli describe-job -i 208eae5f-0c34-4f4f-965f-51e17566f7e1 -j
{
  "jobId" : "208eae5f-0c34-4f4f-965f-51e17566f7e1",
  "status" : "Failure",
  "message" : "DCS-10204:Operation: update-dbhome failed,\n Found unsupported Grid Infrastructure version: 19.5.0.0.191015,\n Expected version: 19.6.0.0.200114 ",
  "reports" : [ {
    "taskId" : "TaskZLockWrapper_141",
    "taskName" : "DB Home Patching",
    "taskResult" : "DCS-10204:Operation: update-dbhome failed,\n Found unsupported Grid Infrastructure version: 19.5.0.0.191015,\n Expected version: 19.6.0.0.200114 ",
    "startTime" : "January 29, 2020 15:43:34 PM UTC",
    "endTime" : "January 29, 2020 15:43:56 PM UTC",
    "status" : "Failure",
    "taskDescription" : null,
    "parentTaskId" : "TaskServiceRequest_139",
    "jobId" : "208eae5f-0c34-4f4f-965f-51e17566f7e1",
    "tags" : [ ],
    "reportLevel" : "Error",
    "updatedTime" : "January 29, 2020 15:43:56 PM UTC"
  }, {
    "taskId" : "TaskZLockWrapper_142",
    "taskName" : "DB Home Patching",
    "taskResult" : "DCS-10204:Operation: update-dbhome failed,\n Found unsupported Grid Infrastructure version: 19.5.0.0.191015,\n Expected version: 19.6.0.0.200114 ",
    "startTime" : "January 29, 2020 15:43:34 PM UTC",
    "endTime" : "January 29, 2020 15:43:55 PM UTC",
    "status" : "Failure",
    "taskDescription" : null,
    "parentTaskId" : "TaskZLockWrapper_141",
    "jobId" : "208eae5f-0c34-4f4f-965f-51e17566f7e1",
    "tags" : [ ],
    "reportLevel" : "Error",
    "updatedTime" : "January 29, 2020 15:43:55 PM UTC"
  }, {
    "taskId" : "TaskSequential_123",
    "taskName" : "DB Home Patching",
    "taskResult" : "DCS-10204:Operation: update-dbhome failed,\n Found unsupported Grid Infrastructure version: 19.5.0.0.191015,\n Expected version: 19.6.0.0.200114 ",
    "startTime" : "January 29, 2020 15:43:34 PM UTC",
    "endTime" : "January 29, 2020 15:43:55 PM UTC",
    "status" : "Failure",
    "taskDescription" : null,
    "parentTaskId" : "TaskZLockWrapper_142",
    "jobId" : "208eae5f-0c34-4f4f-965f-51e17566f7e1",
    "tags" : [ ],
    "reportLevel" : "Error",
    "updatedTime" : "January 29, 2020 15:43:55 PM UTC"
  }, {
    "taskId" : "TaskZJsonRpcExt_125",
    "taskName" : "Create Patching Repository Directories[s2db]",
    "taskResult" : "Successfully created repository directories",
    "startTime" : "January 29, 2020 15:43:34 PM UTC",
    "endTime" : "January 29, 2020 15:43:34 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskSequential_124",
    "jobId" : "208eae5f-0c34-4f4f-965f-51e17566f7e1",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 15:43:34 PM UTC"
  }, {
    "taskId" : "TaskZJsonRpcExt_128",
    "taskName" : "Download latest patch metadata[s2db]",
    "taskResult" : "Successfully downloaded latest patch metadata",
    "startTime" : "January 29, 2020 15:43:34 PM UTC",
    "endTime" : "January 29, 2020 15:43:55 PM UTC",
    "status" : "Success",
    "taskDescription" : null,
    "parentTaskId" : "TaskSequential_127",
    "jobId" : "208eae5f-0c34-4f4f-965f-51e17566f7e1",
    "tags" : [ ],
    "reportLevel" : "Info",
    "updatedTime" : "January 29, 2020 15:43:55 PM UTC"
  }, {
    "taskId" : "TaskParallel_130",
    "taskName" : "task:TaskParallel_130",
    "taskResult" : "DCS-10204:Operation: update-dbhome failed,\n Found unsupported Grid Infrastructure version: 19.5.0.0.191015,\n Expected version: 19.6.0.0.200114 ",
    "startTime" : "January 29, 2020 15:43:55 PM UTC",
    "endTime" : "January 29, 2020 15:43:55 PM UTC",
    "status" : "Failure",
    "taskDescription" : null,
    "parentTaskId" : "TaskSequential_123",
    "jobId" : "208eae5f-0c34-4f4f-965f-51e17566f7e1",
    "tags" : [ ],
    "reportLevel" : "Error",
    "updatedTime" : "January 29, 2020 15:43:55 PM UTC"
  }, {
    "taskId" : "TaskZJsonRpcExt_131",
    "taskName" : "checking GiHome version[s2db]",
    "taskResult" : "DCS-10204:Operation: update-dbhome failed,\n Found unsupported Grid Infrastructure version: 19.5.0.0.191015,\n Expected version: 19.6.0.0.200114 ",
    "startTime" : "January 29, 2020 15:43:55 PM UTC",
    "endTime" : "January 29, 2020 15:43:55 PM UTC",
    "status" : "Failure",
    "taskDescription" : null,
    "parentTaskId" : "TaskParallel_130",
    "jobId" : "208eae5f-0c34-4f4f-965f-51e17566f7e1",
    "tags" : [ ],
    "reportLevel" : "Error",
    "updatedTime" : "January 29, 2020 15:43:55 PM UTC"
  } ],
  "createTimestamp" : "January 29, 2020 15:43:34 PM UTC",
  "resourceList" : [ ],
  "description" : "DB Home Patching: Home Id is 500224b0-b425-4601-8e95-9202d7f01028",
  "updatedTime" : "January 29, 2020 15:43:56 PM UTC"
}
[root@s2db bin]# 
```

Oracle DB インスタンスが停止しているので、SQL*Plus でログインして起動します

```
[oracle@osakadbb ~]$ sqlplus / as sysdba                    

SQL*Plus: Release 11.2.0.4.0 Production on Tue Feb 11 08:38:40 2020

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

Connected to an idle instance.

SQL> STARTUP
ORACLE instance started.

Total System Global Area 8017100800 bytes
Fixed Size                  2269072 bytes
Variable Size            1375731824 bytes
Database Buffers         6610223104 bytes
Redo Buffers               28876800 bytes
Database mounted.
Database opened.
SQL> exit        
```




# 参考URL

https://qiita.com/ts_carp/items/d4e3632535cf0bc411bb