Primary site for a function-string class

Although most function strings are executed in replicate databases, you execute the create function string class command in a Replication Server, usually a primary Replication Server, that has routes to all sites where the function-string class is to be used. This command designates that Replication Server as the primary site for the class. Function-string classes are replicated via routes, along with other replication system data.

You can only create or alter function strings that have class scope at the primary site for a class. Function strings with replication-definition scope must be created or altered at the primary site for the replication definition.

By default, the class rs_sqlserver_function_class does not have a primary site. To alter class-scope function strings for this class, you must first designate a Replication Server as a primary site for the class. To specify a site for this function-string class, execute the following command at the Replication Server that is to be the primary site:

create function string class rs_sqlserver_function_class

After you have executed this command, you can use the move primary command to make further changes to the primary site for the function-string class.


Changing the primary site for a function-string class

Use the move primary command or Sybase Central to change the primary Replication Server for a function-string class. For example, you may need to change the primary site from one Replication Server to another so that function strings can be distributed through a new routing configuration. The new primary site must include routes to all Replication Servers where the function-string class will be used.

If you move a base class, all classes derived from that class move with it.

You cannot move the primary site for a derived class unless its parent class is a default function-string class.

Execute move primary at the Replication Server that you want to designate as the new primary site for the function-string class.

For example, the following command changes the primary site for the sqlserver2_function_class function-string class to the SYDNEY_RS Replication Server, where the command is entered:

move primary of function string class
 sqlserver2_function_class
 to SYDNEY_RS

If the class rs_sqlserver_function_class has not yet been assigned a primary site, you cannot use the move primary command to assign one. You must use the create function string class command to first designate a primary site for that class. See “Changing the primary site for a function-string class” for details.