ReplicationServer.AgentCheckupInterval ReplicationServer.AgentCheckupInterval ReplicationServer.AgentCheckupInterval Property

정의

배포 에이전트에서 점검을 수행하는 간격을 가져오거나 설정합니다. Gets or sets the interval for the Distribution Agent to perform a checkup.

public:
 property int AgentCheckupInterval { int get(); void set(int value); };
public int AgentCheckupInterval { get; set; }
Public Property AgentCheckupInterval As Integer
속성 값

배포에서 점검을 수행하는 간격을 지정하는 Int32 값입니다. An Int32 value that specifies the interval for the distribution to perform a checkup.

예외

경우는 서버가 배포자 아닙니다. When the server is not a Distributor.

예제

// Set the Distributor and distribution database names.
string distributionDbName = "distribution";
string distributorName = publisherInstance;

ReplicationServer distributor;
DistributionDatabase distributionDb;

// Create a connection to the Distributor using Windows Authentication.
ServerConnection conn = new ServerConnection(distributorName);

try
{
	// Open the connection. 
	conn.Connect();

	distributor = new ReplicationServer(conn);

	// Load Distributor properties, if it is installed.
	if (distributor.LoadProperties())
	{
		// Password supplied at runtime.
		distributor.ChangeDistributorPassword(password);
		distributor.AgentCheckupInterval = 5;

		// Save changes to the Distributor properties.
		distributor.CommitPropertyChanges();
	}
	else
	{
		throw new ApplicationException(
			String.Format("{0} is not a Distributor.", publisherInstance));
	}

	// Create an object for the distribution database 
	// using the open Distributor connection.
	distributionDb = new DistributionDatabase(distributionDbName, conn);

	// Change distribution database properties.
	if (distributionDb.LoadProperties())
	{
		// Change maximum retention period to 48 hours and history retention 
		// period to 24 hours.
		distributionDb.MaxDistributionRetention = 48;
		distributionDb.HistoryRetention = 24;

		// Save changes to the distribution database properties.
		distributionDb.CommitPropertyChanges();
	}
	else
	{
		// Do something here if the distribution database does not exist.
	}
}
catch (Exception ex)
{
	// Implement the appropriate error handling here. 
	throw new ApplicationException("An error occured when changing Distributor " +
		" or distribution database properties.", ex);
}
finally
{
	conn.Disconnect();
}
' Set the Distributor and distribution database names.
Dim distributionDbName As String = "distribution"
Dim distributorName As String = publisherInstance

Dim distributor As ReplicationServer
Dim distributionDb As DistributionDatabase

' Create a connection to the Distributor using Windows Authentication.
Dim conn As ServerConnection = New ServerConnection(distributorName)

Try
    ' Open the connection. 
    conn.Connect()

    distributor = New ReplicationServer(conn)

    ' Load Distributor properties, if it is installed.
    If distributor.LoadProperties() Then
        ' Password supplied at runtime.
        distributor.ChangeDistributorPassword(password)
        distributor.AgentCheckupInterval = 5

        ' Save changes to the Distributor properties.
        distributor.CommitPropertyChanges()
    Else
        Throw New ApplicationException( _
            String.Format("{0} is not a Distributor.", publisherInstance))
    End If

    ' Create an object for the distribution database 
    ' using the open Distributor connection.
    distributionDb = New DistributionDatabase(distributionDbName, conn)

    ' Change distribution database properties.
    If distributionDb.LoadProperties() Then
        ' Change maximum retention period to 48 hours and history retention 
        ' period to 24 hours.
        distributionDb.MaxDistributionRetention = 48
        distributionDb.HistoryRetention = 24

        ' Save changes to the distribution database properties.
        distributionDb.CommitPropertyChanges()
    Else
        ' Do something here if the distribution database does not exist.
    End If
Catch ex As Exception
    ' Implement the appropriate error handling here. 
    Throw New ApplicationException("An error occured when changing Distributor " + _
        " or distribution database properties.", ex)
Finally
    conn.Disconnect()
End Try

설명

사용 하 여 IsDistributor 확인 하려면 여부는 현재 서버는 배포자를 사용 하기 전에 AgentCheckupInterval합니다.Use IsDistributor to check whether or not the current server is a Distributor before you use AgentCheckupInterval.

AgentCheckupInterval 공용 고정된 데이터베이스 역할 속성을 검색할 수 있습니다.The AgentCheckupInterval property can be retrieved by the public fixed database role.

AgentCheckupInterval sysadmin 고정된 서버 역할에서 속성을 설정할 수 있습니다.The AgentCheckupInterval property can be set by the sysadmin fixed server role only. 가져오기는 AgentCheckupInterval 속성은를 실행 하는 sp_helpdistributor_properties (Transact SQL) 저장 프로시저입니다.Getting the AgentCheckupInterval property is equivalent to executing the sp_helpdistributor_properties (Transact-SQL) stored procedure.

적용 대상

추가 정보