|
| 1 | +# Apply AHF Metadata and Framework Updates |
| 2 | + |
| 3 | +## Introduction |
| 4 | + |
| 5 | +In this lab, you will learn how to apply AHF metadata and framework updates, and rollback to the previous timestamp when needed. |
| 6 | + |
| 7 | +Estimated Time: 30 minutes |
| 8 | + |
| 9 | +### Objectives |
| 10 | + |
| 11 | +In this lab, you will: |
| 12 | +* Apply AHF framework and metadata updates |
| 13 | +* Query AHF framework and metadata updates |
| 14 | +* Rollback AHF framework and metadata updates |
| 15 | +* Cleanup AHF metadata backup directories |
| 16 | + |
| 17 | +### Prerequisites |
| 18 | + |
| 19 | +This lab assumes you have: |
| 20 | +* AHF install user privileges to run the **applyupdate**, **queryupdate**, **rollbackupdate**, and **deleteupdatebackup** commands. |
| 21 | + |
| 22 | +**Note:** You must have installed 22.1.1 to apply the AHF framework and metadata updates. |
| 23 | + |
| 24 | +``` |
| 25 | +<copy> |
| 26 | +.-------------------------------------------------------------------------------. |
| 27 | +| Host | Status of TFA | PID | Port | Version | Build ID | |
| 28 | ++----------+---------------+--------+-------+------------+----------------------+ |
| 29 | +| den02mwa | RUNNING | 105916 | 59452 | 22.1.1.0.0 | 22100020220130232427 | |
| 30 | +'----------+---------------+--------+-------+------------+----------------------' |
| 31 | +</copy> |
| 32 | +``` |
| 33 | + |
| 34 | +## Task 1: Apply AHF Framework and Metadata Updates |
| 35 | + |
| 36 | +You must apply metadata and framework updates to all cluster nodes. |
| 37 | + |
| 38 | +1. To update metadata and framework files on the local node from the zip file provided: |
| 39 | + |
| 40 | + ``` |
| 41 | + <copy> |
| 42 | + ahfctl applyupdate -updatefile /home/opc/Downloads/ahf_data_20220602.zip |
| 43 | + Updated file /opt/oracle.ahf/orachk/.cgrep/collections.dat |
| 44 | + Updated file /opt/oracle.ahf/orachk/rules.dat |
| 45 | + Updated file /opt/oracle.ahf/orachk/.cgrep/versions.dat |
| 46 | + Updated file /opt/oracle.ahf/orachk/messages/check_messages.json |
| 47 | + Data files updated to 20220602 from 20220516 |
| 48 | + </copy> |
| 49 | + ``` |
| 50 | +
|
| 51 | +## Task 2: Query AHF Framework and Metadata Updates |
| 52 | +
|
| 53 | +Query the metadata updates using the **-all** option and the framework updates using **-updateid**. |
| 54 | +
|
| 55 | +To verify if the metadata and framework updates were applied to all nodes in a cluster, run the **ahfctl queryupdate** command as the AHF install user on each cluster node. |
| 56 | +
|
| 57 | +1. To check if an update was applied on the local node: |
| 58 | +
|
| 59 | + ``` |
| 60 | + <copy> |
| 61 | + ahfctl queryupdate -all |
| 62 | + AHF Metadata Update: 20220602 |
| 63 | + Status: Applied |
| 64 | + Applied on: Mon Jun 6 00:23:14 2022 |
| 65 | + </copy> |
| 66 | + ``` |
| 67 | +
|
| 68 | +## Task 3: Rollback AHF Framework and Metadata Updates |
| 69 | +
|
| 70 | +Use the **ahfctl rollbackupdate** command to rollback the updates with a specific update ID applied to the local node. If you do not specify the update ID, then AHF rolls back to the previous state by default. |
| 71 | +
|
| 72 | +To rollback the metadata and framework updates applied to all nodes in a cluster, you must run the **ahfctl rollbackupdate** command as the AHF install user on each cluster node. |
| 73 | +
|
| 74 | +1. To rollback the metadata and framework updates: |
| 75 | +
|
| 76 | + ``` |
| 77 | + <copy> |
| 78 | + ahfctl rollbackupdate -updateid 20220602 |
| 79 | + Data files with timestamp 20220602 identified. Rolling back the files to Production version 20220516 |
| 80 | + Rolled back the data files 20220602 to Production version 20220516 |
| 81 | + </copy> |
| 82 | + ``` |
| 83 | +
|
| 84 | +## Task 4: Cleanup AHF Metadata Backup Directories |
| 85 | +
|
| 86 | +To delete the backup directories on all nodes in a cluster, you must run the **ahfctl deletebackup** command as the AHF install user on each cluster node. |
| 87 | +
|
| 88 | +You must not delete the backup directories randomly. Oracle recommends deleting the backup directories in the same order the updates were applied. If you delete the backup directories associated with a specific timestamp, then you will not be able to roll back to the state before the updates with that specific timestamp were applied. |
| 89 | +
|
| 90 | +Upgrading AHF using the **ahf_setup** script automatically deletes the backup directories of the previous AHF versions. |
| 91 | +
|
| 92 | +1. To delete the backup directories: |
| 93 | +
|
| 94 | + ``` |
| 95 | + <copy> |
| 96 | + ahfctl deleteupdatebackup -updateid 20220602 |
| 97 | + No metadata update applied. |
| 98 | + </copy> |
| 99 | + ``` |
| 100 | +
|
| 101 | +## Learn More |
| 102 | +
|
| 103 | +* [ahfctl applyupdate](https://docs.oracle.com/en/engineered-systems/health-diagnostics/autonomous-health-framework/ahfug/ahfctl-applyupdate.html#GUID-1C582851-0138-419D-8CBC-D9F83B97A6AC) |
| 104 | +* [ahfctl queryupdate](https://docs-uat.us.oracle.com/en/engineered-systems/health-diagnostics/autonomous-health-framework/ahfug/ahfctl-queryupdate.html#GUID-C02F4087-184F-4EF7-B94F-8987F9E192B2) |
| 105 | +* [ahfctl rollbackupdate](https://docs.oracle.com/en/engineered-systems/health-diagnostics/autonomous-health-framework/ahfug/ahfctl-rollbackupdate.html#GUID-63CC64FF-3D4D-425B-9484-6237D3AC3FD0) |
| 106 | +* [ahfctl deleteupdatebackup](https://docs-uat.us.oracle.com/en/engineered-systems/health-diagnostics/autonomous-health-framework/ahfug/ahfctl-deletebackup.html#GUID-154BA5AA-40EF-45BF-8154-B4000718A35D) |
| 107 | +
|
| 108 | +## Acknowledgements |
| 109 | +* **Author** - Nirmal Kumar |
| 110 | +* **Contributors** - Sarahi Partida, Robert Pastijn, Girdhari Ghantiyala, Anuradha Chepuri |
| 111 | +* **Last Updated By/Date** - Nirmal Kumar, June 2022 |
0 commit comments