Creating a maintenance user for replication

This section explains how to create a maintenance user in the standby Microsoft SQL Server database.

Description of a maintenance user

The maintenance user is a valid Microsoft SQL Server user that the Replication Server uses to apply commands to the standby Microsoft SQL Server database. Replication Server requires one maintenance user to be defined for each connection.

StepsTo create a maintenance user in Microsoft SQL Server

  1. Using the Microsoft SQL Server Management Studio or the sqlcmd utility, connect to the standby database, and enter the following command to create maintenance user login:

    CREATE LOGIN maintuser WITH PASSWORD='password', DEFAULT_DATABASE=standby_db;
    

    Here, password is the maintenance user login password, and standby_db is the standby database name.

  2. At the standby database, enter the following command to create a maintenance user:

    CREATE USER maintuser FOR LOGIN maintuser;
    
  3. Grant database owner permission to the maintenance user:

    EXEC sp_addrolemember 'db_owner', 'maintuser';