列出有关分发服务器、分发数据库、工作目录和SQL Server 代理用户帐户的信息。 该存储过程在发布服务器上对发布数据库或任何数据库执行。
语法
sys.sp_helpdistributor
[ [ @distributor = ] N'distributor' OUTPUT ]
[ , [ @distribdb = ] N'distribdb' OUTPUT ]
[ , [ @directory = ] N'directory' OUTPUT ]
[ , [ @account = ] N'account' OUTPUT ]
[ , [ @min_distretention = ] min_distretention OUTPUT ]
[ , [ @max_distretention = ] max_distretention OUTPUT ]
[ , [ @history_retention = ] history_retention OUTPUT ]
[ , [ @history_cleanupagent = ] N'history_cleanupagent' OUTPUT ]
[ , [ @distrib_cleanupagent = ] N'distrib_cleanupagent' OUTPUT ]
[ , [ @publisher = ] N'publisher' ]
[ , [ @local = ] N'local' ]
[ , [ @rpcsrvname = ] N'rpcsrvname' OUTPUT ]
[ , [ @publisher_type = ] N'publisher_type' OUTPUT ]
[ , [ @deletebatchsize_xact = ] deletebatchsize_xact OUTPUT ]
[ , [ @deletebatchsize_cmd = ] deletebatchsize_cmd OUTPUT ]
[ , [ @dist_listener = ] N'dist_listener' OUTPUT ]
[ ; ]
参数
[ @distributor = ] N'分配器'输出
分发服务器的名称。
@distributor为 sysname,默认值%为 ,这是返回结果集的唯一值。
[ @distribdb = ] N'distribdb' 输出
分发数据库的名称。
@distribdb是 sysname,默认值%为 ,这是返回结果集的唯一值。
[ @directory = ] N'directory' 输出
工作目录。
@directory为 nvarchar(255),默认值%为 ,这是返回结果集的唯一值。
[ @account = ] N'account'输出
Windows 用户帐户。
@account为 nvarchar(255),默认值%为 ,这是返回结果集的唯一值。
[ @min_distretention = ] min_distretention 输出
最小分发保持期(以小时为单位)。
@min_distretention为 int-1.
[ @max_distretention = ] max_distretention 输出
最大分发保持期(以小时为单位)。
@max_distretention为 int-1.
[ @history_retention = ] history_retention 输出
历史记录保留期(以小时为单位)。
@history_retention为 int,默认值为 -1.
[ @history_cleanupagent = ] N'history_cleanupagent' 输出
历史记录清理代理的名称。
@history_cleanupagent 为 nvarchar(100),默认值 %为 ,这是返回结果集的唯一值。
[ @distrib_cleanupagent = ] N'distrib_cleanupagent' 输出
分发清理代理的名称。
@distrib_cleanupagent 为 nvarchar(100),默认值 %为 ,这是返回结果集的唯一值。
[ @publisher = ] N'publisher'
发布服务器的名称。
@publisher为 sysname,默认值为 NULL.
[ @local = ] 非本地人
SQL Server 是否应获取本地服务器值。
@local为 nvarchar(5),默认值为 NULL.
[ @rpcsrvname = ] N'rpcsrvname' 输出
发出远程过程调用的服务器的名称。
@rpcsrvname是 sysname,默认值%为 ,这是返回结果集的唯一值。
[ @publisher_type = ] N'publisher_type' 输出
发布服务器的发布者类型。
@publisher_type是 sysname,默认值为
[ @deletebatchsize_xact = ] deletebatchsize_xact 输出
标识为仅供参考。 不支持。 不保证以后的兼容性。
[ @deletebatchsize_cmd = ] deletebatchsize_cmd 输出
标识为仅供参考。 不支持。 不保证以后的兼容性。
[ @dist_listener = ] N'dist_listener' 输出
标识为仅供参考。 不支持。 不保证以后的兼容性。
结果集
| 列名称 | 数据类型 | 描述 |
|---|---|---|
distributor |
sysname | 分发服务器的名称。 |
distribution database |
sysname | 分发数据库的名称。 |
directory |
nvarchar(255) | 工作目录的名称。 |
account |
nvarchar(255) | Windows 用户帐户的名称。 |
min distrib retention |
int | 最小分发保持期。 |
max distrib retention |
int | 最大分发保持期。 |
history retention |
int | 历史记录保持期。 |
history cleanup agent |
nvarchar(100) | 历史记录清除代理的名称。 |
distribution cleanup agent |
nvarchar(100) | 分发清除代理的名称。 |
rpc server name |
sysname | 远程分发服务器或本地分发服务器的名称。 |
rpc login name |
sysname | 用于对远程分发服务器的远程过程调用的登录名。 |
publisher type |
sysname | 发布服务器的类型;可以为下列值之一: - MSSQLSERVER -神谕 - ORACLE 网关 |
返回代码值
0(成功)或 1(失败)。
注解
sp_helpdistributor 用于所有类型的复制。
如果在执行 sp_helpdistributor时指定了一个或多个输出参数,则所有输出参数都设置为 NULL 退出时分配值,并且不返回任何结果集。 如果未指定输出参数,则返回结果集。
权限
以下结果集列或输出参数将返回到发布服务器上的 sysadmin 固定服务器角色的成员,并在发布数据库上db_owner固定数据库角色:
| 结果集列 | 输出参数 |
|---|---|
account |
@account |
min distrib retention |
@min_distretention |
max distrib retention |
@max_distretention |
history retention |
@history_retention |
history cleanup agent |
@history_cleanupagent |
distribution cleanup agent |
@distrib_cleanupagent |
rpc login name |
无 |
以下结果集列返回给分发服务器上的某个发布的发布访问列表中的用户:
- 目录
以下结果集列返回给所有用户。
| 结果集列 | 输出参数 |
|---|---|
distributor |
@distributor |
distribution database |
@distribdb |
rpc server name |
@rpcsrvname |
publisher type |
@publisher_type |