create connection

Description

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.

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

data_server

The data server that holds the database to be added to the replication system.

database

The database to be added to the replication system.

error_class

The error class that is to handle errors for the database.

function_class

The function string class to be used for operations in the database.

user

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.

passwd

The password for the maintenance user login name. You must specify a password unless a network-based security mechanism is enabled.

database_param

A parameter that affects database connections from the Replication Server. Parameters and values are described in Table 3-14.

value

A character string that contains a value for the option.

security_param

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.

log transfer on

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.

dsi_suspended

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.

as active for

Indicates that the connection is a physical connection to the active database for a logical connection.

as standby for

Indicates that the connection is a physical connection to the standby database for a logical connection.

logical_ds

The data server name for the logical connection.

logical_db

The database name for the logical connection.

use dump marker

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.

Examples

Example 1

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

Example 2

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

Usage


Database connection parameters


The dump_load configuration parameter


The save_interval configuration parameter


Error classes and function classes

Table 3-22: Adaptive Server error and function classes

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.

NoteThe 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.”


User name and password

NoteWhen 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


Changing connection attributes


Network-based security parameters

Permissions

create connection requires “sa” permission.

See also

alter connection, configure connection, configure connection, create error class, create function string class, create logical connection, alter route, drop connection, resume connection, suspend connection