Oracle DB Day 2 Operations using Ansible Tower



Oracle DB Day 2 Operations using Ansible Tower

Oracle DB Day 2 Operations using Ansible Tower

This video shows the possibilities of using Ansible Tower to manage Day 2 operations of the Oracle DB.

All the relevant playbooks can be found at the following link,
https://github.com/eanylin/ansible-lab/tree/master/oracle_db_management_demo

The actual flow of the video is as follows:

1) We start off by showing the version of Oracle DB, i.e. 11g Express Edition 11.2.0.2.0
2) The DB engineer logs into Ansible Tower as ‘db_engineer’ user (RBAC control in terms of playbooks that a user can see/access)
3) The DB engineer execute ‘describe’ on table ’employees’ which does not exists
4) Playbook is able to perform error handling and report back on the failed query
5) The DB engineer makes use of playbook to execute SQL script to kick off the creation of the ’employees’ table. This is to demonstrate that the DBA can run a SQL script on the DB as part of Day-2 operation. The SQL script will be in the form of a Jinja2 template that allows variable substitution. The SQL script will then be transferred to the Oracle DB for execution.
6) The ’employees’ table gets created upon successful execution of SQL script. The DB engineer will relaunch the failed query task from earlier. The task will go through successfully this time round.
7) The DB engineer will move on to create a new entry into the ’employees’ table
8) The DB engineer will proceed to check creation of entry using ‘select’ statement. We can see that the 7th entry was created from previous action
9) The DB engineer will then move on to update an entry in the ’employees’ table. The scenario is such that Ron (employee id 6) was promoted to the title of Senior Engineer and will be moving from the Engineering department to the Technology department.
10) The DB engineer deletes the employee with emp_id 7 from the ’employees’ table
11) The DB engineer proceeds to backup the DB (which can be used in future to restore corrupted DB or for other purposes)