Skip to main content

🚀Automating Oracle GoldenGate 21c Silent Installation with Ansible🚀

Oracle GoldenGate 21c using Ansible

🔧 Automating Oracle GoldenGate 21c Silent Installation with Ansible

This blog post walks you through the silent installation of Oracle GoldenGate 21c on Linux using an Ansible playbook. Automation is key to efficient software deployment, and Ansible provides a powerful and agentless way to manage your infrastructure and applications. This playbook streamlines the GoldenGate installation process, ensuring consistency and reducing manual errors.

Prerequisites

Before you begin, ensure you have the following:

  • Ansible Installed: You need to have Ansible installed and configured on your control machine.
  • Target Hosts Configured: Your target Linux hosts where you want to install GoldenGate should be accessible via SSH from your Ansible control machine.
  • Oracle GoldenGate 21c Software: Download the Oracle GoldenGate 21c software (e.g., 213000_fbo_ggs_Linux_x64_Oracle_shiphome.zip) and have it accessible on your Ansible control machine or a location accessible by the target hosts.
  • Oracle Database Installed: An existing Oracle Database installation (in this example, 19.3.0) is required as GoldenGate often interacts with a database.
  • User and Group: Ensure the specified user (ggudb) and group (oinstall) exist on the target hosts.

Ansible Playbook Breakdown

Below is the Ansible playbook used for the silent installation:

---
- name: Install Oracle GoldenGate 21c in Silent Mode
  hosts: "{{ hostlist }}"
  become: yes
  vars:
    ogg_user: ggudb
    ogg_group: oinstall
    ogg_zip_file: 213000_fbo_ggs_Linux_x64_Oracle_shiphome.zip
    ogg_base_dir: /acfs01/ogg21c
    ogg_home: /opt/app/ogg21c
    oracle_home: /opt/oracle/product/19.3.0/db_1
    inventory_location: /opt/app/oraInventory
    response_file_path: "{{ ogg_base_dir }}/fbo_ggs_Linux_x64_Oracle_shiphome/Disk1/response/oggcore.rsp"
    manager_port: 7809

  tasks:

    - name: Ensure base and target directories exist
      file:
        path: "{{ item }}"
        state: directory
        owner: "{{ ogg_user }}"
        group: "{{ ogg_group }}"
        mode: '0755'
      loop:
        - "{{ ogg_base_dir }}"
        - "{{ ogg_home }}"
        - "{{ inventory_location }}"

    - name: Copy GoldenGate ZIP file to target
      copy:
        src: "{{ ogg_zip_file }}"
        dest: "{{ ogg_base_dir }}/{{ ogg_zip_file }}"
        owner: "{{ ogg_user }}"
        group: "{{ ogg_group }}"
        mode: '0644'

    - name: Unzip GoldenGate software
      unarchive:
        src: "{{ ogg_base_dir }}/{{ ogg_zip_file }}"
        dest: "{{ ogg_base_dir }}"
        remote_src: yes
        owner: "{{ ogg_user }}"
        group: "{{ ogg_group }}"

    - name: Create response file for silent install
      copy:
        dest: "{{ response_file_path }}"
        content: |
          oracle.install.responseFileVersion=/oracle/install/rspfmt_ogginstall_response_schema_v21_1_0
          INSTALL_OPTION=ORA21c
          SOFTWARE_LOCATION={{ ogg_home }}
          START_MANAGER=FALSE
          MANAGER_PORT={{ manager_port }}
          DATABASE_LOCATION={{ oracle_home }}
          INVENTORY_LOCATION={{ inventory_location }}
          UNIX_GROUP_NAME={{ ogg_group }}
        owner: "{{ ogg_user }}"
        group: "{{ ogg_group }}"
        mode: '0644'

    - name: Run GoldenGate silent installer
      command: >
        ./runInstaller -silent -showprogress -waitforcompletion -ignoreSysPrereqs
        -responseFile {{ response_file_path }}
      args:
        chdir: "{{ ogg_base_dir }}/fbo_ggs_Linux_x64_Oracle_shiphome/Disk1"
      become_user: "{{ ogg_user }}"

Let's break down the playbook:

  1. <strong><code>---</code></strong>: Indicates the start of a YAML document.
  2. <strong><code>- name: Install Oracle GoldenGate 21c in Silent Mode</code></strong>: A descriptive name for the playbook.
  3. <strong><code>hosts: "{{ hostlist }}"</code></strong>: Specifies the target hosts where the playbook will run. The hostlist variable should be defined in your Ansible inventory or via command-line arguments.
  4. <strong><code>become: yes</code></strong>: Enables privilege escalation (using sudo) to perform administrative tasks.
  5. <strong><code>vars:</code></strong>: Defines variables used throughout the playbook, making it easier to customize and manage.
    • ogg_user: The user who will own the GoldenGate installation files.
    • ogg_group: The group for the GoldenGate installation files.
    • ogg_zip_file: The name of the GoldenGate software ZIP file.
    • ogg_base_dir: The base directory where the GoldenGate software will be copied and extracted.
    • ogg_home: The actual GoldenGate home directory where the software will be installed.
    • oracle_home: The home directory of your existing Oracle Database installation.
    • inventory_location: The location for the Oracle inventory directory.
    • response_file_path: The full path to the GoldenGate silent installation response file.
    • manager_port: The port number for the GoldenGate Manager process.
  6. <strong><code>tasks:</code></strong>: A list of tasks to be executed on the target hosts.
    • <strong><code>Ensure base and target directories exist</code></strong>: This task uses the file module to create the necessary directories (ogg_base_dir, ogg_home, inventory_location) if they don't exist. It also sets the ownership, group, and permissions for these directories. The loop directive iterates through the list of directories.
    • <strong><code>Copy GoldenGate ZIP file to target</code></strong>: This task uses the copy module to transfer the GoldenGate software ZIP file from the Ansible control machine (or a specified src path) to the target host's ogg_base_dir. It also sets the ownership, group, and permissions for the copied file.
    • <strong><code>Unzip GoldenGate software</code></strong>: This task uses the unarchive module to extract the contents of the GoldenGate ZIP file in the ogg_base_dir. remote_src: yes indicates that the source file is already on the remote host. Ownership and group are also set for the extracted files.
    • <strong><code>Create response file for silent install</code></strong>: This task uses the copy module with the content parameter to create the silent installation response file (oggcore.rsp) on the target host. This file contains the necessary parameters for a silent, non-interactive installation. The variables defined earlier are used to populate the response file.
    • <strong><code>Run GoldenGate silent installer</code></strong>: This task uses the command module to execute the GoldenGate installer (runInstaller) in silent mode.
      • -silent: Enables silent installation.
      • -showprogress: Displays the installation progress.
      • -waitforcompletion: Waits for the installer to finish.
      • -ignoreSysPrereqs: Skips system prerequisite checks (use with caution in production environments).
      • -responseFile {{ response_file_path }}: Specifies the path to the response file created in the previous task.
      • args: chdir: Sets the working directory for the command to the location of the runInstaller executable.
      • become_user: "{{ ogg_user }}": Executes the installer as the specified ogg_user.

How to Run the Playbook

  1. Save the playbook: Save the above content as a YAML file (e.g., install_ogg.yml).
  2. Configure your inventory: Create an Ansible inventory file (e.g., inventory) that lists your target hosts under the group defined in the hosts section of the playbook (or use a variable like hostlist and provide it during execution).
  3. Run the playbook: Execute the playbook from your Ansible control machine using the ansible-playbook command:
    ansible-playbook -i inventory install_ogg.yml -e "hostlist=your_target_hosts"

    Replace inventory with the name of your inventory file and your_target_hosts with the actual hostname(s) or group name from your inventory. If you've defined hostlist directly in your inventory, you can omit the -e option.

Conclusion

This Ansible playbook provides a robust and repeatable way to silently install Oracle GoldenGate 21c. By leveraging the power of Ansible, you can automate this process across multiple servers, ensuring consistency and saving valuable time and effort. Remember to adjust the variables in the playbook to match your specific environment and requirements. This automation approach is crucial for managing and deploying complex software like Oracle GoldenGate efficiently.

Comments

Popular posts from this blog

🚀 Automating Oracle Database Patching with Ansible: A Complete Guide

Oracle database patching has long been the bane of DBAs everywhere. It's a critical task that requires precision, expertise, and often results in extended maintenance windows. What if I told you that you could automate this entire process, reducing both risk and downtime while ensuring consistency across your Oracle estate? 💡 In this comprehensive guide, I'll walk you through a production-ready Ansible playbook that completely automates Oracle patch application using OPatch. Whether you're managing a single Oracle instance or hundreds of databases across your enterprise, this solution will transform your patch management strategy! 🎯 🔥 The Challenge: Why Oracle Patching is Complex Before diving into the solution, let's understand why Oracle patching is so challenging: 🔗 Multiple dependencies : OPatch versions, Oracle Home configurations, running processes ⚠️ Risk of corruption : Incorrect patch application can render databases unusable ⏰ Downtime requirements : Da...

🐳Oracle 19c Database Deployment with Docker

Oracle 19c Database Deployment with Docker 🐳 Oracle 19c Database Deployment with Docker Welcome to this comprehensive guide on deploying, configuring, and managing Oracle 19c Database using Docker containers. This blog will walk you through the entire process from setup to production best practices with practical code examples. Docker provides an excellent way to run Oracle databases in isolated, portable containers, making it easy to deploy and manage Oracle 19c instances for development, testing, and production environments. This approach offers numerous benefits: 🔒 Isolation : Run Oracle in a containerized environment without affecting your host system 🚚 Portability : Easily move your database between different environments 🔄 Reproducibility : Quickly spin up identical database instances ⚡ Resource Efficiency : Use Docker's resource management capabilities to control CPU, memory, and stor...

Mastering Oracle RAC with CRSCTL commands

Mastering Oracle Clusterware Administration: Essential Commands & Best Practices Oracle Clusterware is a key component for managing cluster environments, ensuring high availability and resource management for Oracle databases. Below are essential commands for managing Oracle Clusterware effectively. What is crsctl? crsctl (Cluster Ready Services Control) is a command-line utility provided by Oracle to manage Oracle Clusterware. It allows administrators to start, stop, check, and configure various aspects of cluster services. With crsctl , DBAs can control cluster resources, manage voting disks, check the status of Oracle High Availability Services, and ensure the proper functioning of Oracle RAC environments. Starting and Stopping Oracle Clusterware On Local Node Stop Clusterware: crsctl stop cluster Start Clusterware: crsctl start cluster On RAC Standalone/Oracle Restart Stop Cluster: crsctl stop has Start Cluster: crsctl start has On All Nodes or All Hub Nodes Start Clusterware:...