1.What is an Oracle GoldenGate Trail File?
Oracle GoldenGate Extract Process is like a video recorder. It reads the transaction data from the source databases and records the data in the Oracle GoldenGate trail files, which are like the video tapes which preserves the captured data so that Oracle GoldenGate can replay the transactions.
Oracle GoldenGate Trail File uses a proprietary binary format defined by Oracle GoldenGate. The trail file includes the database time zone, character set and metadata information needed by the replication. [1]
The replication metadata is included in the trail file after Oracle GoldenGate 12.2. If both the source and the target use Oracle GoldenGate 12.2 and the later versions, you don't need to use the defgen files.
You can refer to Oracle GoldenGate 12.2 New Features for the list of Oracle GoldenGate 12.2 new features.
Next, let's discuss how to manage the trail files. I will discuss the following topics:
- Creating Trail Files
- Writing Data to Trail Files
- Purging Trail Files
- Checking Trail Files
2. Creating a Trail Files
When setting up an extract group, you need to specify the trail file name, and its size. The default size is 10 megabytes.
add exttrail ./dirdat/em, extract emaster, megabytes 20
âDuring an Oracle GoldenGate implementation, you also need to estimate the total storage size for all your trail files. You can refer to the Oracle GoldenGate document (Oracle GoldenGate 11.2 Installation and Setup Guide, page 5) for more info. The typical estimation is:
[log volume in one hour] x [number of hours downtime] x .4 = trail disk space
3. Writing Data to Trail Files
When reading from redo logs, Oracle GoldenGate first keeps all the uncommitted transaction data in memory. After the transaction is committed, Oracle GoldenGate then writes the data to a trail file in large blocks. All the file names begin with the two characters and a unique, nine-digits serial (sequence) number from 000000000 through 999999999. For example, /ogg/dirdat/em000000001. When the trail sequence number reaches 999999999, the numbering starts over at 000000000.â
Oracle GoldenGate 12.2 introduces the support of trail file name with a 9 digits sequence number. This increases the trail file number to 1 billion.
You can refer to Oracle GoldenGate 12.2 New Features for the list of Oracle GoldenGate 12.2 new features.
stop extract alter extract rollover start extract
5. Purging the Trail Files
Trail files can accumulate quickly. You should consider regularly purge or archive the trail files to save the storage space. Oracle GoldenGate allows you to purge the trail file according to rules set with the PURGEOLDEXTRACTS parameter in the manager parameter file to purge trail files:
PURGEOLDEXTRACTS /ogg/dirdat/*, USECHECKPOINTS, MINKEEPDAYS 2
This setup means that Oracle GoldenGate will keep the trail files for at least for 2 days and the data has been applied to the targets
6. Checking the Trail Files
In general, you can check the trail files with the GGSCI command:
info exttrail ./dirdat/em
Logdump 11 >open ./dirdat/em000000 Current LogTrail is /ogg/dirdat/em000000 Logdump 12 >ghdr on Logdump 13 >next 2
- Oracle GoldenGate 12.2 Documentation: C About the Oracle GoldenGate Trail
- Oracle GoldenGate 12.2 Documentation: Using the Logdump Utility