Data Replication with SQL Remote
PART 3. SQL Remote Administration
CHAPTER 10. SQL Remote Administration
SQL Remote supports several different systems for exchanging messages. The message systems supported by SQL Remote are:
file Storage of message files in directories on a shared file system for reading by other databases.
ftp Storage of message files in directories accessible by a file transfer protocol (ftp) link.
mapi Microsoft's messaging API (MAPI) link, used in Microsoft Mail and other electronic mail systems.
smtp Internet Simple Mail Transfer Protocol (SMTP/POP), used in Internet e-mail.
vim Lotus's Vendor Independent Messaging (VIM), used in Lotus Notes and cc:Mail.
A database can exchange messages using one or more of the available message systems.
Not all message systems are supported on all operating systems for which SQL Remote is available. The links are implemented as DLLs on Windows 3.x, Windows 95, and Windows NT.
The Message Agent for UNIX and NetWare operating systems supports the file link only, as a compiled library.
For full details on operating system availability, see the section on each message system:
For more information on the file message system, see The file sharing message system.
For more information on the ftp message system, see The ftp message system.
For more information on the smtp message system, see The SMTP message system.
For more information on the mapi message system, see The MAPI message system.
For more information on the vim message system, see The VIM message system.
Each message type definition includes the type name (file, ftp, smtp, mapi, or vim) and also the address of the publisher under that message type. The publisher address at a consolidated database is used by the database extraction utility as a return address when creating remote databases. It is also used by the Message Agent to identify where to look for incoming messages for the file system.
The address supplied with a message type definition is closely tied to the publisher ID of the database. Valid addresses are considered in following sections.
Before you can use a message system, you must set the publisher's address.
You can create and alter message types in Sybase Central.
In the left pane, open the Message Types folder. The Message Types folder is inside the SQL Remote folder.
Double-click Add Message Type. The New Message Type window appears.
Enter one of the existing message type names, and a publisher address, in the appropriate fields. Click OK to save the definition in the database.
If you wish to change the publisher's address, you can do so by altering a message type.
In the left pane, open the Message Types folder. The Message Types folder is inside the SQL Remote folder.
In the right pane, right-click the message type you wish to alter and select Properties from the popup menu. The Message Type Properties window appears.
Enter a new publisher address, in the appropriate fields. Click OK to save the definition in the database.
If you wish to drop a message type from the installation, you can do so.
In the left pane, open the Message Type folder. The Message Type folder is inside the SQL Remote folder.
In the right pane, right-click the message type you wish to alter and select Delete from the popup menu.
Make sure you have decided on an address for the publisher under the message type.
Enter the command to create the message type.
For Adaptive Server Anywhere, use the CREATE REMOTE MESSAGE TYPE statement. This statement has the following syntax:
CREATE REMOTE MESSAGE TYPE type-name ADDRESS address-string
For Adaptive Server Enterprise, use the sp_remote_type procedure. This procedure takes the following arguments:
sp_remote_type type-name, address-string
In these statements, type-name is one of the message systems supported by SQL Remote, and address-string is the publisher's address under that message system.
If you wish to change the publisher's address, you can do so by altering the message type.
Make sure you have decided on a new address for the publisher under the message type.
Enter the command to alter the message type.
For Adaptive Server Anywhere, use the ALTER REMOTE MESSAGE TYPE statement. This statement has the following syntax:
ALTER REMOTE MESSAGE TYPE type-name ADDRESS address-string
For Adaptive Server Enterprise, use the sp_remote_type procedure in the same way as creating a message type. This procedure takes the following arguments:
sp_remote_type type-name, address-string
In these statements, type-name is one of the message systems supported by SQL Remote, and address-string is the publisher's address under that message system.
You can also drop message types if they are no longer used in your installation. This has the effect of removing the publisher's address from the definition.
Enter the command to drop the message type.
For Adaptive Server Anywhere, use the DROP REMOTE MESSAGE TYPE statement. This statement has the following syntax:
DROP REMOTE MESSAGE TYPE type-name
For Adaptive Server Enterprise, use the sp_drop_remote_type procedure in the same way as creating a message type. This procedure takes the following arguments:
sp_drop_remote_type type-name
In these statements, type-name is one of the message systems supported by SQL Remote.
Each message link has several parameters that govern aspects of its behavior. The following sections document these parameters.
The message link control parameters are stored in the following places:
Windows 95 and Windows NT In the registry, at the following location:
\\HKEY_CURRENT_USER \Software \Sybase \SQL Remote
Windows 3.x In the file SQLANY.INI, in your SQL Remote installation directory.
NetWare You should create a file named dbremote.ini in the sys:\system directory to hold the FILE system directory setting.
The sqlremote environment variable holds a path that can be used as an alternative to one of the control parameters for the file sharing system.
The parameters available for each message system are discussed in the following sections. Each section describes a single message system.
SQL Remote can be used even if you do not have a message system in place, by using the file message system.
The file sharing message system is supported on all platforms for which SQL Remote is available, for both Adaptive Server Enterprise and Adaptive Server Anywhere.
The file message system is a simple file-sharing system. A file address for a remote user is a subdirectory into which all their messages are written. To retrieve messages from their "inbox", an application reads the messages from the directory containing the user's files. Return messages are sent to the address (written to the directory) of the consolidated database.
The file system addresses are typically subdirectories of a shared directory that is available to all SQL Remote users, whether by modem or on a local area network. Each user should have a registry entry, initialization file entry, or SQLREMOTE environment variable pointing to the shared directory.
You can also use the file system to put the messages in directories on the consolidated and remote machines. A simple file transfer mechanism can then be used to exchange the files periodically to effect replication.
The FILE message system uses the following control parameters:
Directory This is set to the directory under which the messages are stored. The setting is an alternative to the SQLREMOTE environment variable.
Debug This is set to either YES or NO, with the default being NO. When set to YES, all file system calls made by the FILE link are displayed.
The FILE section of the sqlany.ini file (Windows 3.x) has the following entries:
[ FILE ]
Directory=path
Debug={ yes | no }
On NetWare, you should create a file named dbremote.ini in the sys:\system directory to hold the directory setting.
The ftp message system is supported on the Windows NT, Windows 95, and Windows 3.x operating systems.
In the ftp message system, messages are stored in directories under a root directory on an ftp host. The ftp host and the root directory are specified by message system control parameters held in the registry or initialization file, and the address of each user is the subdirectory where their messages are held.
The ftp message system uses the following control parameters:
host The host name of the computer where the messages are stored. This can be a host name (such as ftp.powersoft.com) or an IP address (such as 192.138.151.66).
user The user name for accessing the ftp host.
password The password for accessing the ftp host.
root_directory The root directory within the ftp host site, under which the messages are stored.
port Usually not required. This is the IP port number used for the Ftp connection.
debug This is set to either YES or NO, with the default being NO. When set to YES, debugging output is displayed.
The Simple Mail Transfer Protocol (SMTP) is used in Internet e-mail products.
With the SMTP system, SQL Remote sends messages using Internet mail. The messages are encoded to a text format and sent in an e-mail message to the target database. The messages are sent using an SMTP server, and retrieved from a POP server: this is the way that many e-mail programs send and receive messages.
The SMTP message system is supported on the following operating systems:
Windows 95
Windows NT
Windows 3.x
To use SQL Remote and an SMTP message system, each database participating in the setup requires a SMTP address, and a POP3 user ID and password. These are distinct identifiers: the SMTP address is the destination of each message, and the POP3 user ID and password are the name and password entered by a user when they connect to their mail box.
Separate e-mail account recommended |
The database should have its own e-mail account for SQL Remote messages, separate from personal e-mail messages intended for reading. This is because many e-mail readers will collect e-mail in the following manner:
Connect to the POP Host and download all messages.
Delete all messages from POP Host
Disconnect from POP Host.
Read mail from the local file or from memory
This causes a problem, as the e-mail program downloads and deletes all of the SQL Remote e-mail messages as well as personal messages. If you are certain that your e-mail program will not delete unread messages from the POP Host then you may share an e-mail address with the database as long as you take care not to delete or alter the database messages.
These messages are easy to recognize, as they are filled with lines of seemingly random text.
Before the Message Agent connects to the message system to send or receive messages, the user must either have a set of control parameters already set on their machine, or must fill in a window with the needed information. This information is needed only on the first connection. It is saved and used as the default entries on subsequent connects.
The SMTP message system uses the following control parameters:
local_host This is the name of the local computer. It is useful on machines where SQL Remote is unable to determine the local host name. The local host name is needed to initiate a session with any SMTP server. In most network environments, the local host name can be determined automatically and this entry is not needed.
TOP_supported SQL Remote uses a POP3 command called TOP when enumerating incoming messages. The TOP command may not be supported by all POP servers. Setting this entry to NO will use the RETR command, which is less efficient but will work with all POP servers. The default is YES.
smtp_host This is the name of the computer on which the SMTP server is running. It corresponds to the SMTP host field in the SMTP/POP3 login window.
pop3_host This is the name of the computer on which the POP host is running. It is commonly the same as the SMTP host. It corresponds to the POP3 host field in the SMTP/POP3 login window.
pop3_userid This is used to retrieve mail. The POP user ID corresponds to the user ID field in the SMTP/POP3 login window. You must obtain a user ID from your POP host administrator.
pop3_password This is used to retrieve mail. It corresponds to the password field in the SMTP/POP3 login window. If all of these five fields are set, the login window is not displayed.
Debug When set to YES, displays all SMTP and POP3 commands and responses. This is useful for troubleshooting SMTP/POP support problems. Default is NO.
The SMTP section of the sqlany.ini file (Windows 3.x) has the following entries:
[SMTP]
smtp_host=smtp_host
pop3_host=pop3_host
pop3_userid=userid
pop3_password=password
Debug={ yes | no }
The Message Application Programming Interface (MAPI) is used in several popular e-mail systems, such as Microsoft Mail and later versions of Lotus cc:Mail. SQL Remote supports the MAPI message system under Windows 3.x, Windows 95, and Windows NT.
The MAPI message system is supported on the following operating systems:
Windows 95
Windows NT
Windows 3.x
To use SQL Remote and a MAPI message system, each database participating in the setup requires a MAPI user ID and address. These are distinct identifiers: the MAPI address is the destination of each message, and the MAPI user ID is the name entered by a user when they connect to their mail box.
Although SQL Remote messages may arrive in the same mail box as e-mail intended for reading, they do not in general show up in your e-mail inbox.
SQL Remote sends application-defined messages, which MAPI identifies and hides when the mailbox is opened. In this way, users can use the same e-mail address and same connection to receive their personal e-mail and their database updates, yet the SQL Remote messages do not interfere with the mail intended for reading.
If a message is routed via the Internet, the special message type information is lost. The message then does show up in the recipient's mailbox.
The MAPI message system uses the following control parameters:
Debug When set to YES, displays all MAPI calls and the return codes. This is useful for troubleshooting MAPI support problems. Default is NO.
Force_Download (default YES) controls if the MAPI_FORCE_DOWNLOAD flag is set when calling MapiLogon. This might be useful when using remote mail software that dials when this flag is set.
IPM_Receive This can be set to YES or NO (default NO). If set to YES, the MAPI link receives IPM messages, which are visible in the mailbox. If set to NO, the MAPI link receives IPC messages, which are not visible in the mailbox. This may be useful if your MAPI provider does not support IPC messages. Also, it may be useful when receiving messages over the Internet. In this case, the sender might not be using MAPI or the IPC attributes are have been lost.
IPM_Send This can be set to YES or NO (default NO). If set to YES, the MAPI link sends IPM messages, which are visible in the mailbox. If set to NO, the MAPI link sends IPC messages, which are not visible in the mailbox. This may be useful if your MAPI provider does not support IPC messages.
Profile Use the specified Microsoft Exchange profile. You should use this if you are running the Message Agent as a service.
The MAPI section of the sqlany.ini file (Windows 3.x) has the following entries:
[ MAPI ]
IPM_Send={yes |no }
IPM_Receive={ yes |no }
Force_Download={yes |no }
Debug={yes | no}
The Vendor Independent Messaging system (VIM) is used in Lotus Notes and in some releases of Lotus cc:Mail.
The VIM message system is supported on the following operating systems:
Windows 95
Windows NT
Windows 3.x
To use SQL Remote and a VIM message system, each database participating in the setup requires a VIM user ID and address. These are distinct identifiers: the VIM address is the destination of each message, and the VIM user ID is the name entered by a user when they connect to their mail box.
The VIM message system uses the following control parameters:
Path This corresponds to the Path field in the cc:Mail login window. It is not applicable to and is ignored under Lotus Notes.
Userid This corresponds to the User ID field in the cc:Mail login window.
Password This corresponds to the Password field in the cc:Mail login window. If all of Path, Userid, and Password are set, the login window is not displayed.
Debug When set to YES, displays all VIM calls and the return codes. This is useful for troubleshooting VIM support problems. Default is NO.
Receive_All When set to YES, the Message Agent checks all messages to see if they are SQL Remote messages. When set to NO (the defaut), the Message Agent looks only for messages of the application-defined type SQLRemoteData. This leads to improved performance in Notes.
Setting ReceiveAll to YES is useful in setups where the message type is lost, reset, or never set. This includes setups including cc:Mail messages, or over the Internet.
Send_VIM_Mail When set to YES, the Message Agent sends messages compatible with Adaptive Server Anywhere releases before 5.5.01, and compatible with cc:Mail. If this is set to YES, you should ensure that Receive_All is set to YES also.
The VIM section of the sqlany.ini file (Windows 3.x) has the following entries:
[ VIM ]
Path=path
Userid=userid
Password=password
Debug={yes | no}
Receive_All = {yes | no}
Send_VIM_Mail = {yes | no}