Aracılığıyla paylaş


ReplicationAgentSchedule Sınıfı

Çoğaltma aracısı zamanlamasını gösteren iş.

Devralma Hiyerarşisi

System.Object
  Microsoft.SqlServer.Replication.ReplicationAgentSchedule

Ad Alanı:  Microsoft.SqlServer.Replication
Derleme:  Microsoft.SqlServer.Rmo (Microsoft.SqlServer.Rmo içinde.dll)

Sözdizimi

'Bildirim
Public NotInheritable Class ReplicationAgentSchedule
'Kullanım
Dim instance As ReplicationAgentSchedule
public sealed class ReplicationAgentSchedule
public ref class ReplicationAgentSchedule sealed
[<SealedAttribute>]
type ReplicationAgentSchedule =  class end
public final class ReplicationAgentSchedule

ReplicationAgentSchedule türü aşağıdaki üyeleri açıklar.

Oluşturucular

  Ad Açıklama
Ortak yöntem ReplicationAgentSchedule Oluşturur Yeni bir örnek , ReplicationAgentSchedule WalkTree

Üst

Özellikler

  Ad Açıklama
Ortak özellik ActiveEndDate Alır veya ayarlar zamanlanan etkinlik çalışmasını durdurmak için tarih.
Ortak özellik ActiveEndTime Alır veya ayarlar saat zamanlanan çalışmasını durdurmak için etkinliktir.
Ortak özellik ActiveStartDate Alır veya zamanlanmış etkinliği ilk geçtiği tarih ayarlar.
Ortak özellik ActiveStartTime Alır veya ayarlar saat planlanan etkinlik ilk oluşumunun.
Ortak özellik FrequencyInterval Alır veya zamanlanmış bir etkinlik örnekleri arasındaki aralığı ayarlar.
Ortak özellik FrequencyRecurrenceFactor Alır veya ayarlar frekans yineleme faktörü.
Ortak özellik FrequencyRelativeInterval Alır veya ayarlar bir saat göreli olarak ayın ilk günü olan oluşum.
Ortak özellik FrequencySubDay Alır veya sıklığı günde birkaç kere oluşan zamanlanmış Aktiviteler için dakika cinsinden ayarlar.
Ortak özellik FrequencySubDayInterval Alır veya bir günde birkaç kez gerçekleşmesi planlanan etkinlikleri arasındaki aralığı ayarlar.
Ortak özellik FrequencyType Alır veya zamanlanmış bir aktivite sıklığını ayarlar.

Üst

Yöntemler

  Ad Açıklama
Ortak yöntem Equals (Object öğesinden devralınmıştır.)
Korumalı yöntem Finalize (Object öğesinden devralınmıştır.)
Ortak yöntem GetHashCode (Object öğesinden devralınmıştır.)
Ortak yöntem GetType (Object öğesinden devralınmıştır.)
Korumalı yöntem MemberwiseClone (Object öğesinden devralınmıştır.)
Ortak yöntem ToString (Object öğesinden devralınmıştır.)
Ortak yöntem Update Sunucuda varolan bir zamanlama güncelleştirir.

Üst

Açıklamalar

Bu ad, sınıf veya üye yalnızca desteklenen sürüm 2.0.net Framework.

İş Parçacığı Güvenliği

Herhangi bir ortak statik (Shared , Microsoft Visual Basic) bu tür üyeler birden çok iş parçacığı işlemleri. için güvenliHerhangi bir örnek üyenin iş parçacığı için güvenli olduğu garanti edilmemiştir.

Örnekler

          // Define the server, database, and publication names
            string publisherName = publisherInstance;
            string publicationName = "AdvWorksSalesOrdersMerge";
            string publicationDbName = "AdventureWorks2008R2";
            string distributorName = publisherInstance;

            MergePublication publication;
            MergePartition partition;
            MergeDynamicSnapshotJob snapshotAgentJob;
            ReplicationAgentSchedule schedule;
            
            // Create a connection to the Publisher.
            ServerConnection publisherConn = new ServerConnection(publisherName);

            // Create a connection to the Distributor to start the Snapshot Agent.
            ServerConnection distributorConn = new ServerConnection(distributorName);

            try
            {
                // Connect to the Publisher.
                publisherConn.Connect();

                // Set the required properties for the publication.
                publication = new MergePublication();
                publication.ConnectionContext = publisherConn;
                publication.Name = publicationName;
                publication.DatabaseName = publicationDbName;


                // If we can't get the properties for this merge publication, 
                // then throw an application exception.
                if (publication.LoadProperties() || publication.SnapshotAvailable)
                {
                    // Set a weekly schedule for the filtered data snapshot.
                    schedule = new ReplicationAgentSchedule();
                    schedule.FrequencyType = ScheduleFrequencyType.Weekly;
                    schedule.FrequencyRecurrenceFactor = 1;
                    schedule.FrequencyInterval = Convert.ToInt32(0x001);

                    // Set the value of Hostname that defines the data partition. 
                    partition = new MergePartition();
                    partition.DynamicFilterHostName = hostname;
                    snapshotAgentJob = new MergeDynamicSnapshotJob();
                    snapshotAgentJob.DynamicFilterHostName = hostname;

                    // Create the partition for the publication with the defined schedule.
                    publication.AddMergePartition(partition);
                    publication.AddMergeDynamicSnapshotJob(snapshotAgentJob, schedule);
                }
                else
                {
                    throw new ApplicationException(String.Format(
                        "Settings could not be retrieved for the publication, " +
                        " or the initial snapshot has not been generated. " +
                        "Ensure that the publication {0} exists on {1} and " +
                        "that the Snapshot Agent has run successfully.",
                        publicationName, publisherName));
                }
            }
            catch (Exception ex)
            {
                // Do error handling here.
                throw new ApplicationException(string.Format(
                    "The partition for '{0}' in the {1} publication could not be created.",
                    hostname, publicationName), ex);
            }
            finally
            {
                publisherConn.Disconnect();
                if (distributorConn.IsOpen) distributorConn.Disconnect();
            }
' Define the server, database, and publication names
Dim publisherName As String = publisherInstance
Dim publicationName As String = "AdvWorksSalesOrdersMerge"
Dim publicationDbName As String = "AdventureWorks2008R2"
Dim distributorName As String = publisherInstance

Dim publication As MergePublication
Dim partition As MergePartition
Dim snapshotAgentJob As MergeDynamicSnapshotJob
Dim schedule As ReplicationAgentSchedule

' Create a connection to the Publisher.
Dim publisherConn As ServerConnection = New ServerConnection(publisherName)

' Create a connection to the Distributor to start the Snapshot Agent.
Dim distributorConn As ServerConnection = New ServerConnection(distributorName)

Try
    ' Connect to the Publisher.
    publisherConn.Connect()

    ' Set the required properties for the publication.
    publication = New MergePublication()
    publication.ConnectionContext = publisherConn
    publication.Name = publicationName
    publication.DatabaseName = publicationDbName


    ' If we can't get the properties for this merge publication, 
    ' then throw an application exception.
    If (publication.LoadProperties() Or publication.SnapshotAvailable) Then
        ' Set a weekly schedule for the filtered data snapshot.
        schedule = New ReplicationAgentSchedule()
        schedule.FrequencyType = ScheduleFrequencyType.Weekly
        schedule.FrequencyRecurrenceFactor = 1
        schedule.FrequencyInterval = Convert.ToInt32("0x001", 16)

        ' Set the value of Hostname that defines the data partition. 
        partition = New MergePartition()
        partition.DynamicFilterHostName = hostname
        snapshotAgentJob = New MergeDynamicSnapshotJob()
        snapshotAgentJob.DynamicFilterHostName = hostname

        ' Create the partition for the publication with the defined schedule.
        publication.AddMergePartition(partition)
        publication.AddMergeDynamicSnapshotJob(snapshotAgentJob, schedule)
    Else
        Throw New ApplicationException(String.Format( _
         "Settings could not be retrieved for the publication, " + _
         " or the initial snapshot has not been generated. " + _
         "Ensure that the publication {0} exists on {1} and " + _
         "that the Snapshot Agent has run successfully.", _
         publicationName, publisherName))
    End If
Catch ex As Exception
    ' Do error handling here.
    Throw New ApplicationException(String.Format( _
     "The partition for '{0}' in the {1} publication could not be created.", _
     hostname, publicationName), ex)
Finally
    publisherConn.Disconnect()
    If distributorConn.IsOpen Then
        distributorConn.Disconnect()
    End If
End Try

İş Parçacığı Güvenliği

Bu türdeki tüm ortak static (Visual Basic'te Shared) üyeler iş parçacığı için güvenlidir. Herhangi bir örnek üyenin iş parçacığı için güvenli olduğu garanti edilmemiştir.