2. XLog Sender#
This chapter explains how to use the XLog Sender, which is one of the components of the Altibase Log Analyzer.
The XLog Sender combines log records together to create XLogs, and sends the XLogs to the XLog Collector. The XLog Sender is an internal Altibase module, and is managed in almost exactly the same way that Replication is managed, i.e. using the same SQL interface.
SQL Statements Used to Manage the XLog Sender#
Creating an XLog Sender#
Syntax#
CREATE REPLICATION replication_name FOR ANALYSIS [PROPAGATION]
WITH {{'remote_host_ip', remote_host_ port_no}
...
|UNIX_DOMAIN}
FROM user_name.table_name TO user_name.table_name
[, FROM user_name.table_name TO user_name.table_name] ... ;
Description#
This statement is used to create an XLog Sender.
- The XLog Sender is automatically created in LAZY mode. EAGER mode cannot be specified when creating an XLog Sender.
- Unlike Replication, it is possible to specify a UNIX domain connection. This is accomplished by specifying UNIX_DOMAIN in the WITH clause.
- It is acceptable to specify tables with foreign keys in the FROM clause.
- PROPAGATION
FOR ANALYSIS PROPAGATION is used by XLog Sender to send logs of transactions replicated using PROPAGABLE LOGGING to another server.
The rest is identical to Replication. For more details, please refer to the Replication Manual.
Consideration#
The UNIX domain connection protocol can only be used in UNIX and Linux.
Example#
XLog Sender Name: log_analysis
XLog Collector Information: TCP(IP : 127.0.0.1, PORT : 35300)
IP is the IP of the server running XLog Collector
PORT is the PORT number defined by XLog Collector
Analysis Target Table: sys.t1
iSQL> CREATE REPLICATION log_analysis FOR ANALYSIS
WITH '127.0.0.1', 35300
FROM sys.t1 TO sys.t1;
Deleting an XLog Sender#
Syntax#
DROP REPLICATION replication_name;
Description#
The use of this statement with an XLog Sender is the same as in Replication.
For more information, please refer to the Replication Manual.
Example#
Delete an XLog Sender named log_analysis.
iSQL> DROP REPLICATION log_analysis;
Starting an XLog Sender#
Syntax#
ALTER REPLICATION replication_name {START [AT SN (xlog_sender_start_sn)]|QUICKSTART};
Description#
This statement is used to start an XLog Sender.
- When using the UNIX domain protocol, the socket filename is automatically generated according to the pattern shown below: Socket Filename: $ALTIBASE_HOME/trc/rp-replication_name
- Unlike in Replication, an XLog Sender is not registered in the HeartBeat thread when started.
- Unlike the Replication Sender, an XLog Sender can start from the SN specified in the AT SN clause. xlog_sender_start_sn is the SN of the XLog from which to start transmission.
With the above exceptions, the use of this statement with an XLog Sender is the same as in Replication. For more information, please refer to the Replication Manual.
Considerations#
- Before the XLog Sender is started, the XLog Collector must be online and waiting for a connection.
- When using the UNIX domain protocol, the setting for the $ALTIBASE_HOME environment variable must be the same as for the XLog Collector.
- Because the maximum allowable socket filename length varies depending on the operating system, be sure to check and avoid exceeding the maximum allowable length on your system.
In order to start the XLog Sender with the AT SN clause, the following conditions must be satisfied.
- The database must be running in Archivelog mode.
- The dedicated replication log buffer must be not used. That is, the REPLICATION_LOG_BUFFER_SIZE property must be set to 0.
Example#
Start an XLog Sender named log_analysis at the point at which it was last stopped.
iSQL> ALTER REPLICATION log_analysis START;
Stopping an XLog Sender#
Syntax#
ALTER REPLICATION replication_name STOP;
Description#
The use of this statement with an XLog Sender is the same as in Replication.
For more information, please refer to the Replication Manual.
Example#
Stop an XLog Sender named log_analysis.
iSQL> ALTER REPLICATION log_analysis STOP;
Adding a Table to a Log Analysis Task#
Syntax#
ALTER REPLICATION replication_name ADD TABLE
FROM user_name.table_name TO user_name.table_name;
Description#
This statement is used to add a table to an analysis task.
It is acceptable to specify a table with a foreign key in the FROM clause.
With the above exception, the use of this statement with an XLog Sender is the same as in Replication.
For more information, please refer to the Replication Manual.
Example#
Add table t2, which belongs to the sys user, to the list of tables to be processed by the XLog Sender named log_analysis.
iSQL> ALTER REPLICATION log_analysis ADD TABLE
FROM sys.t2 TO sys.t2;
Removing a Table from a Log Analysis Task#
Syntax#
ALTER REPLICATION replication_name DROP TABLE
FROM user_name.table_name TO user_name.table_name;
Description#
The use of this statement with an XLog Sender is the same as in Replication.
For more information, please refer to the Replication Manual.
Example#
Remove table t2, which belongs to the sys user, from the list of tables to be processed by the XLog Sender named log_analysis.
iSQL> ALTER REPLICATION log_analysis DROP TABLE
FROM sys.t2 TO sys.t2;
Adding a Host#
Syntax#
ALTER REPLICATION replication_name
ADD HOST 'remote_host_ip', remote_port_no;
Description#
The use of this statement with an XLog Sender is the same as in Replication.
For more information, please refer to the Replication Manual.
Considerations#
It is impossible to add a host when the UNIX domain protocol has been specified as the connection type. Furthermore, when adding a host, only TCP/IP can be specified for the new host.
Example#
Add a host (having the IP address 127.0.0.1 and port number 30301) to an XLog Sender named log_analysis.
iSQL> ALTER REPLICATION log_analysis ADD HOST '127.0.0.1', 30301;
Removing a Host#
Syntax#
ALTER REPLICATION replication_name
DROP HOST 'remote_host_ip', remote_port_no;
Description#
The use of this statement with an XLog Sender is the same as in Replication.
For more information, please refer to the Replication Manual.
Consideration#
It is only possible to remove a host for which a TCP/IP type connection has been specified.
Example#
Remove a host (having the IP address 127.0.0.1 and port number 30301) from an XLog Sender named log_analysis.
iSQL> ALTER REPLICATION log_analysis DROP HOST '127.0.0.1', 30301;
Setting a Host#
Syntax#
ALTER REPLICATION replication_name
SET HOST 'remote_host_ip', remote_port_no;
Description#
The use of this statement with an XLog Sender is the same as in Replication.
For more information, please refer to the Replication Manual.
Considerations#
- The newly set host will be used after the XLog Sender is restarted.
- Only a host for which the connection type is TCP/IP can be specified.
Example#
Choose the XLog Collector having the IP address 127.0.0.1 and port number 20300 as the active host for an XLog Sender named log_analysis.
iSQL> ALTER REPLICATION log_analysis SET HOST '127.0.0.1', 30301;
Flushing XLogs#
Syntax#
ALTER REPLICATION replication_name FLUSH [ALL] [WAIT timeout_sec];
Description#
The use of this statement with an XLog Sender is the same as in Replication.
For more information, please refer to the Replication Manual.
Consideration#
If the XLog Collector does not send ACK, a timeout may occur.
Example#
Flush the logs, up to the log that was current at the time point at which the flush command was executed, for the XLog Sender named log_analysis. Specify a 10-second timeout.
iSQL> ALTER REPLICATION log_analysis FLUSH WAIT 10;
Meta Tables#
The meta tables that are used to query the status of Replication objects are also used to query the status of the XLog Sender. For complete descriptions of these meta tables, please refer to the Altibase General Reference.
SYSTEM_.SYS_REPLICATIONS_#
This meta table contains information on the settings and status of the XLog Sender. A value of 1 in the ROLE column indicates that the Replication object is an XLog Sender.
SYSTEM_.SYS_REPL_HOSTS_#
This meta table contains information on the XLog Collector to which the XLog Sender will connect. For a host that was specified using the UNIX domain protocol, the value in the HOST_IP column is "UNIX_DOMAIN", and the value in the PORT_NO column is the same as the value in the HOST_NO column.
SYSTEM_.SYS_REPL_ITEMS_#
This meta table contains information on the tables for which the XLog Sender sends XLogs.
Performance Views#
The performance views that are used to query the status of Replication objects are also used to query the status of the XLog Sender. For complete descriptions of these performance views, please refer to the Altibase General Reference.
V$REPEXEC#
This performance view displays information about the Replication port and the use of multiple Replication threads.
V$REPSENDER#
This performance view displays information on the status of the XLog Sender.
When using the UNIX domain protocol, the value in the SENDER_IP and PEER_IP columns is "UNIX_DOMAIN" and the value in the SENDER_PORT and PEER_PORT columns is 0.
V$REPSENDER_TRANSTBL#
This performance view displays information about transaction tables.
V$REPGAP#
This performance view displays information about which log file is currently being read by the XLog Sender.