Updating the trail file location for Oracle GoldenGate Microservices

When you first install Oracle GoldenGate Microservices, you may have taken the standard installation approach and all the configuration, logging and trail file information will reside in a standard directory structure.  This makes the architecture of your enviornment really easy.  

Let’s say you want to identify what trail files are being used by the extract/replicat.  By default the trail file location in Oracle GoldenGate Microservices is located at:

$DEPLOYMENT_HOME/var/lib/data

This would map to something similar to this:

/opt/app/oracle/gg_deployments/var/lib/data

At some point, your enviornment is going to grow and the default location may run out of space for the trail files that are needed for replication and recoverability.  So how do you change the location where the trail files go?

If you take a look at the ServiceManager, you will see a section at the bottom of the Overview page.  This section lists all the Deployments that are running on the your host.  The section on the page you are looking for looks like the below image:

deploymentLocation.png

Within the Deployment section, select one of the deployments besides the ServiceManager.  When you do this it takes you into the Deployment Configuration page.  On this page you will notice there are two tabs.  The first tab is for Details and the second is for Configuration.  You need to focus on the Details tab.  It looks like the below image:

deploymentDetails.png

On the Details tab it lists out the various directories within the deployment.  Take a moment and take a look at these directories.  Also notice that they are call them “Homes”.  The only thing that is editable on this page is the GoldenGate Home information; begging the question – How  do I move my trail file directory (GoldenGate Data Home)?

deploymentDetailsData.png

The answer is quite simple but requires you to write a bit of code.  The answer is to use the REST API to change the directory location.  How do we do this?

In the Oracle documentation there is a whole book dedicated to the REST API and how to use them.  In this case, I looked up the REST API for updating the deployment (here).  in reviewing the properties for updating a deployment, there is an option called oggDataHome.  This is the location of the data directory that within the deployment.

CAUTION: Before changing the trail file location, make sure that the trail files have reached EOF and the extract/replicats are shutdown.

In order to update the location, you write a piece of cURL that would look something similar to this: 

 

curl –request PATCH \
–url https://localhost:16000/services/v2/deployments/Atlanta \
–header ‘authorization: Basic b2dnYWRtaW46V0VsY29tZTEyMzQ1IyM=’ \
–data ‘{

            “oggDataHome”:”/opt/app/oracle/gg_deployments/Atlanta/data_new”

          }’

 

When you run this, it will update the GoldenGate Data Home.  Once it is update, all that is needed is restarting the deployment for it to take effect.

After the restart of the deployment.  Go back and check the Deployment Details for the deployment.  You will see that the new location is configured.

deploymentDetailsData1.png

Before you can start your extract, you need to move your trail files to the new directory and verify that your extract is looking at the new directory.  

extactNewTrailLoco.png

 

With trail files in the new directory, you can start your extract/replicat.

 

extractStartNewLoco.png

 

Enjoy!!

Please follow and like:

Leave a Reply

Your email address will not be published. Required fields are marked *

Enquire now

Give us a call or fill in the form below and we will contact you. We endeavor to answer all inquiries within 24 hours on business days.