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 型は、以下のメンバーを公開しています。
プロパティ
名前 | 説明 | |
---|---|---|
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 から継承されています。) |
先頭に戻る
説明
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) のメンバーはすべて、スレッド セーフです。インスタンス メンバーの場合は、スレッド セーフであるとは限りません。