Manage Trail Files
After data has been extracted, it must be processed into one or more trails, where it is stored for processing by another Oracle GoldenGate process. A trail is a sequence of files that are created and aged as needed. Processes that read a trail are:
-
Distribution Service: Extracts data from a local trail for further processing, if needed, and transfers it to the target system.
-
Receiver Service: Receives the trail and transfers to Replicat, which reads the trail and applies change data to the target database.
You can create more than one trail to separate the data of different
tables or applications, or to satisfy the requirements of a specific replication
topology, such as a cascading topology. You link tables specified with a
TABLE
statement to a trail specified with an
EXTTRAIL
or RMTTRAIL
parameter statement in
the Extract parameter file.
-
Assign Storage for Oracle GoldenGate Trails
-
Estimate Space for the Trail
-
Add a Trail
Assign Storage for Oracle GoldenGate Trails
In a typical configuration, there is at least one trail on the source system and one on the target system. Allocate enough disk space to allow for the following:
-
The primary Extract process captures transactional data from the source database and writes it to the local trail. There must be enough disk space to contain the data accumulation, or the primary Extract will abend.
-
For a trail at the target location, provide enough disk space to handle data accumulation according to the purge rules set with the
PURGEOLDEXTRACTS
parameter. Even withPURGEOLDEXTRACTS
in use, data will always accumulate on the target because it is transferred across the network faster than it can be applied to the target database. Also see Purge Datastore.
To prevent trail activity from interfering with business applications, assign a separate disk or file system to contain the trail files. Trail files can reside on drives that are local to the Oracle GoldenGate installation, or they can reside on NAS or SAN devices. In an Oracle cluster, they can reside on ASM or DBFS storage. See Preparing DBFS for an Active-Active Configuration.
Estimate Space for the Trails
- Estimate the longest time that the network could be unavailable. Plan to store enough data to withstand the longest possible outage, because otherwise you will need to resynchronize the source and target data if the outage outlasts disk capacity.
- Estimate how much transaction log volume your business applications generate in one hour.
- Use the following formula to calculate the required disk space.
This equation uses a multiplier of 40 percent because only about 40 percent of the data in a transaction log is needed by Oracle GoldenGate.[log volume in one hour] x [number of hours downtime] x .4 = trail disk space
Note:
This formula is a conservative estimate, and you should run tests once you have configured Oracle GoldenGate to determine exactly how much space you need.
To prevent trail activity from interfering with business applications, assign a separate disk or file system to contain the trail files. Trail files can reside on drives that are local to the Oracle GoldenGate installation, or they can reside on NAS or SAN devices. In an Oracle cluster, they can reside on ASM or DBFS storage.
Add a Trail
When you create, or add, a trail, you do not physically create any files on disk. The files are created automatically by an Extract process. Rather, you specify the name of the trail and associate it with the Extract group that writes to it.
To add a trail, issue the following command on the source system.
ADD {RMTTRAIL | EXTTRAIL} pathname, EXTRACT group [, MEGABYTES n]
Where:
-
RMTTRAIL
specifies a trail on a remote system. -
EXTTRAIL
specifies a trail on the local system.-
EXTTRAIL
cannot be used for an Extract in PASSIVE mode. -
EXTTRAIL
must be used to specify a local trail.
-
-
pathname
is the relative or fully qualified name of the trail, including a two-character name that can be any two alphanumeric characters, for example c:\ggs\dirdat\rt. Oracle GoldenGate appends a serial number to each trail file as it is created during processing. Typically, trails are stored in thedirdat
sub-directory of the Oracle GoldenGate directory. -
EXTRACT
group specifies the name of the Extract group that writes to this trail. Only one Extract group can write to a trail. -
MEGABYTES n
is an optional argument with which you can set the size, in megabytes, of each trail file (default is 100).
Example: Create a Local Trail
This example creates a local trail named /ggs/dirdat/lt
for Extract
group exte.
ADD EXTTRAIL /ggs/dirdat/lt, EXTRACT exte
Example: Create a Remote Trail
This example creates a trail named c:\ggs\dirdat\rt
for Extract
group finance, with each file sized at approximately 50 megabytes.
ADD RMTTRAIL c:\ggs\dirdat\rt, EXTRACT finance, MEGABYTES 200