共用方式為


PublicationMonitor.EnumSubscriptions Method

Returns information on subscriptions that are subscribed to the monitored publication.

命名空間: Microsoft.SqlServer.Replication
組件: Microsoft.SqlServer.Rmo (in microsoft.sqlserver.rmo.dll)

語法

'宣告
Public Function EnumSubscriptions As DataSet
public DataSet EnumSubscriptions ()
public:
DataSet^ EnumSubscriptions ()
public DataSet EnumSubscriptions ()
public function EnumSubscriptions () : DataSet

傳回值

A DataSet object. For a transactional or snapshot publication, the DataSet contains the following columns.

Column

Data type

Description

subscriber

String

Is the name of the Subscriber.

status

Int32

Status of agent job for the subscription, which can be one of these values:

1 = Started

2 = Succeeded

3 = In progress

4 = Idle

5 = Retrying

6 = Failed

subscriber_db

String

Is the name of the subscription database.

type

Int32

Is the subscription type, which can be one of the following values:

0 = Push

1 = Pull

2 = Anonymous

distribution_agent

String

Is the name of the Distribution Agent job.

last_action

String

Message text of the last action logged by the agent.

action_time

String

Date and time of the last action logged by the agent.

start_time

String

Date and time of last agent execution.

duration

Int32

Elapsed time of the session, in seconds.

delivery_rate

Single

Average number of commands delivered per second.

delivery_latency

Int32

Latency, in milliseconds, between the transaction entering the distribution database and being applied to the Subscriber.

delivered_transactions

Int32

Total number of transactions delivered in the session.

delivered_commands

Int32

Total number of commands delivered in the session.

delivery_time

String

Date and time that the session was logged.

average_commands

Int32

Average number of commands per transaction delivered in the session.

error_id

Int32

The ID of the error in the MSrepl_errors (Transact-SQL) system table. Use the EnumErrorRecords method to return detailed information about an error.

job_id

Byte[16]

Identifier of the SQL Server Agent job starting the Replication Agent.

local_job

Boolean

When true, the agent job is available at the Distributor.

profile_id

Int32

Profile identifier.

agent_id

Int32

Agent job identifier.

local_timestamp

Byte[8]

Timestamp of the most recent agent run.

offload_enabled

Boolean

If true, the subscription supports remote agent activation.

ms150167.note(zh-tw,SQL.90).gif附註:

Remote agent activation has been discontinued. For more information, see SQL Server 2005 複寫中已停止的功能.

offload_server

Boolean

Name of the server used with remote agent activation.

ms150167.note(zh-tw,SQL.90).gif附註:

Remote agent activation has been discontinued. For more information, see SQL Server 2005 複寫中已停止的功能.

subscriber_type

Int32

The data source type at the Subscriber:

0 = SQL Server Subscriber.

1 = Open Database Connectivity (ODBC) data source.

For a merge publication, the DataSet contains the following columns.

Column

Data type

Description

subscriber

String

Is the name of the Subscriber.

status

Int32

Status of agent job for the subscription, which can be one of these values:

1 = Started

2 = Succeeded

3 = In progress

4 = Idle

5 = Retrying

6 = Failed

subscriber_db

String

Is the name of the subscription database.

type

Int32

Is the subscription type, which can be one of the following values:

0 = Push

1 = Pull

2 = Anonymous

agent_name

String

Is the name of the Merge Agent job.

last_action

String

Message text of the last action logged by the agent.

action_time

String

Date and time of the last action logged by the agent.

start_time

String

Date and time of last agent execution.

duration

Int32

Elapsed time of the session, in seconds.

delivery_rate

Single

Average number of commands delivered per second.

download_inserts

Int32

The number of inserts applied at the Subscriber.

download_updates

Int32

The number of updates applied at the Subscriber.

download_deletes

Int32

The number of deletes applied at the Subscriber.

publisher_conflicts

Int32

The number of conflicts that occurred while applying changes at the Subscriber.

upload_inserts

Int32

The number of inserts applied at the Publisher.

upload_updates

Int32

The number of updates applied at the Publisher.

upload_deletes

Int32

The number of deletes applied at the Publisher.

subscriber_conflicts

Int32

The number of conflicts that occurred while applying changes at the Publisher.

error_id

Int32

The ID of the error in the MSrepl_errors (Transact-SQL) system table. Use the EnumErrorRecords method to return detailed information about an error.

job_id

Byte[16]

Identifier of the SQL Server Agent job starting the replication agent.

local_job

Boolean

When true, the agent job is available at the Distributor.

profile_id

Int32

Profile identifier.

agent_id

Int32

Agent job identifier.

last_timestamp

Byte[8]

Timestamp of the most recent agent run.

offload_enabled

Boolean

If true, the subscription supports remote agent activation.

ms150167.note(zh-tw,SQL.90).gif附註:

Remote agent activation has been discontinued. For more information, see SQL Server 2005 複寫中已停止的功能.

offload_server

Boolean

Name of the server used with remote agent activation.

ms150167.note(zh-tw,SQL.90).gif附註:

Remote agent activation has been discontinued. For more information, see SQL Server 2005 複寫中已停止的功能.

subscriber_type

Int32

The data source type at the Subscriber:

0 = SQL Server Subscriber

1 = Open Database Connectivity (ODBC) data source

備註

The ExcludeAnonymousSubscriptions property is used to filter the result set.

The EnumSubscriptions method can only be called by members of the db_owner or replmonitor fixed database roles on the distribution database.

The EnumSubscriptions method is available only with SQL Server 2005.

This namespace, class, or member is supported only in version 2.0 of the .NET Framework.

執行緒安全性

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

平台

開發平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

目標平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

請參閱

參考

PublicationMonitor Class
PublicationMonitor Members
Microsoft.SqlServer.Replication Namespace

其他資源

How to: Programmatically Monitor Replication (RMO Programming)