create connection

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. To create a connection for a non-Adaptive Server database, see create connection using profile command.

Syntax

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 dsi_connector_sec_mech [to] hdbuserstore]
[set replication server error class [to] rs_error_class]
[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]]

Parameters

Examples

Usage

  • 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.

  • You do not have to specify a Replication Server error class unless it is a new Replication Server error class. The default Replication Server error class is rs_repserver_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.

Database Connection Parameters

  • 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.

The dump_load Configuration Parameter

  • 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.

The save_interval Configuration Parameter

  • 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.

Error Classes and Function Classes

  • Error and Function Classes shows the error and function classes that Replication Server provides for Replication Server and database connections.

Error and Function Classes

Class name

Description

rs_repserver_error_class

Error action assignments for Replication Server.

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_error_class

Error class for DB2 databases.

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_hanadb_error_class

Error class for HANA DB databases.

rs_hanadb_function_class

Function-string class for HANA DB 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_iq_error_class

Error class for Sybase IQ databases.

rs_iq_function_class

Function-string class for Sybase IQ 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_msss_error_class

Error class for Microsoft SQL Server databases.

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_error_class

Error class for Oracle databases.

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_error_class

Error class for UDB databases.

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.

Note: 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 Replication Server System Functions.

User Name and Password

  • 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.

Note: 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.

Warm Standby Applications

  • 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.

Changing Connection Attributes

  • 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.

Network-Based Security Parameters

  • These parameters do not apply to non-ASE, non-IQ connectors.

  • 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.

Permissions

create connection requires “sa” permission.

Related reference
admin show_connection_profiles
alter connection
create alternate connection
create connection using profile
configure connection
create error class
create function string class
create logical connection
alter route
drop connection
resume connection
rs_classes
rs_profdetail
rs_profile
rs_systext
suspend connection