Oracle Database Release Update by Using Ansible Playbooks
Ansible to Rule Them All
In this post,
I will use blt01 host as the ansible host. Target environment is a two node RAC database. (gns01, gns02). I will patch grid software to 19.22 by using out-of-place methodology with no down time.
Although, there are lots of useful blog posts about how you may use Ansible for automating tasks, there is not much about a complete Oracle database software patching.
Ansible is simply installed by "yum install ansible" from EPEL repository. Add your hosts(gns01, gns02) in the hosts file under /etc/ansible/hosts and create ssh equivalency for oracle and root users.
We need:
* OPatch - p6880880_122010_Linux-x86-64.zip
* 19.22 RU - p35940989_190000_Linux-x86-64.zip (GIRU System Patch involves DBRU)
* A sample one-off patch (555.1 Recommended) - p34672698_1922000DBRU_Linux-x86-64.zip
* OJVM patch (555.1 Recommended) - p35926646_190000_Linux-x86-64.zip
All database software patching is complete. It is a wonderful example of automate-first approach. With this approach, you decrease chances of human error and increase productivity.
-----------------------------
Revised on March 23, 2024;
I have incorporated valuable feedback and revised all my playbooks to adhere to some best practices.
* Ensured that all tasks consistently refer to the same variables.
* Improved the playbook's readability and formatting for better clarity.
* Replaced some shell module commands with the cmd module for better compatibility and robustness.
* Replaced unzip commands with the unarchive module for better management of archives.
* Converted Ansible variables to lowercase for consistency and clarity.
* Adopted the ansible.builtin format for built-in modules to ensure compatibility across different Ansible versions, enhance readability, future-proof playbooks, and prevent potential conflicts with custom or user-defined modules.
Also, consolidated all playbooks into a single file as shown below.
Hope it helps.
Comments
Post a Comment