ha set primary argument: Define an HDR primary server (SQL administration API)

Use the ha set primary argument with the admin() or task() function to define a High-Availability Data Replication (HDR) primary server and specify the secondary server.

Syntax


1  EXECUTE FUNCTION
1 admin
1 task
2  (
2  "ha set primary" , "secondary_server"
2  ) ;
Element Description Key Considerations
secondary_server The name of the HDR secondary server to connect to. The name must be defined in the DBSERVERNAME or DBSERVERALIASES configuration parameter, or as an Enterprise Replication group name.

Usage

Run this function on a standard server to convert it to an HDR primary server and connect to the specified HDR secondary server. If the connection is successful, replication begins.

This function is equivalent to the onmode -d primary command.

Example

The following example converts a standard server named ids_stores to an HDR primary server:
EXECUTE FUNCTION task("ha set primary","ids_stores");