ha make primary argument: Change the mode of a secondary server (SQL administration API)

Use the ha make primary argument with the admin() or task() function to change the specified secondary server to a primary or standard server.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-EXECUTE FUNCTION--+-admin-+--(------------------------------->
                     '-task--'      

>--+-"ha make primary"-------+--,--"database_server"--)--;-----><
   '-"ha make primary force"-'                               

Element Description Key Considerations
database_server The name of the database server. The name must be defined in the DBSERVERNAME or DBSERVERALIASES configuration parameter, or as an Enterprise Replication group name.

Usage

This function has different results depending on the type of secondary server:

  • HDR Secondary: The current primary server is shut down and the HDR secondary server is made the primary server.
  • RS secondary: The RS secondary server is changed to a standard server.
  • SD secondary: The SD secondary server is made the new primary server.

Use the ha make primary argument to change an inactive secondary server to a primary server when there is an active connection between them.

Use the ha make primary force argument to change an inactive secondary server to a primary server, whether or not a secondary server is connected to it. If the connection is active, the function succeeds, however, if you run the function with the force argument on an SD secondary server, the shared disk subsystem can become corrupted.

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

Example

The following example converts an HDR secondary server named ids_stores2 into a primary server:
EXECUTE FUNCTION task("ha make primary","ids_stores2");

Copyright© 2019 HCL Technologies Limited