Replication Snapshot Agent Utility

Command Prompt Utilities

Command Prompt Utilities

Replication Snapshot Agent Utility

The Replication Snapshot Agent utility configures and begins the Snapshot Agent, which prepares snapshot files containing schema and data of published tables and database objects, stores the files in the snapshot folder, and records synchronization jobs in the distribution database.

Syntax

snapshot [-?]
-Publisher server_name[\instance_name]
-PublisherDB publisher_database
-Publication publication_name
[-BcpBatchSize bcp_batch_size]
[-Continuous]
[-DefinitionFile def_path_and_file_name]
[-Distributor server_name[\instance_name]]
[-DistributorLogin distributor_login]
[-DistributorPassword distributor_password]
[-DistributorSecurityMode [0|1]]
[-FieldDelimiter field_delimiter]
[-HistoryVerboseLevel [1|2|3]
[-LoginTimeOut login_time_out_seconds]
[-MaxBcpThreads]
[-Output output_path_and_file_name]
[-OutputVerboseLevel [0|1|2]
[-PublisherLogin publisher_login]
[-PublisherPassword publisher_password]
[-PublisherSecurityMode [0|1]]
[-QueryTimeOut query_time_out_seconds]
[-ReplicationType [1|2]]
[-RowDelimiter row_delimiter]

Note  Parameters can be specified in any order.

Arguments

-?

Prints all available parameters.

-PublisherDB publisher_database

Is the name of the Publisher database.

-Publication publication

Is the name of the publication. This parameter is only valid if the publication is set to always have a snapshot available for new or reinitialized subscriptions.

-BcpBatchSize bcp_batch_size

Is the number of rows to send in a bulk copy operation. When performing a bcp in operation, the batch size is the number of rows to send to the server as one transaction, and also the number of rows that must be sent before the Distribution Agent logs a bcp progress message. When performing a bcp out operation, a fixed batch size of 1000 is used. A value of 0 indicates no message logging.

-Continuous

Specifies whether the agent attempts to poll replicated transactions continually. If specified, the agent polls replicated transactions from the source at polling intervals even if there are no transactions pending.

-DefinitionFile def_path_and_file_name

Is the path of the agent definition file. An agent definition file contains command prompt arguments for the agent. The content of the file is parsed as an executable file. Double quotation marks (") can be used to specify argument values containing arbitrary characters.

-Distributor distributor

Is the Distributor name.

-DistributorLogin server_name[\instance_name]

Is the Distributor login name. Specify server_name for the default instance of Microsoft® SQL Server™ 2000 on that server. Specify server_name\instance_name for a named instance of SQL Server 2000 on that server.

-DistributorPassword distributor_password

Is the Distributor password.

-DistributorSecurityMode [0|1]

Specifies the security mode of the Distributor. A value of 0 indicates SQL Server Authentication Mode (default), and a value of 1 indicates Windows Authentication Mode.

-FieldDelimiter field_delimiter

Is the character or character sequence that marks the end of a field in the SQL Server bulk-copy data file. The default is \n<x$3>\n.

-HistoryVerboseLevel [1|2|3]

Specifies the amount of history logged during a snapshot operation. You can minimize the performance effect of history logging by selecting 1.

HistoryVerboseLevel value
Description
1 Default. Always update a previous history message of the same status (startup, progress, success, and so forth). If no previous record with the same status exists, insert a new record.
2 Insert new history records unless the record is for such things as idle messages or long-running job messages, in which case update the previous records.
3 Always insert new records, unless it is for idle messages.

-LoginTimeOut login_time_out_seconds

Is the number of seconds before the login times out. The default is 15 seconds.

-MaxBcpThreads

Specifies the number of bulk copy operations that can be performed in parallel. The maximum number of threads and ODBC connections that exist simultaneously is the lesser of MaxBcpThreads or the number of bulk copy requests that appear in the synchronization transaction in the distribution database. MaxBcpThreads must have a value greater than zero, and has no hard-coded upper limit. The default is 1.

-Output output_path_and_file_name

Is the path of the agent output file. If the file name is not provided, the output is sent to the console. If the specified file name exists, the output is appended to the file.

-OutputVerboseLevel [0|1|2]

Specifies whether the output should be verbose. If the verbose level is 0, only error messages are printed. If the verbose level is 1, all the progress report messages are printed. If the verbose level is 2 (default), all error messages and progress report messages are printed, which is useful for debugging.

-PublisherLogin publisher_login

Is the Publisher login name.

-PublisherPassword publisher_password

Is the Publisher password.

-PublisherSecurityMode [0|1]

Specifies the security mode of the Publisher. A value of 0 indicates SQL Server Authentication (default), and a value of 1 indicates Windows Authentication Mode.

-QueryTimeOut query_time_out_seconds

Is the number of seconds before the query times out. The default is 30 seconds.

-ReplicationType [1|2]

Specifies the type of replication. A value of 1 indicates transactional replication, and a value of 2 indicates merge replication.

-RowDelimiter row_delimiter

Is the character or character sequence that marks the end of a row in the SQL Server bulk-copy data file. The default is \n<,@g>\n.

Remarks

Important  If you have installed SQL Server Agent to run under a Local System account rather than under a Domain User account (the default), the service can access only the local computer. If the Snapshot Agent that runs under SQL Server Agent is configured to use Windows Authentication Mode when it logs in to SQL Server, the Snapshot Agent fails. The default setting is SQL Server Authentication.

For information about where to find or how to run this utility, see Getting Started with Command Prompt Utilities.

See Also

Replication Agents

Snapshot Agent Profile