ltm

Description

Runs the Log Transfer Manager (LTM) executable program for Adaptive Server.

Syntax

ltm [-C config_file] [-S ltm_name]
 [-I interfaces_file] [-E errorlog_file]
 [-M] [-A] [-W] [-v]

Parameters

-C config_file

Specifies the name and location of the LTM configuration file. The rs_init program creates a configuration file which, by default, is named LTM_name.cfg, where LTM_name is the name of the LTM. You can specify this file name by using the -C flag. If you do not use the -C flag, ltm looks for the configuration file named config.ltm in the directory where you started the LTM.

See “LTM configuration file” for detailed information about the parameters in the LTM configuration file.

-S ltm_name

Specifies the name to use for this LTM. If you do not specify the LTM name with the -S option, ltm uses the value of the DSLISTEN environment variable.

-I interfaces_file

Specifies the name and location of the interfaces file where the LTM is defined. The interfaces file must also have entries for the Replication Server and the SQL Server the LTM communicates with. If you do not use the -I flag, the LTM looks for the default interfaces file in the Sybase release directory.

Refer to the Replication Server installation and configuration guides for your platform for more information about the interfaces file, including the default interfaces file name for your platform.

-E errorlog_file

Specifies the name and location of the LTM error log file, into which ltm writes error messages. If you do not use the -E flag, the default error log file name and location is ltm.log in the directory where you started the LTM.

WARNING! If you are running more than one LTM, either execute them in separate directories or use the -E flag to specify different error log file names. Otherwise, the LTMs will try to record their messages in the same file.

-M

Starts the LTM in recovery mode, which is used to initiate recovery actions.

-A

Instructs the LTM to submit all updates on replicated tables, including updates made by the maintenance user, to the Replication Server for distribution to subscribing replicate sites. This mode is used for applications such as the Redistributed Corporate Rollup model.

Refer to “Redistributed Corporate Rollup” in Chapter 1, “Introduction,” in the Replication Server Administration Guide for more information about this type of distributed application.

-W

Instructs the LTM to submit all updates on replicated tables, including updates made by the maintenance user, to the Replication Server for application to the standby database in a warm standby application. Used this flag only with the LTM for the current active database in a warm standby application.

Refer to Chapter 13, “Managing Warm Standby Applications,” in the Replication Server Administration Guide for more information about warm standby applications.

-v

Prints the version number of the LTM.

Examples

Example 1

Starts the LTM named TOKYO_PUBS2_LTM, using the configuration file TOKYO_PUBS2_LTM.cfg.

ltm -STOKYO_PUBS2_LTM -CTOKYO_PUBS2_LTM.cfg

Example 2

Starts the LTM named SYDNEY_PUBS2_LTM, using the configuration file SYDNEY_PUBS2_LTM.cfg.

ltm -SSYDNEY_PUBS2_LTM -CSF_LTM.cfg

Example 3

Shuts down the LTM named SYDNEY_PUBS2_LTM.

isql -SSYDNEY_PUBS2_LTM -Usa -Psa_pw
 1>shutdown
 2>go

Usage


LTM configuration file

The LTM reads the configuration file to find the start-up parameters. The following table lists the configuration parameters for a SQL Server LTM.

Table 7-1: LTM configuration file parameters

Configuration parameter

Description

RS_source_ds

An optional parameter to specify the name of the SQL Server containing the database whose log the LTM transfers to the Replication Server. If you do not set this parameter, the LTM uses the value of the SQL_server parameter.

RS_source_db

An optional parameter to specify the name of the database whose log the LTM transfers to the Replication Server. If it is not set, the LTM uses the value of the SQL_database.

SQL_user

The login name that the LTM uses to connect with SQL Server. This must be the System Administrator or the Database Owner for 4.9.x databases.

SQL_pw

The password for the SQL_user login name.

SQL_pw_enc

The encrypted password for the SQL_user login name.

RS

The name of the Replication Server to which the LTM is transferring the log.

RS_user

A login name for the LTM to use to log into the Replication Server. The login name must have been granted connect source permission in the Replication Server.

RS_pw

The password for the RS_user login name.

RS_pw_enc

The encrypted password for the RS_user login name.

SQL_server

The name of the data server whose data is being transferred by the LTM. Normally, it is equal to RS_source_ds. During recovery, it can be a data server with a temporary database whose logs the LTM will transfer to the Replication Server.

SQL_database

The name of the database whose data is being transferred by the LTM. Normally, it is equal to RS_source_db. During recovery, it can be a temporary database whose logs the LTM will transfer to the Replication Server.

LTM_admin_user

The System Administrator LTM login name that is used for logging into the LTM. This parameter is required so that the LTM can check whether the System Administrator has the correct login name by comparing the user login name with the one specified in the configuration file.

LTM_admin_pw

The password for the LTM_admin_user login name.

LTM_admin_pw_enc

The encrypted password for the LTM_admin_user login name.

pwd_encrypt

Indicates if password encryption is enabled/disabled:

  • 1 – encryption enabled

  • 0 – encryption disabled

LTM_charset

The character set for the LTM to use. You can specify any Sybase-supported character set. The LTM should use the same character set as the data server and Replication Server attached to it.

The LTM_charset parameter overrides the character set that is currently set using the LANG environment variable. Refer to the Replication Server installation and configuration guides for your platform.

Default value: “default” entry for your platform in the locales.dat file contained in the locales subdirectory of the Sybase release directory.

CONFIG_charset

The character set used to write the LTM configuration file. Use this parameter only if this character set differs from the LTM’s character set. It can be any character set that is compatible with the LTM’s character set.

Default: value used for LTM_charset.

LTM_language

The language used by the LTM to print its log messages and send messages to its clients. You can specify any language to which the LTM has been localized that is compatible with the character set chosen in LTM_charset.

The LTM_language parameter overrides the language set by the LANG environment variable. If this environment variable is not set, the LTM uses the language specified in the “default” locale entry for this platform. If this language is not available, it defaults to U.S. English.

LTM_sortorder

The sort order that the LTM uses to compare user names. You can specify any Sybase-supported sort order that is compatible with the LTM’s character set.

All sort orders in your replication system should be the same.

Default: binary.

retry

The number of seconds to wait before retrying a failed connection to a SQL Server or Replication Server.

Default: 10 seconds.

scan_retry

The minimum number of seconds the SQL Server log scan thread sleeps when all current log records have been sent to the LTM. The thread wakes up when records arrive in the log. If no records are in the log, the thread sleeps for a minimum of scan_retry seconds. The default is 15 seconds.

If records arrive in the log, waking the log scan thread before scan_retry seconds have elapsed, the time remaining is added to the next sleep interval. Therefore, if no records arrive in the log, the log scan thread sleeps for a minimum of scan_retry seconds and a maximum of scan_retry * 2 seconds.

When the log scan thread wakes up because the sleep interval has expired, the thread returns an end-of-scan message to the LTM. The LTM then performs bookkeeping and posts a new log scan request.

Default: 15 seconds.

batch_sz

The number of log records to request from the SQL Server in each batch. If there are more than batch_sz records in the log before the scan time out, the SQL Server sends the records to the LTM. Otherwise, the Server returns control to the LTM and the request is completed. At the end of each request, the LTM updates the truncation point in the database, if necessary. Thus, the larger the batch_sz, the less often the truncation point is updated and the larger the log becomes.

When specifying batch_sz in the SQL Server, also consider the overhead involved in setting up the log scan request (for example, finding the location of the end of the log). The smaller the value for batch_sz, the more CPU usage increases in the SQL Server to set up the scan.

Default: 1000 records.

batch_ltl_cmds

When set “on,” the LTM batches Log Transfer Language (LTL) commands and sends them to the Replication Server. When set “off,” the LTM sends one command at a time to the Replication Server.

When set “on,” the LTM groups LTL commands into a 16K buffer and sends them to the Replication Server if one of the following situations occur:

  • The buffer is full

  • 5 seconds have elapsed since the first command was put into the buffer

  • The SQL Server returns from the log scan

When set “off,” the LTM sends commands to the Replication Server as it gets them.

You may be able to reduce latency by setting this parameter to “off.” However, this can lead to degraded network performance between the LTM and the Replication Server.

Default: on.

skip_ltl_cmd_err

When set to “on,” the LTM logs and then skips errors returned by Replication Server for distribute commands (SQL-like statements). When set to “off,” the LTM shuts down when these errors occur.

Default: off.

maint_cmds_to_skip

The LTM sends maintenance transaction begin/end pairs to the Replication Server after skipping the number of commands specified by this parameter. This allows the LTM to update the truncation point so that the SQL Server log can be truncated. This is most useful for sites where there are no primary data updates for an extended period. The LTM cannot move the truncation point until a transaction is sent to the Replication Server.

Default: 1000 records.

print_sproc_warning

Determines whether the LTM prints a warning message in the LTM.log if multiple replicated rows are modified within a replicated stored procedure. This parameter applies only to the method for replicating stored procedures that is associated with table replication definitions.

If you set this parameter to “off,” no warnings print.

Default: on.


LTM commands

If you are performing recovery, troubleshooting, or diagnostics tasks, you may need to run the LTM commands described below.

Shutting down an LTM To shut down the LTM, log in and execute the shutdown command at the isql prompt:

shutdown

Shut down an LTM when you want to terminate processes.

Suspending an LTM To suspend an LTM, log into the LTM and execute the suspend command at the isql prompt:

suspend

Suspending an LTM drops its connections to the Replication Server and the SQL Server. A suspended LTM cannot execute a connect source command in the Replication Server. The LTM remains suspended until you resume it with the resume command.

To disconnect one or all LTMs and prevent LTMs from connecting to the Replication Server, execute the suspend log transfer RCL command. Log transfer to the Replication Server remains suspended until you resume it with resume log transfer.

The suspend log transfer command records information in the RSSD, so if you shut down the Replication Server and restart it, log transfer to that Replication Server remains suspended. An LTM for SQL Server continues to run when you suspend log transfer to the Replication Server.

See suspend log transfer for more information.

Resuming an LTM To resume an LTM, log into the LTM and execute the resume command at the isql prompt:

resume

An LTM for SQL Server that has been suspended using the suspend command in the LTM remains suspended until you resume it with the resume command.

The resume log transfer command allows an LTM to connect to a Replication Server. It does not resume an LTM that has been suspended with suspend. If the LTM has been suspended, you must resume it to allow log transfer activity.

See resume log transfer for more information.

Recovering messages from offline database logs The recover_stat and scan commands help recover lost messages from offline logs when recovering from partition loss or failure or from truncated primary database logs. Complete recovery procedures are described in the Replication Server Administration Guide for Replication Server version 12.0.

Use the scan command to replay the transaction log of the temporary database. To scan the transaction log, log into the LTM and execute this command at the isql prompt:

scan

After scanning the transaction log, use recover_stat to verify that the LTM has finished replaying the log. If the current database log is complete, you can load the next transaction log dump.

To execute recover_stat, log into the LTM and execute this command at the isql prompt:

recover_stat

If the recovery status is “2,” the current database log is complete and you can load the next transaction log dump. If the recovery status is “1,” either the log has not been replayed or the replay is not complete.

See the Replication Server Administration Guide for Replication Server version 12.0 for step-by-step recovery procedures using the LTM.