次の方法で共有


SnapshotGenerationAgent クラス

レプリケーション スナップショット エージェントの機能を提供します。

継承階層

System. . :: . .Object
  System. . :: . .MarshalByRefObject
    Microsoft.SqlServer.Replication. . :: . .AgentCore
      Microsoft.SqlServer.Replication..::..SnapshotGenerationAgent

名前空間:  Microsoft.SqlServer.Replication
アセンブリ:  Microsoft.SqlServer.Replication (Microsoft.SqlServer.Replication.dll)

構文

'宣言
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
<GuidAttribute("141945FD-18BD-4222-B6D9-F937704C7FFE")> _
<ComVisibleAttribute(True)> _
Public NotInheritable Class SnapshotGenerationAgent _
    Inherits AgentCore _
    Implements ISnapshotGenerationAgent
'使用
Dim instance As SnapshotGenerationAgent
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)]
[GuidAttribute("141945FD-18BD-4222-B6D9-F937704C7FFE")]
[ComVisibleAttribute(true)]
public sealed class SnapshotGenerationAgent : AgentCore, 
    ISnapshotGenerationAgent
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)]
[GuidAttribute(L"141945FD-18BD-4222-B6D9-F937704C7FFE")]
[ComVisibleAttribute(true)]
public ref class SnapshotGenerationAgent sealed : public AgentCore, 
    ISnapshotGenerationAgent
[<SealedAttribute>]
[<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)>]
[<GuidAttribute("141945FD-18BD-4222-B6D9-F937704C7FFE")>]
[<ComVisibleAttribute(true)>]
type SnapshotGenerationAgent =  
    class
        inherit AgentCore
        interface ISnapshotGenerationAgent
    end
public final class SnapshotGenerationAgent extends AgentCore implements ISnapshotGenerationAgent

SnapshotGenerationAgent 型は、以下のメンバーを公開しています。

コンストラクター

  名前 説明
パブリック メソッド SnapshotGenerationAgent SnapshotGenerationAgent クラスのインスタンスを作成します。

先頭に戻る

プロパティ

  名前 説明
パブリック プロパティ AbortPolicy 予期しないシャットダウンが発生した場合に実行中のレプリケーション エージェント スレッドをどのように終了するかを取得します。値の設定も可能です。 (AgentCore から継承されています。)
パブリック プロパティ BcpBatchSize 一括コピー操作でディストリビュータに送信する行数を取得します。値の設定も可能です。
パブリック プロパティ ComErrorCollection エージェントの実行中に発生したエラーの情報を返します。 (AgentCore から継承されています。)
パブリック プロパティ Distributor パブリケーションのディストリビュータとして動作している SQL Server のインスタンスの名前を取得します。値の設定も可能です。
パブリック プロパティ DistributorDeadlockPriority デッドロックが発生した場合の、ディストリビュータへのスナップショット エージェント接続の優先度を取得します。値の設定も可能です。
パブリック プロパティ DistributorEncryptedPassword インフラストラクチャです。
パブリック プロパティ DistributorEncryptionLevel ディストリビュータに接続するときにスナップショット エージェントが使用する SSL (Secure Sockets Layer) 暗号化のレベルを取得します。値の設定も可能です。
パブリック プロパティ DistributorLogin SQL Server 認証を使用してローカルのディストリビュータに接続するときに使用されるログイン名を取得します。値の設定も可能です。
パブリック プロパティ DistributorNetworkLibrary インフラストラクチャです。
パブリック プロパティ DistributorPassword SQL Server 認証を使用してローカルのディストリビュータに接続するときに使用されるパスワードを設定します。
パブリック プロパティ DistributorSecurityMode ローカルのディストリビュータに接続するときに使用されるセキュリティ モードを取得します。値の設定も可能です。
パブリック プロパティ DynamicFilterHostName パラメータ化された行フィルタで使用される HOST_NAME 関数に渡される値を取得します。値の設定も可能です。
パブリック プロパティ DynamicFilterLogin パラメータ化された行フィルタで使用される SUSER_SNAME 関数に渡される値を取得します。値の設定も可能です。
パブリック プロパティ DynamicSnapshotLocation パラメータ化された行フィルタに基づいて定義されるマージ パブリケーションのサブスクリプションに対する、パーティション スナップショットの場所を取得します。値の設定も可能です。
パブリック プロパティ FieldDelimiter SQL Server 一括コピーで扱うデータ ファイルの各フィールドの最後を示す 1 文字または文字のシーケンスを取得します。値の設定も可能です。
パブリック プロパティ FlatExceptionCollection インフラストラクチャです。 (AgentCore から継承されています。)
パブリック プロパティ HistoryVerboseLevel エージェントの実行中にログに記録される履歴の量を取得します。値の設定も可能です。 (AgentCore から継承されています。)
パブリック プロパティ HRBcpBlocks インフラストラクチャです。
パブリック プロパティ HRBcpBlockSize インフラストラクチャです。
パブリック プロパティ HRBcpDynamicBlocks インフラストラクチャです。
パブリック プロパティ LoginTimeout エージェントによる接続についてログインがタイムアウトするまでの秒数を取得します。値の設定も可能です。 (AgentCore から継承されています。)
パブリック プロパティ MaxBcpThreads 並列実行できる一括コピーの操作数を取得します。値の設定も可能です。
パブリック プロパティ MaxNetworkOptimization パーティション外の削除がサブスクライバに送信されるかどうかを取得します。値の設定も可能です。
パブリック プロパティ OnetimeDynamicSnapshot インフラストラクチャです。
パブリック プロパティ Output エージェントの出力ファイルの名前とパスを取得します。値の設定も可能です。 (AgentCore から継承されています。)
パブリック プロパティ OutputVerboseLevel エージェントの出力ファイルに書き込まれる情報の詳細さのレベルを取得します。値の設定も可能です。 (AgentCore から継承されています。)
パブリック プロパティ PacketSize インフラストラクチャです。 (AgentCore から継承されています。)
パブリック プロパティ ProfileName エージェントを実行するときに使用するエージェント プロファイルを取得します。値の設定も可能です。 (AgentCore から継承されています。)
パブリック プロパティ Publication パブリケーションの名前を取得します。値の設定も可能です。
パブリック プロパティ Publisher パブリッシャとして動作している SQL Server のインスタンスの名前を取得します。値の設定も可能です。
パブリック プロパティ PublisherDatabase パブリケーション データベースの名前を取得します。値の設定も可能です。
パブリック プロパティ PublisherDeadlockPriority デッドロックが発生した場合の、パブリッシャへのスナップショット エージェント接続の優先度を取得します。値の設定も可能です。
パブリック プロパティ PublisherEncryptedPassword インフラストラクチャです。
パブリック プロパティ PublisherEncryptionLevel ディストリビュータに接続するときにスナップショット エージェントが使用する SSL (Secure Sockets Layer) 暗号化のレベルを取得します。値の設定も可能です。
パブリック プロパティ PublisherFailoverPartner パブリケーション データベースとのデータベース ミラーリング セッションに参加しているフェールオーバー パートナーの SQL Server インスタンスを取得します。値の設定も可能です。 (AgentCore から継承されています。)
パブリック プロパティ PublisherLogin SQL Server 認証を使用してパブリッシャに接続するときに使用されるログイン名を取得します。値の設定も可能です。
パブリック プロパティ PublisherNetworkLibrary インフラストラクチャです。
パブリック プロパティ PublisherPassword SQL Server 認証を使用してパブリッシャに接続するときに使用されるパスワードを設定します。
パブリック プロパティ PublisherSecurityMode パブリッシャに接続するときに使用されるセキュリティ モードを取得します。値の設定も可能です。
パブリック プロパティ QueryTimeout クエリがタイムアウトするまでの秒数を取得します。値の設定も可能です。 (AgentCore から継承されています。)
パブリック プロパティ ReplicationType パブリケーションの種類を取得します。値の設定も可能です。
パブリック プロパティ RowDelimiter SQL Server 一括コピーで扱うデータ ファイルの各行の最後を示す 1 文字または文字シーケンスを取得します。値の設定も可能です。
パブリック プロパティ SecureDistributorEncryptedPassword インフラストラクチャです。
パブリック プロパティ SecureDistributorPassword SQL Server 認証を使用してローカルのディストリビュータに接続するときに使用されるパスワードを (SecureString オブジェクトとして) 設定します。
パブリック プロパティ SecurePublisherEncryptedPassword インフラストラクチャです。
パブリック プロパティ SecurePublisherPassword SQL Server 認証を使用してパブリッシャに接続するときに使用されるパスワードを (SecureString オブジェクトとして) 設定します。
パブリック プロパティ StartQueueTimeout 実行されているマージ パブリケーションのパーティション スナップショット プロセスの数が既に最大同時プロセス数に達している場合に、スナップショット エージェントが待機する時間を取得します。値の設定も可能です。
パブリック プロパティ Supports70Subscribers 生成されたスナップショットが SQL Server 7.0 のサブスクライバをサポートするかどうかを取得します。値の設定も可能です。

先頭に戻る

メソッド

  名前 説明
パブリック メソッド Abort (AgentCore から継承されています。)
パブリック メソッド CreateObjRef (MarshalByRefObject から継承されています。)
パブリック メソッド Equals (Object から継承されています。)
プロテクト メソッド Finalize (Object から継承されています。)
パブリック メソッド GenerateSnapshot スナップショット エージェントを開始してスナップショットを生成します。
パブリック メソッド GetHashCode (Object から継承されています。)
パブリック メソッド GetLifetimeService (MarshalByRefObject から継承されています。)
パブリック メソッド GetType (Object から継承されています。)
パブリック メソッド InitializeLifetimeService (MarshalByRefObject から継承されています。)
プロテクト メソッド MemberwiseClone() () () () (Object から継承されています。)
プロテクト メソッド MemberwiseClone(Boolean) (MarshalByRefObject から継承されています。)
パブリック メソッド ResetParametersToDefault (AgentCore から継承されています。)
パブリック メソッド ToString (Object から継承されています。)

先頭に戻る

イベント

  名前 説明
パブリック イベント ComStatus (AgentCore から継承されています。)
パブリック イベント Status 実行中のエージェントが状態情報を返すと発生します。 (AgentCore から継承されています。)

先頭に戻る

明示的なインターフェイスの実装

  名前 説明
明示的なインターフェイスの実装プライベート メソッド ISnapshotGenerationAgent. . :: . .ResetParametersToDefault

先頭に戻る

説明

SnapshotGenerationAgent クラスを使用すると、プログラムで直接スナップショット エージェントにアクセスできます。

SnapshotGenerationAgent クラスでは、次のレプリケーション タスクを実行するための機能がサポートされています。

  • 初期スナップショットを生成する。

  • パラメータ化されたフィルタに基づいて定義されるサブスクリプションのパーティション スナップショットを生成する。

使用例

この例では、トランザクション パブリケーションの標準のスナップショットを生成します。

          // Set the Publisher, publication database, and publication names.
            string publicationName = "AdvWorksProductTran";
            string publicationDbName = "AdventureWorks2008R2";
            string publisherName = publisherInstance;
            string distributorName = publisherInstance;

            SnapshotGenerationAgent agent;

            try
            {
                // Set the required properties for Snapshot Agent.
                agent = new SnapshotGenerationAgent();
                agent.Distributor = distributorName;
                agent.DistributorSecurityMode = SecurityMode.Integrated;
                agent.Publisher = publisherName;
                agent.PublisherSecurityMode = SecurityMode.Integrated;
                agent.Publication = publicationName;
                agent.PublisherDatabase = publicationDbName;
                agent.ReplicationType = ReplicationType.Transactional;

                // Start the agent synchronously.
                agent.GenerateSnapshot();

            }
            catch (Exception ex)
            {
                // Implement custom application error handling here.
                throw new ApplicationException(String.Format(
                    "A snapshot could not be generated for the {0} publication."
                    , publicationName), ex);
            }
' Set the Publisher, publication database, and publication names.
Dim publicationName As String = "AdvWorksProductTran"
Dim publicationDbName As String = "AdventureWorks2008R2"
Dim publisherName As String = publisherInstance
Dim distributorName As String = publisherInstance

Dim agent As SnapshotGenerationAgent

Try
    ' Set the required properties for Snapshot Agent.
    agent = New SnapshotGenerationAgent()
    agent.Distributor = distributorName
    agent.DistributorSecurityMode = SecurityMode.Integrated
    agent.Publisher = publisherName
    agent.PublisherSecurityMode = SecurityMode.Integrated
    agent.Publication = publicationName
    agent.PublisherDatabase = publicationDbName
    agent.ReplicationType = ReplicationType.Transactional

    ' Start the agent synchronously.
    agent.GenerateSnapshot()

Catch ex As Exception
    ' Implement custom application error handling here.
    Throw New ApplicationException(String.Format( _
     "A snapshot could not be generated for the {0} publication." _
     , publicationName), ex)
End Try

この例では、マージ パブリケーションの標準のスナップショットを生成します。

// Set the Publisher, publication database, and publication names.
string publicationName = "AdvWorksSalesOrdersMerge";
string publicationDbName = "AdventureWorks2008R2";
string publisherName = publisherInstance;
string distributorName = publisherInstance;

SnapshotGenerationAgent agent;

try
{
    // Set the required properties for Snapshot Agent.
    agent = new SnapshotGenerationAgent();
    agent.Distributor = distributorName;
    agent.DistributorSecurityMode = SecurityMode.Integrated;
    agent.Publisher = publisherName;
    agent.PublisherSecurityMode = SecurityMode.Integrated;
    agent.Publication = publicationName;
    agent.PublisherDatabase = publicationDbName;
    agent.ReplicationType = ReplicationType.Merge;

    // Start the agent synchronously.
    agent.GenerateSnapshot();

}
catch (Exception ex)
{
    // Implement custom application error handling here.
    throw new ApplicationException(String.Format(
        "A snapshot could not be generated for the {0} publication."
        , publicationName), ex);
}
' Set the Publisher, publication database, and publication names.
Dim publicationName As String = "AdvWorksSalesOrdersMerge"
Dim publicationDbName As String = "AdventureWorks2008R2"
Dim publisherName As String = publisherInstance
Dim distributorName As String = publisherInstance

Dim agent As SnapshotGenerationAgent

Try
    ' Set the required properties for Snapshot Agent.
    agent = New SnapshotGenerationAgent()
    agent.Distributor = distributorName
    agent.DistributorSecurityMode = SecurityMode.Integrated
    agent.Publisher = publisherName
    agent.PublisherSecurityMode = SecurityMode.Integrated
    agent.Publication = publicationName
    agent.PublisherDatabase = publicationDbName
    agent.ReplicationType = ReplicationType.Merge

    ' Start the agent synchronously.
    agent.GenerateSnapshot()

Catch ex As Exception
    ' Implement custom application error handling here.
    Throw New ApplicationException(String.Format( _
     "A snapshot could not be generated for the {0} publication." _
     , publicationName), ex)
End Try

この例では、HOST_NAME 関数をオーバーロードして、フィルタが適用されたデータ スナップショットを生成します。このスナップショットはパラメータ化されたフィルタを持つマージ パブリケーションのサブスクリプションに対するものです。

            // Set the Publisher, publication database, and publication names.
            string publicationName = "AdvWorksSalesOrdersMerge";
            string publicationDbName = "AdventureWorks2008R2";
            string publisherName = publisherInstance;
            string distributorName = publisherInstance;

            SnapshotGenerationAgent agent;

            try
            {
                // Set the required properties for Snapshot Agent.
                agent = new SnapshotGenerationAgent();
                agent.Distributor = distributorName;
                agent.DistributorSecurityMode = SecurityMode.Integrated;
                agent.Publisher = publisherName;
                agent.PublisherSecurityMode = SecurityMode.Integrated;
                agent.Publication = publicationName;
                agent.PublisherDatabase = publicationDbName;
                agent.ReplicationType = ReplicationType.Merge;

                // Specify the partition information to generate a 
                // filtered snapshot based on Hostname.
                agent.DynamicFilterHostName = hostname;

                // Start the agent synchronously.
                agent.GenerateSnapshot();
            }
            catch (Exception ex)
            {
                // Implement custom application error handling here.
                throw new ApplicationException(String.Format(
                    "A snapshot could not be generated for the {0} publication."
                    , publicationName), ex);
            }
' Set the Publisher, publication database, and publication names.
Dim publicationName As String = "AdvWorksSalesOrdersMerge"
Dim publicationDbName As String = "AdventureWorks2008R2"
Dim publisherName As String = publisherInstance
Dim distributorName As String = publisherInstance

Dim agent As SnapshotGenerationAgent

Try
    ' Set the required properties for Snapshot Agent.
    agent = New SnapshotGenerationAgent()
    agent.Distributor = distributorName
    agent.DistributorSecurityMode = SecurityMode.Integrated
    agent.Publisher = publisherName
    agent.PublisherSecurityMode = SecurityMode.Integrated
    agent.Publication = publicationName
    agent.PublisherDatabase = publicationDbName
    agent.ReplicationType = ReplicationType.Merge

    ' Specify the partition information to generate a 
    ' filtered snapshot based on Hostname.
    agent.DynamicFilterHostName = hostname

    ' Start the agent synchronously.
    agent.GenerateSnapshot()
Catch ex As Exception
    ' Implement custom application error handling here.
    Throw New ApplicationException(String.Format( _
     "A snapshot could not be generated for the {0} publication." _
     , publicationName), ex)
End Try

スレッド セーフ

この型の public static (Visual Basic では Shared) のメンバーはすべて、スレッド セーフです。インスタンス メンバーの場合は、スレッド セーフであるとは限りません。