Install Oracle GoldenGate 23ai on Linux

This post shows how to Install Oracle GoldenGate 23ai on RedHat Enterprise Linux 8.10 (silent) for replication from or to Oracle Databases. After we did the base installation we will also apply the current RU patch 23.5. As a final step we add a user deployment.

Preparation

After we setup a new Linux VM we can download the zip file from Oracle (choose Oracle GoldenGate 23.4.1.24.05 on Linux x86-64 for Oracle) to a location that is accessible from the VM (e.g. /sw/ora_GoldenGate/GoldenGate/gg234/V1042871-01.zip).

create OS user, OS directories and extract the installer files

# create an Oracle GoldenGate OS user if it does not exist
id ogg >/dev/null 2>&1; if [[ $? -ne 0 ]] ; then
 echo 'creating user ogg and group oinstall'
 groupadd -g 2000 oinstall
 useradd -u 2002 -g 2000 -G vboxsf ogg && echo 'ogg:changeme'|chpasswd
 echo "ORACLE_HOME=/u01/app/ogg/ogg23ai_ora
 PATH=\$ORACLE_HOME/OPatch:\$ORACLE_HOME/bin:/u01/app/ogg/deplsm/bin:\$PATH
 OGG_HOME=/u01/app/ogg/ogg23ai_ora
 OGG_ETC_HOME=/u01/app/ogg/deplsm/etc
 OGG_VAR_HOME=/u01/app/ogg/deplsm/var
 export ORACLE_HOME PATH OGG_HOME OGG_ETC_HOME OGG_VAR_HOME" >> ~ogg/ogg_ora.env
 chown ogg:oinstall ~ogg/ogg_ora.env
else
 echo 'user ogg already exists'
fi
# create OS directories
mkdir -p /u01/app/ogg/ogg23ai_ora
chown ogg:oinstall /u01 && chown ogg:oinstall /u01/app && chown -R ogg:oinstall /u01/app/ogg
chmod 775 /u01 && chmod 775 /u01/app && chmod -R 775 /u01/app/ogg
# extract the installer files if needed
su - ogg -c "[[ -d /sw/ora_GoldenGate/GoldenGate/gg234/ora ]] || (mkdir /sw/ora_GoldenGate/GoldenGate/gg234/ora && unzip -q /sw/ora_GoldenGate/GoldenGate/gg234/V1042871-01.zip -d /sw/ora_GoldenGate/GoldenGate/gg234/ora)"

Install Oracle GoldenGate 23ai

These commands will perform a silent installation using a response file:

# create response file
echo "oracle.install.responseFileVersion=/oracle/install/rspfmt_ogginstall_response_schema_v23_1_0
INSTALL_OPTION=ORA23ai
SOFTWARE_LOCATION=/u01/app/ogg/ogg23ai_ora
INVENTORY_LOCATION=/u01/app/oraInventory
UNIX_GROUP_NAME=oinstall" > ~ogg/ogg.rsp && chown ogg:oinstall ~ogg/ogg.rsp
# start installer
su - ogg -c ". ~/ogg_ora.env && /sw/ora_GoldenGate/GoldenGate/gg234/ora/fbo_ggs_Linux_x64_Oracle_services_shiphome/Disk1/runInstaller -silent -showProgress -responseFile /home/ogg/ogg.rsp"
while [ `ps -eaf|grep 'oracle.installer'|grep -v grep|wc -l` -ne 0 ] ; do sleep 1 ; done && echo -e '\n'
# only needed if that is the first Oracle Product installed on this system, but otherwise doesn't hurt to run it
/u01/app/oraInventory/orainstRoot.sh

Patch Oracle GoldenGate 23ai

The base install of Oracle GoldenGate 23ai Linux is now ready. Next we will update Oracle Golden Gate from 23.4 to 23.5 (current RU). We need a current version of the OPatch utility (Patch 6880880) available to the VM as /sw/ora_GoldenGate/GoldenGate/opatch/p6880880_230000_LINUX.zip and the Patch 36878982 available to the VM via /sw/ora_GoldenGate/GoldenGate/patch/gg235/oracle/p36878982_23512407OGGRU_Linux-x86-64.zip Now we will start patching:

# unpack files if needed
su - ogg -c "SWPATH=/sw/ora_GoldenGate/GoldenGate/patch/gg235/oracle/p36878982_23512407OGGRU_Linux-x86-64 ; [[ -d \$SWPATH ]] || (unzip -q /sw/ora_GoldenGate/GoldenGate/patch/gg235/oracle/p36878982_23512407OGGRU_Linux-x86-64.zip -d \$SWPATH)"
# update OPatch
su - ogg -c ". ~/ogg_ora.env ; opatch version|grep Version" # check current version
su - ogg -c ". ~/ogg_ora.env ; cd \$ORACLE_HOME && mv OPatch OPatch_old && unzip -q /sw/ora_GoldenGate/GoldenGate/opatch/p6880880_230000_LINUX.zip"
su - ogg -c ". ~/ogg_ora.env ; opatch version|grep Version" # check new version
## start patching ##
# check the current version
su - ogg -c ". ~/ogg_ora.env && echo exit|adminclient versions|grep ^Version"
# check for conflicts
su - ogg -c "PPATH=/sw/ora_GoldenGate/GoldenGate/patch/gg235/oracle/p36878982_23512407OGGRU_Linux-x86-64 ; . ~/ogg_ora.env && opatch prereq CheckConflictAgainstOHWithDetail -ph \$PPATH/36878982"
# apply patch
su - ogg -c "PPATH=/sw/ora_GoldenGate/GoldenGate/patch/gg235/oracle/p36878982_23512407OGGRU_Linux-x86-64 ; . ~/ogg_ora.env && opatch apply -silent \$PPATH/36878982"
# check the new version
su - ogg -c ". ~/ogg_ora.env && echo exit|adminclient versions|grep ^Version" && rm -rf /u01/app/ogg/deplsm

Add and Remove Deployments

The first time we install a deployment on a host, we need to create the Service Manager. If a Service Manager already exists we just need to add the User Deployment. One host should only consist of one Service Manager.

Add a User Deployment and a Service Manager

For this deployment we need the root CA, server and client (client1) certificates. You can create these certificates as the user ogg as described here. The name of the new Service Manager deployment will be deplsm.

(read -p 'Please enter the name of the first User deployment (e.g. depl1): ' dname
hport=`netstat -an|grep LISTEN|grep ^tcp|grep :90|awk -F: {'print $4'}|sort -n|tail -1`
su - ogg -c "mkdir -p /home/ogg/tns /u01/app/ogg/$dname\_DS"
sname=`hostname|awk -F. {'print $1'}`
# create response file
echo "oracle.install.responseFileVersion=/oracle/install/rspfmt_oggca_response_schema_v23_1_0
CONFIGURATION_OPTION=ADD
DEPLOYMENT_NAME=$dname
ADMINISTRATOR_USER=ggma
DEPLOYMENT_ADMINISTRATOR_USER=ggadmin$dname
SERVICEMANAGER_DEPLOYMENT_HOME=/u01/app/ogg/deplsm
SERVICEMANAGER_ETC_HOME=/u01/app/ogg/deplsm/etc
SERVICEMANAGER_CONF_HOME=/u01/app/ogg/deplsm/etc/conf
SERVICEMANAGER_SSL_HOME=/u01/app/ogg/deplsm/etc/ssl
SERVICEMANAGER_VAR_HOME=/u01/app/ogg/deplsm/var
SERVICEMANAGER_DATA_HOME=/u01/app/ogg/deplsm/var/lib/data
SERVICEMANAGER_ARCHIVE_HOME=/u01/app/ogg/deplsm/var/lib/archive
HOST_SERVICEMANAGER=`hostname`
PORT_SERVICEMANAGER=9000
SECURITY_ENABLED=true
STRONG_PWD_POLICY_ENABLED=false
CREATE_NEW_SERVICEMANAGER=true
REGISTER_SERVICEMANAGER_AS_A_SERVICE=true
INTEGRATE_SERVICEMANAGER_WITH_XAG=false
EXISTING_SERVICEMANAGER_IS_XAG_ENABLED=false
ENABLE_SERVICE_MANAGER_REMOTE_METRICS=false
SERVICE_MANAGER_REMOTE_METRICS_LISTENING_PORT=0
CONFIGURATION_SERVICE_ENABLED=false
CONFIGURATION_SERVICE_BACKEND_TYPE=FILESYSTEM
OGG_SOFTWARE_HOME=/u01/app/ogg/ogg23ai_ora
OGG_DEPLOYMENT_HOME=/u01/app/ogg/$dname
OGG_ETC_HOME=/u01/app/ogg/$dname/etc
OGG_CONF_HOME=/u01/app/ogg/$dname/etc/conf
OGG_SSL_HOME=/u01/app/ogg/$dname/etc/ssl
OGG_VAR_HOME=/u01/app/ogg/$dname/var
OGG_DATA_HOME=/u01/app/ogg/$dname/var/lib/data
OGG_ARCHIVE_HOME=/u01/app/ogg/$dname/var/lib/archive
ENV_LD_LIBRARY_PATH=\${OGG_HOME}/lib/instantclient:\${OGG_HOME}/lib
ENV_TNS_ADMIN=/home/ogg/tns
TLS_1_2_ENABLED=false
TLS_1_3_ENABLED=true
FIPS_ENABLED=false
SERVER_CERTIFICATE=/home/ogg/keys/$sname""_cert.pem
SERVER_CERTIFICATE_KEY_FILE=/home/ogg/keys/$sname""_key.pem
SERVER_CA_CERTIFICATES_FILE=/home/ogg/keys/ca_cert.pem
CLIENT_CERTIFICATE=/home/ogg/keys/client1_cert.pem
CLIENT_CERTIFICATE_KEY_FILE=/home/ogg/keys/client1_key.pem
CLIENT_CA_CERTIFICATES_FILE=/home/ogg/keys/ca_cert.pem
ADMINISTRATION_SERVER_ENABLED=true
PORT_ADMINSRVR=9001
DISTRIBUTION_SERVER_ENABLED=true
PORT_DISTSRVR=9002
NON_SECURE_DISTSRVR_CONNECTS_TO_SECURE_RCVRSRVR=false
RECEIVER_SERVER_ENABLED=true
PORT_RCVRSRVR=9003
METRICS_SERVER_ENABLED=true
METRICS_SERVER_IS_CRITICAL=false
PORT_PMSRVR=9004
PMSRVR_DATASTORE_TYPE=BDB
PMSRVR_DATASTORE_HOME=/u01/app/ogg/$dname""_DS
ENABLE_DEPLOYMENT_REMOTE_METRICS=false
DEPLOYMENT_REMOTE_METRICS_LISTENING_PORT=0
OGG_SCHEMA=GGADMIN
ADMINISTRATOR_PASSWORD=changeme
DEPLOYMENT_ADMINISTRATOR_PASSWORD=changeme" > ~ogg/oggca.rsp && chown ogg:oinstall ~ogg/oggca.rsp
# start installer
su - ogg -c '. ~/ogg_ora.env && oggca.sh -silent -responseFile /home/ogg/oggca.rsp'
/u01/app/ogg/deplsm/bin/registerServiceManager.sh
su - ogg -c '. ~/ogg_ora.env && $OGG_HOME/bin/oggca.sh -silent -checkpoint -responseFile /home/ogg/oggca.rsp')
The error message "bash: /bin/oggca.sh: No such file or directory" at the end should be ignored.

Add a User Deployment to an already existing Service Manager

The script will automatically select the 4 ports.

(read -p 'Please enter the name of the new deployment (e.g. depl2): ' dname
hport=`netstat -an|grep LISTEN|grep ^tcp|grep :90|awk -F: {'print $4'}|sort -n|tail -1`
su - ogg -c "mkdir -p /u01/app/ogg/$dname\_DS"
sname=`hostname|awk -F. {'print $1'}`
# create response file
echo "oracle.install.responseFileVersion=/oracle/install/rspfmt_oggca_response_schema_v23_1_0
CONFIGURATION_OPTION=ADD
DEPLOYMENT_NAME=$dname
ADMINISTRATOR_USER=ggma
DEPLOYMENT_ADMINISTRATOR_USER=ggadmin$dname
HOST_SERVICEMANAGER=127.0.0.1
PORT_SERVICEMANAGER=9000
SECURITY_ENABLED=true
STRONG_PWD_POLICY_ENABLED=false
CREATE_NEW_SERVICEMANAGER=false
REGISTER_SERVICEMANAGER_AS_A_SERVICE=false
INTEGRATE_SERVICEMANAGER_WITH_XAG=false
EXISTING_SERVICEMANAGER_IS_XAG_ENABLED=false
ENABLE_SERVICE_MANAGER_REMOTE_METRICS=false
SERVICE_MANAGER_REMOTE_METRICS_LISTENING_PORT=0
CONFIGURATION_SERVICE_ENABLED=false
CONFIGURATION_SERVICE_BACKEND_TYPE=FILESYSTEM
OGG_SOFTWARE_HOME=/u01/app/ogg/ogg23ai_ora
OGG_DEPLOYMENT_HOME=/u01/app/ogg/$dname
OGG_ETC_HOME=/u01/app/ogg/$dname/etc
OGG_CONF_HOME=/u01/app/ogg/$dname/etc/conf
OGG_SSL_HOME=/u01/app/ogg/$dname/etc/ssl
OGG_VAR_HOME=/u01/app/ogg/$dname/var
OGG_DATA_HOME=/u01/app/ogg/$dname/var/lib/data
OGG_ARCHIVE_HOME=/u01/app/ogg/$dname/var/lib/archive
ENV_LD_LIBRARY_PATH=${OGG_HOME}/lib/instantclient:${OGG_HOME}/lib
ENV_TNS_ADMIN=/home/ogg/tns
TLS_1_2_ENABLED=false
TLS_1_3_ENABLED=true
FIPS_ENABLED=false
SERVER_CERTIFICATE=/home/ogg/keys/$sname""_cert.pem
SERVER_CERTIFICATE_KEY_FILE=/home/ogg/keys/$sname""_key.pem
SERVER_CA_CERTIFICATES_FILE=/home/ogg/keys/ca_cert.pem
CLIENT_CERTIFICATE=/home/ogg/keys/client1_cert.pem
CLIENT_CERTIFICATE_KEY_FILE=/home/ogg/keys/client1_key.pem
CLIENT_CA_CERTIFICATES_FILE=/home/ogg/keys/ca_cert.pem
ADMINISTRATION_SERVER_ENABLED=true
PORT_ADMINSRVR=$(($hport+1))
DISTRIBUTION_SERVER_ENABLED=true
PORT_DISTSRVR=$(($hport+2))
NON_SECURE_DISTSRVR_CONNECTS_TO_SECURE_RCVRSRVR=false
RECEIVER_SERVER_ENABLED=true
PORT_RCVRSRVR=$(($hport+3))
METRICS_SERVER_ENABLED=true
METRICS_SERVER_IS_CRITICAL=false
PORT_PMSRVR=$(($hport+4))
PMSRVR_DATASTORE_TYPE=BDB
PMSRVR_DATASTORE_HOME=/u01/app/ogg/$dname""_DS
ENABLE_DEPLOYMENT_REMOTE_METRICS=false
DEPLOYMENT_REMOTE_METRICS_LISTENING_PORT=0
OGG_SCHEMA=GGADMIN
ADMINISTRATOR_PASSWORD=changeme
DEPLOYMENT_ADMINISTRATOR_PASSWORD=changeme" > ~ogg/oggadd.rsp && chown ogg:oinstall ~ogg/oggadd.rsp
# start installer
su - ogg -c '. ~/ogg_ora.env && oggca.sh -silent -responseFile /home/ogg/oggadd.rsp')

Remove a User Deployment

(read -p 'Please enter the name of the deployment to remove (e.g. depl1): ' dname
# create response file
echo "oracle.install.responseFileVersion=/oracle/install/rspfmt_oggca_response_schema_v23_1_0
CONFIGURATION_OPTION=REMOVE
DEPLOYMENT_NAME=$dname
ADMINISTRATOR_USER=ggma
DEPLOYMENT_ADMINISTRATOR_USER=ggadmin$dname
HOST_SERVICEMANAGER=127.0.0.1
PORT_SERVICEMANAGER=9000
SECURITY_ENABLED=true
TLS_1_2_ENABLED=false
TLS_1_3_ENABLED=true
REMOVE_DEPLOYMENT_FROM_DISK=true
ADMINISTRATOR_PASSWORD=changeme
DEPLOYMENT_ADMINISTRATOR_PASSWORD=changeme" > ~ogg/oggrm.rsp && chown ogg:oinstall ~ogg/oggrm.rsp
# start installer
su - ogg -c '. ~/ogg_ora.env && oggca.sh -silent -responseFile /home/ogg/oggrm.rsp'
su - ogg -c "rm -rf /u01/app/ogg/$dname\_DS /u01/app/ogg/$dname")

Uninstall Oracle GoldenGate 23ai

systemctl stop OracleGoldenGate && systemctl disable OracleGoldenGate
su - ogg -c ". ~/ogg_ora.env && /u01/app/ogg/ogg23ai_ora/deinstall/deinstall.sh -silent"
rm -rf /u01/app/ogg/deplsm /u01/app/ogg/depl1_DS /etc/systemd/system/OracleGoldenGate.service /etc/systemd/system/multi-user.target.wants/OracleGoldenGate.service /usr/bin/OracleGoldenGate.sh /etc/oggInst.loc
systemctl daemon-reload

Administration of Oracle GoldenGate 23ai

To login to the Service Manager you can user the URL: https://<fqdn>:9000 (e.g. https://lin1.fritz.box:9000). The Service Manager Administrator Account is ggma with the password: changeme. You can reach the user deployments from the Service Manager. The username is ggadmin<deployment name> (e.g. ggadmindepl1) and the password is changeme.

You can stop the Service Manager with:

systemctl stop OracleGoldenGate

To start the Service Manager you can use:

systemctl start OracleGoldenGate

To query the status of the Service Manager you can use:

systemctl status OracleGoldenGate|grep Active

Further info

If you would like to install Oracle GoldenGate with a GUI (Oracle Universal Installer) you can do that with the following commands:

# as the ogg user start a X terminal
. ~/ogg_ora.env && /sw/ora_GoldenGate/GoldenGate/gg234/ora/fbo_ggs_Linux_x64_Oracle_services_shiphome/Disk1/runInstaller

Run these commands to rollback a patch (RU).

# check current version
su - ogg -c ". ~/ogg_ora.env && echo exit|adminclient versions|grep ^Version"
# rollback the patch
su - ogg -c ". ~/ogg_ora.env && opatch rollback -silent -id 36878982"
# check previous version
su - ogg -c ". ~/ogg_ora.env && echo exit|adminclient versions|grep ^Version"

If you would like to add or remove a Deployment with a GUI (Oracle Universal Installer) you can do that with:

# as the ogg user start a X terminal
. ~/ogg_ora.env && /u01/app/ogg/ogg23ai_ora/bin/oggca.sh

Some useful links