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 RAC Switchover & Switchback: Step-by-Step Guide

 Ensuring business continuity requires regular Disaster Recovery (DR) drills. This guide covers the Switchover and Switchback process between Primary (DC) and Standby (DR) databases . Pre-checks Before Performing Switchover Before starting the activity, ensure there are no active sessions in the database. If any are found, share the session details with the application team, get their confirmation, and terminate the sessions. Primary Database Name: PRIMARY Standby Database Name: STANDBY  Identify Active Sessions set lines 999 pages 999 col machine for a30 col username for a30 col program for a30 compute sum of count on report break on report select inst_id,username,osuser,machine,program,status,count(1) "count" from gv$session where inst_id=1 and program like 'JDBC%' group by inst_id,username,osuser,machine,program,status order by 1,2; select inst_id,username,osuser,machine,program,status,count(1) "count" from gv$session where inst_id=2 and program lik...

Mastering Oracle RAC with SRVCTL Commands

Oracle Real Application Clusters (RAC) provide high availability, scalability, and manageability for databases. One of the most powerful tools for managing RAC databases is srvctl , a command-line utility that allows administrators to control various database services. This blog explores essential srvctl commands to help you efficiently manage Oracle RAC environments. 1. Checking Database Configuration and Status  List all available databases on the host:                  srvctl config database   Check the status of a specific database and its instances:                    srvctl status database -d <database_name>   Retrieve detailed status information about a database, including its instances and states:                    srvctl status database -d <database_name> -v 2. Stopping and Starting Databases   ...