共用方式為


PublicationMonitor.EnumSubscriptions 方法

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

命名空間:  Microsoft.SqlServer.Replication
組件:  Microsoft.SqlServer.Rmo (在 Microsoft.SqlServer.Rmo.dll 中)

語法

'宣告
Public Function EnumSubscriptions As DataSet
'用途
Dim instance As PublicationMonitor 
Dim returnValue As DataSet 

returnValue = instance.EnumSubscriptions()
public DataSet EnumSubscriptions()
public:
DataSet^ EnumSubscriptions()
member EnumSubscriptions : unit -> DataSet
public function EnumSubscriptions() : DataSet

傳回值

型別:System.Data.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.

[!附註]

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

offload_server

Boolean

Name of the server used with remote agent activation.

[!附註]

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

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.

[!附註]

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

offload_server

Boolean

Name of the server used with remote agent activation.

[!附註]

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

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.

請參閱

參考

PublicationMonitor 類別

Microsoft.SqlServer.Replication 命名空間

其他資源

以程式設計方式監視複寫 (RMO 程式設計)