Replication Snapshot Agent Utility

The Replication Snapshot Agent utility configures and begins a replication Snapshot Agent, which prepares snapshot files of published tables and stored procedures, stores the files on the Distributor, and records information about the synchronization status in the distribution database. This syntax is used at the command prompt, and the executable file can be found in the \Mssql7\Binn directory.

Syntax

snapshot [-?]
-PublisherDB publisher_database
-Publication publication_name
[-BcpBatchSize bcp_batch_size]
[-Continuous]
[-DefinitionFile def_path_and_file_name]
[-Distributor distributor]
[-DistributorLogin distributor_login]
[-DistributorPassword distributor_password]
[-DistributorSecurityMode [0|1]]
[-FieldDelimiter field_delimiter]
[-HistoryVerboseLevel [0|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. For both types of distribution, this parameter is valid only for immediate_sync publications. If this parameter is not specified, then the Distributor processes all the nonimmediate_sync publications in the Publisher database.
-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 distributor_login
Is the Distributor’s login name.
-DistributorPassword distributor_password
Is the Distributor’s password.
-DistributorSecurityMode [0|1]
Specifies the Distributor’s security mode. A value of 0 indicates SQL Server Authentication Mode (default), and a value of 1 indicates Windows NT Authentication Mode.
-FieldDelimiter field_delimiter
Is the character or character sequence that marks the end of a field in the Microsoft® SQL Server™ bulk-copy data file. The default is \n<x$3>\n.
-HistoryVerboseLevel [0|1|2|3]
Specifies the amount of history logged during a snapshot operation. You can minimize the performance affect of history logging by selecting 1.

 

HistoryVerboseLevel value Description
1 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 Default. 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’s login name.
-PublisherPassword publisher_password
Is the Publisher’s password.
-PublisherSecurityMode [0|1]
Specifies the Publisher’s security mode. A value of 0 indicates Mixed Mode (default), and a value of 1 indicates Windows NT 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.

Important If you 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 NT Authentication Mode when it logs in to SQL Server, the Snapshot Agent fails. The default setting is Mixed Mode.


See Also
Snapshot Agent Profile Monitoring Replication Agents


(c) 1988-98 Microsoft Corporation. All Rights Reserved.