Relation manager log records

Relation manager log records facilitate the replication of DDL operations to a target database.

Table 1. Relation manager log record header structure (RDSLogRecordHeader)
Description Type Offset (Bytes)
Component identifier (=11) unsigned char 0(1)
Function identifier (See Table 2.) unsigned char 1(1)
Table identifiers

  Table space identifier

  Table identifier

  

unsigned short

unsigned short

  

2(2)

4(2)

rdsLogRecFlags unsigned short 6(2)
Total Length: 8 bytes
Table 2. Relation manager log record header structure function identifier values and definitions
Value Definition
4 DDL statement
5 Undo DDL statement
8 Partition information

DDL statement log record

DDL statement log records are written for all Data Definition Language (DDL) operations. They include high-level information for the DDL, such as the type of operation (for example, CREATE, ALTER, or DROP) as well as the type of object (for example, TABLE, VIEW, or INDEX). There is also some information related to the compilation environment in which the DDL statement is executed, including the default schema name, function path, and statement authorization id.

DDL statement log records contain the actual SQL statement for the DDL operation, and if the statement is too long to fit in one log record, the statement will be split into multiple log records, each of which includes the total length of the statement and the length of the remaining text.

The function ID is 4.
Table 3. DDL statement log record structure
Description Type Offset (Bytes)
Log header RDSLogRecordHeader 0(8)
Operation identifier (See Table 4) unsigned short 8(2)
Object identifier (See Table 5) unsigned short 10(2)
Options unsigned short 12(2)
NumEntries unsigned short 14(2)
DDL statement text left sqluint32 variable(4)
DDL statement text length sqluint32 variable(4)
Entries

Each entry (See Table 6)

DDLStmtRecordEntry

16(NumEntrieds * 4)
Entry text

Each entry text length determined by the corresponding length in DDLStmtRecordEntry

char[] variable(variable)
DDL statement text char[] variable(variable)
Table 4. DDL operation identifier values and definitions
Value Definition
1 CREATE
2 DROP
3 ALTER
4 SET CONSTRAINTS
5 RENAME
6 COLLECT STATISTICS
7 ATTACH
8 DETACH
9 FLUSH
10 COMMENT
11 GRANT
12 REVOKE
13 LOCK
14 TRUNCATE
15 TRANSFER
16 RECREATE
17 SET
18 REFRESH
Table 5. DDL object identifier values and definitions
Value Definition
1 ALIAS
2 CHECK CONSTRAINT
3 COLUMN
4 DATABASE
5 FUNCTION
6 INDEX
7 MONITOR
8 PACKAGE
9 REFERENTIAL INTEGRITY CONSTRAINT
10 TABLE
11 TABLE SPACE
12 TRIGGER
13 TYPE
14 VIEW
15 CONSTRAINT
16 SCHEMA
17 PARTITION GROUP
18 BUFFERPOOL
19 PROCEDURE
20 DISTINCT TYPE
21 ABSTRACT DATA TYPE
22 INDEX EXTENSION
23 INDEX METHOD
24 NICKNAME
25 FUNCTION MAPPING
26 TYPE MAPPING
27 STORED PROCEDURE NICKNAME
28 SERVER MAPPING
29 USER MAPPING
30 SERVER OPTION
31 REVERSE TYPE MAPPING
32 WRAPPER
33 PASS THROUGH
34 COMPOUND
35 TABLE HIERARCHY
36 VIEW HIERARCHY
37 METHOD DEFINITION
38 COLLECT STATS
39 METHOD BODY
40 SEQUENCE
41 XML CONTAINER
42 XML COLLECTION
43 XML COLLECTION VIEW
44 XML ITEM VIEW
45 XML INDEX
46 XSR OBJECT
47 SECURITY LABEL COMPONENT
48 SECURITY LABEL
49 SECURITY LABEL POLICY
50 ROLE
51 VARIABLE
52 WORKLOAD
53 SERVICE CLASS
54 WORK CLASS SET
55 WORK ACTION SET
56 THRESHOLD
57 HISTOGRAM TEMPLATE
58 TRUSTED CONTEXT
59 AUDIT POLICY
60 MODULE
61 MODULE BODY
62 PERMISSION
63 MASK
64 PROFILE CACHE
65 AUTHORITIES AND PRIVILEGES
66 EXEMPTION
67 SUMMARY TABLE
68 GLOBAL TEMP TABLE
69 CREATED TEMPORARY TABLE
70 INSERT ONLY TABLE
71 SUBTABLE
72 TABLE OF STRUCTURED TYPE
73 STRUCTURED TYPE
74 ROW TYPE
75 TABLE ALIAS
76 SEQUENCE ALIAS
77 MODULE ALIAS
78 PRIVATE ALIAS
79 PUBLIC ALIAS
80 EVENT MONITOR
81 SERVER
82 TRANSFORM
83 STORAGE GROUP
84 USAGE LIST
85 FEDERATED CACHE
Table 6. DDLStmtRecordEntry structure
Description Type Offset (Bytes)
Entry type (See Table 7) unsigned short 0(2)
Entry length unsigned short 2(2)
Table 7. Entry type values and definitions
Value Definition
1 Default schema name
2 Function path
3 Authorization ID

Undo DDL statement log record

The function ID is 5.
Table 8. Undo DDL Statement log record structure
Description Type Offset (Bytes)
Log header RDSLogRecordHeader 0(8)

Partition information log record

Partition information log records are added when you create a partitioned table, as well as when you add, attach, or detach a partition. There is one such log record per each partition. The function ID is 6.
Table 9. Partition Information log record structure
Description Type Offset (Bytes)
Log header RDSLogRecordHeader 0(8)
Partition action (See Table 10) unsigned short 8(2)
Partition range flags (See Table 11) unsigned short 10(2)
Partition ID unsigned short 12(2)
Data tablespace ID unsigned short 14(2)
Long tablespace ID unsigned short 16(2)
Index tablespace ID unsigned short 18(2)
Partition name length unsigned short 20(2)
Table schema length unsigned short 22(2)
Table name length unsigned short 24(2)
Low value length unsigned short 26(2)
High value length unsigned short 28(2)
Partition name char[] 30(variable)
Table schema char[] variable(variable)
Table name char[] variable(variable)
Low value1 char[] variable(variable)
High value1 char[] variable(variable)

1 The low and high values are logged as an ASCII string. For example, even if the column type is integer and the value is 100, in the log record, the value will be a three-byte string "100".

.
Table 10. Partition action values and definitions
Value Definition
1 CREATE
2 ADD
3 ATTACH
4 DETACH
Table 11. Partition range flags values and definitions
Value Definition
0x0001 Low value inclusive
0x0002 High value inclusive