thl Position Commands
The thl command supports a number of position and selection command-line options that can be used to select an individual
THL event, or a range of events, to be displayed.
-seqno #
-
Valid for:
thl listOutput the THL sequence for the specific sequence number. When reviewing or searching for a specific sequence number, for example when the application of a sequence on a replica has failed, the replication data for that sequence number can be individually viewed.
The output also includes the filename of the THL file on disk where the THL event is located, for example:
shell> thl list -seqno 99SEQ# = 99 / FRAG# = 0 (last frag)- FILE = thl.data.0000000001- TIME = 2025-02-21 09:11:28.0- EPOCH# = 2- EVENTID = mysql-bin.000015:0000000000030282;44- SOURCEID = db1- METADATA = [mysql_server_id=10;mysql_thread_id=44;dbms_type=mysql;tz_aware=true;service=alpha;shard=hr]- GLOBAL OPTIONS = [autocommit=1;sql_auto_is_null=0;foreign_key_checks=1;unique_checks=1;sql_mode='NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,IGNORE_SPACE,NO_ZERO_DATE,NO_ZERO_IN_DATE';character_set_client=33;collation_connection=33;collation_server=255]- TYPE = com.continuent.tungsten.replicator.event.ReplDBMSEvent- OPTIONS = [foreign_key_checks = 1, unique_checks = 1, time_zone = '+00:00', ##charset = UTF-8]- SQL(0) =- ACTION = INSERT- SCHEMA = hr- TABLE = jobs- ROW# = 0- COL(1: ) (size = 6) = PU_MAN- COL(2: ) (size = 18) = Purchasing Manager- COL(3: ) (size = 4) = 8000- COL(4: ) (size = 5) = 15000If the sequence number selected contains multiple fragments, each fragment will be output. Depending on the content of the sequence number information, the information can be output containing only the header/metadata information or only the table data (row or SQL) that was contained within the fragment. See -headers and -sql for more information.
noteUnsigned integers are displayed and stored in the THL as their negative equivalents, and translated to the correct unsigned type when the data is applied to the target database.
-low #|-high # or -from #|-to #
-
Valid for:
thl list,thl purgeSpecify the start (
-from|-low) or end (-to|high) of the range of sequence numbers to be output. If only-from|-lowis specified, then all sequence numbers from that number to the end of the THL are output. If-to|-highis specified, all sequence numbers from the start of the available log file to the specified sequence number are output. If both numbers are specified, output all the sequence numbers within the specified range.For example:
To output all the sequence number fragments from number 320:
shell> thl list -from 320Or:
shell> thl list -low 320To output all the sequence number fragments up to and including 540:
shell> thl list -to 540Or:
shell> thl list -high 540To output all the sequence number fragments from number 320 up to, and including, sequence number 540:
shell> thl list -from 320 -to 540Or:
shell> thl list -low 320 -high 540
-first and -last
-
Valid for:
thl list,thl purgeThe
-firstoption selects only the first stored THL event, and-lastselects only the last. For example:shell> thl list -firstSEQ# = 0 / FRAG# = 0 (last frag)- FILE = thl.data.0000000001- TIME = 2025-02-20 10:56:33.0- EPOCH# = 0- EVENTID = mysql-bin.000013:0000000000000543;84- SOURCEID = db1shell> thl list -lastSEQ# = 216 / FRAG# = 0 (last frag)- FILE = thl.data.0000000001- TIME = 2025-02-21 09:12:04.0- EPOCH# = 2- EVENTID = mysql-bin.000015:0000000000072872;102- SOURCEID = db1...Supplying an additional positive integer will result in the first, or last, n number of THL entries, for example:
To display the first five events from the stored THL.
shell> thl list -first 5and, to display the last five events from the stored THL.
shell> thl list -last 5The use of the
-lastoption can be particularly useful in the event of synchronisation or THL corruption due to a lack of diskspace. Using thethl purgecommand, the last THL event can be easily removed without having to work out the ranges and index information, for example:shell> thl purge -last