Adds a database to the replication system and sets configuration parameters for the connection. To create a connection for an Adaptive Server database, use Sybase Central or rs_init.
create connection to data_server.database set error class [to] error_class set function string class [to] function_class set username [to] user [set password [to] passwd] [set database_param [to] 'value' [set database_param [to] 'value']...] [set security_param [to] 'value' [set security_param [to] 'value']...] [with {log transfer on, dsi_suspended}] [as active for logical_ds.logical_db | as standby for logical_ds.logical_db [use dump marker]]
The data server that holds the database to be added to the replication system.
The database to be added to the replication system.
The error class that is to handle errors for the database.
The function string class to be used for operations in the database.
The login name of the Replication Server maintenance user for the database. Replication Server uses this login name to maintain replicated data. You must specify a user name if network-based security is not enabled.
The password for the maintenance user login name. You must specify a password unless a network-based security mechanism is enabled.
A parameter that affects database connections from the Replication Server. Parameters and values are described in Table 3-14.
A character string that contains a value for the option.
A parameter that affects network-based security. See Table 3-27 for a list and description of security parameters that you can set with create connection.
Indicates that the connection may be a primary data source or the source of replicated functions. When the clause is present, Replication Server creates an inbound queue and prepared to accept a RepAgent connection for the database. If you omit this option, the connection cannot accept input from a RepAgent.
Starts the connection with the DSI thread suspended. You can resume the DSI later. This option is useful if you are connecting to a non-Sybase data server that does not support Replication Server connections.
Indicates that the connection is a physical connection to the active database for a logical connection.
Indicates that the connection is a physical connection to the standby database for a logical connection.
The data server name for the logical connection.
The database name for the logical connection.
Tells Replication Server to apply transactions to a standby database after it receives the first dump marker after the enable replication marker in the transaction stream from the active database. Without this option, Replication Server applies transactions it receives after the enable replication marker.
Creates a connection for the pubs2 database in the SYDNEY_DS data server. Replication Server will use the ansi_error error class to handle errors for the database. It will use the function strings in the sqlserver_derived_class function string class for data manipulation operations. The connection will use the pubs2_maint login name with the password pubs2_maint_ps to log into the pubs2 database:
create connection to SYDNEY_DS.pubs2 set error class ansi_error set function string class sqlserver_derived_class set username pubs2_maint set password pubs2_maint_pw
Creates a connection similar to the first example, but with log transfer specified. This allows the connection to accept input from a RepAgent. The connection is with a database that contains primary data or that will be a source of replicated functions:
create connection to TOKYO_DS.pubs2 set error class ansi_error set function string class sqlserver_derived_class set username pubs2_maint set password pubs2_maint_pw with log transfer on
Use create connection to add a database to the replication system. Normally, you use this command to add connections to non-Sybase databases. To create a standard connection with an Adaptive Server database, use Sybase Central or rs_init.
To create a connection that uses heterogeneous datatype support (HDS) to translate datatypes from the primary to the replicate database, you can also use scripts provided by Sybase that both create the connection and install HDS. See the Replication Server Configuration Guide for your platform for instructions.
Execute create connection at the Replication Server that manages the database.
Replication Server distributes database connection information to qualifying sites through out the replication system. The changes do not appear immediately at all sites because of normal replication system lag time.
You must specify an error class, even if you use the default error class: rs_sqlserver_error_class.
Only one connection is allowed per database. This is enforced by the ID Server, which registers each database in its rs_idnames system table. The ID Server must be available when you create a connection for a database.
Use set function string class [to] function_class to activate class-level translations for non-Sybase data servers.
Replication Server configuration parameters are stored in the rs_config system table. See the Replication Server Administration Guide Volume 1 for more information about the database connection parameters in the rs_config system table.
See the Replication Server Administration Guide Volume 2 for more information about configuring parallel DSI threads.
Use assign action to enable retry of transactions that fail due to specific data server errors.
Before setting dump_load to “on,” create function strings for the rs_dumpdb and rs_dumptran functions. Replication Server does not generate function strings for these functions in the system-provided classes or in derived classes that inherit from these classes.
Set save_interval to save transactions in the DSI queue that can be used to resynchronize a database after it has been restored from backups. Setting a save interval is also useful when you set up a warm standby of a database that holds replicate data or receives replicated functions. You can use sysadmin restore_dsi_saved_segments to restore backlogged transactions.
Table 3-22 shows the error and function classes that Replication Server provides for database connections.
Class name |
Description |
---|---|
rs_sqlserver_error_class |
Error action assignments for Adaptive Server databases. |
rs_sqlserver_function_class |
Function-string class for Adaptive Server databases. Cannot participate in function string inheritance. Replication Server generates function strings automatically. |
rs_default_function_class |
Function-string class for Adaptive Server databases. You cannot modify function strings. You can specify this class as a parent class, but not as a derived class. Replication Server generates function strings automatically. |
rs_db2_function_class |
Function-string class for DB2 databases. You cannot modify function strings. You can specify this class as a parent class, but not as a derived class. Replication Server generates function strings automatically. |
rs_informix_function_class |
Function-string class for Informix databases. You cannot modify function strings. You can specify this class as a parent class, but its derived classes cannot inherit any class-level translations from the parent class. Replication Server generates function strings automatically. |
rs_ms_function_class |
Function-string class for Microsoft SQL Server databases. You cannot modify function strings. You can specify this class as a parent class, but its derived classes cannot inherit any class-level translations from the parent class. Replication Server generates function strings automatically. |
rs_oracle_function_class |
Function-string class for Oracle databases. You cannot modify function strings. You can specify this class as a parent class, but its derived classes cannot inherit any class-level translations from the parent class. Replication Server generates function strings automatically. |
rs_udb_function_class |
Function-string class for UDB databases. You cannot modify function strings. You can specify this class as a parent class, but its derived classes cannot inherit any class-level translations from the parent class. Replication Server generates function strings automatically. |
The rs_dumpdb and rs_dumptran system functions are not initially defined, even for function-string classes in which Replication Server generates default function strings. If you intend to use coordinated dumps, you must create function strings for these functions. Note also that you cannot perform coordinated dumps on a standby database. See the Replication Server Administration Guide Volume 2 for more information about using function strings. For more information about the rs_dumpdb and rs_dumptran functions, see Chapter 4, “Replication Server System Functions.”
You specify the maintenance user login name and password when creating the connection. The maintenance user login name must be granted all necessary permissions to maintain replicated data in the database.
When two sites in a replication system have the same database name, the maintenance user login names must be different. The default login name, created by Sybase Central or rs_init is DB_name_maint. When setting up the system, change one of the login names so each are unique.
To create a logical connection for a warm standby application, use create logical connection.
In a warm standby application, the connections for the active database and the standby database must have log transfer on.
The function-string class for a database in a warm standby application is used only when the database is the active database. Replication Server uses rs_default_function_class for the standby database.
Use alter connection to change the attributes of a connection.
If the password of the maintenance user has been changed, use alter connection to enter the new password.
Both ends of a connection must use compatible Security Control Layer (SCL) drivers with the same security mechanisms and security features. The remote server must support the set proxy or equivalent command. It is the replication system Administrator’s responsibility to choose and set security features for each server. The Replication Server does not query the security features of remote servers before attempting to establish a connection. Connections fail if security features at both ends of the connection are not compatible.
create connection specifies security settings for an outgoing connection from Replication Server to a target data server. Security features set by create connection override those set by configure replication server.
If unified_login is set to “required,” only the replication system Administrator with “sa” permission can log in to the Replication Server without a credential. If the security mechanism should fail, the replication system Administrator can log in to Replication Server with a password and disable unified_login.
A Replication Server can have more than one security mechanism; each supported mechanism is listed in the libtcl.cfg file under SECURITY.
Message encryption is a costly process with severe performance penalties. In most instances, it is wise to set msg_confidentiality to “required” only for certain connections. Alternatively, choose a less costly security feature, such as msg_integrity.
create connection requires “sa” permission.
alter connection, configure connection, configure connection, create error class, create function string class, create logical connection, alter route, drop connection, resume connection, suspend connection