首页 » GoldenGate » Oracle GoldenGate Trail File

Oracle GoldenGate Trail File

Trail files are generated by both the original extract and the Data Pump (extract) process. Trail files are read by the Data Pump (extract) and Replicat (replicat) processes.

The trail files generated by the original extract and the Data Pump vary a little. Some processing appears to be postponed until the Data Pump stage. Some additional file URIs are added to the trail header by the Data Pump. Also the primary keys for some UPDATE statements appear to be modified by the Data Pump process.

The trail files are binary, though significant portions are stored in ASCII. You would need to encrypt the trail files to prevent someone with operating system access examining the contents using the strings utility. Presumably to ensure interoperability across operating systems and databases, all numbers are stored in ASCII format, making the trail files even less secure than other formats such as Oracle exports which at least store numbers using the Oracle internal representation.

The trail file contains a file header and a file body. The file header contains one header record. The file body can contain zero or more data records.

Each record has a four byte record header. A record can contain zero or more sub records. Each sub record also has a four byte record header. The design allows for infinite levels of sub records, nested recursively.

Record Header

Each record header contains four bytes. The following table shows the structure.

Byte# 0 1 2 3
Description Type Flag Length

The research was performed in Oracle 11.2.0.3 on OEL 5.6 running in VirtualBox. The Oracle GoldenGate version was 11.2.1.0.1

File Structure

The following illustration shows and overview of the structure of a trail file:

# File header
# Record
46 00 04 2A # Type=46 (F) Flag=0 Len=1066
…… # Data
5A 00 04 2A # Type=5A (Z) Flag=0 Len=1066
# File body
# Record
47 01 00 3A # Type=47 (G) Flag=1 Len=58
…… # Data
5A 01 00 3A # Type=5A (Z) Flag=1 Len=58

File Header
The file header is identified by a record header with type 0×46 (F).

The file header is terminated by a record header with type 0×59 (Z). The length field of the terminator record header is identical to the length field of the original record header.

File Body
The file body consists of zero or more records. Each record is identified by a record header with type 0×47 (G).

Each record is terminated by a record header with type 0×59 (Z). The length field of the terminator record header is identical to the length field of the original record header.

File Header
The file header contains a number of sub records

The file header generated by the extract process is generally around 1050 bytes in size. The file header generated by the data pump process is larger as it includes additional records. The size of the file header will vary according to the configuration is it includes several variable length fields such as process names and directory names.

The file header has five sub records. Each sub record contains further sub records nested within it.

 

 

refrences     http://juliandyke.wordpress.com/2013/03/16/oracle-goldengate-trail-internals-2/

 

打赏

对不起,这篇文章暂时关闭评论。