Skip to content

Latest commit

 

History

History
105 lines (72 loc) · 5.06 KB

sp-changelogreader-agent-transact-sql.md

File metadata and controls

105 lines (72 loc) · 5.06 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sp_changelogreader_agent (Transact-SQL)
sp_changelogreader_agent changes security properties of a Log Reader agent.
markingmyname
maghan
randolphwest
07/05/2024
sql
replication
reference
sp_changelogreader_agent
sp_changelogreader_agent_TSQL
sp_changelogreader_agent
TSQL

sp_changelogreader_agent (Transact-SQL)

[!INCLUDE SQL Server SQL MI]

Changes security properties of a Log Reader agent. This stored procedure is executed at the Publisher on the publication database.

Important

When configuring a Publisher with a remote Distributor, the values supplied for all parameters, including @job_login and @job_password, are sent to the Distributor as plain text. You should encrypt the connection between the Publisher and its remote Distributor before executing this stored procedure. For more information, see Configure SQL Server Database Engine for encrypting connections.

Syntax

sp_changelogreader_agent
    [ [ @job_login = ] N'job_login' ]
    [ , [ @job_password = ] N'job_password' ]
    [ , [ @publisher_security_mode = ] publisher_security_mode ]
    [ , [ @publisher_login = ] N'publisher_login' ]
    [ , [ @publisher_password = ] N'publisher_password' ]
    [ , [ @publisher = ] N'publisher' ]
[ ; ]

Arguments

[ @job_login = ] N'job_login'

The login for the account under which the agent runs. @job_login is nvarchar(257), with a default of NULL. On [!INCLUDE ssazuremi-md], use a [!INCLUDE ssnoversion-md] account.

Note

This can't be changed for a non-[!INCLUDE ssNoVersion] publisher.

[ @job_password = ] N'job_password'

The password for the account under which the agent runs. @job_password is sysname, with a default of NULL.

Important

When possible, prompt users to enter security credentials at runtime. If you must store credentials in a script file, you must secure the file to prevent unauthorized access.

[ @publisher_security_mode = ] publisher_security_mode

The security mode used by the agent when connecting to the Publisher. @publisher_security_mode is smallint, with a default of NULL. The following values define the security mode:

  • 0 specifies [!INCLUDE ssNoVersion] authentication.
  • 1 specifies Windows authentication.
  • 2 specifies Microsoft Entra password authentication, starting with [!INCLUDE sssql22-md] CU 6.
  • 3 specifies Microsoft Entra integrated authentication, starting with [!INCLUDE sssql22-md] CU 6.
  • 4 specifies Microsoft Entra token authentication, starting with [!INCLUDE sssql22-md] CU 6.

Important

[!INCLUDE ssNoteWinAuthentication]

[ @publisher_login = ] N'publisher_login'

The login used when connecting to the Publisher. @publisher_login is sysname, with a default of NULL. @publisher_login must be specified when @publisher_security_mode is 0. If @publisher_login is NULL and @publisher_security_mode is 1, then the Windows account specified in @job_login is used when connecting to the Publisher.

[ @publisher_password = ] N'publisher_password'

The password used when connecting to the Publisher. @publisher_password is sysname, with a default of NULL.

Important

Don't use a blank password. Use a strong password. When possible, prompt users to enter security credentials at runtime. If you must store credentials in a script file, you must secure the file to prevent unauthorized access.

[ @publisher = ] N'publisher'

The name of the Publisher. @publisher is sysname, with a default of NULL. This parameter is only supported for non-[!INCLUDE ssnoversion-md] Publishers.

Return code values

0 (success) or 1 (failure).

Remarks

sp_changelogreader_agent is used in transactional replication.

sp_changelogreader_agent is used to change the Windows account under which a Log Reader agent runs. You can change the password of an existing Windows login or supply a new Windows login and password.

After changing an agent login or password, you must stop and restart the agent before the change takes effect.

Permissions

Only members of the sysadmin fixed server role or the db_owner fixed database role can execute sp_changelogreader_agent.

Related content