SF_MirrorAll
SF_MirrorAll
Usage
The SF_MirrorAll stored procedure is a hybrid of the SF_ReplicateAll and SF_RefreshAll stored procedures. SF_MirrorAll retrieves a list of the current objects from Salesforce and automatically chooses whether to perform a full copy or delta copy on each individual table in the list.
If SF_MirrorAll performs a full copy of an individual table, it creates a full backup by copying the contents of the Salesforce.com object into a table in the remote database of the remote SQL Server instance. If SF_MirrorAll performs a delta copy, it compares the existing table in the remote database with the current contents of the same object in Salesforce.com. It detects any inserts, deletes, or updates and applies those changes to the table.
Salesforce objects that cannot be queried through the Salesforce API without a WHERE clause (for example, ActivityHistory) are not included. SF_MirrorAll also skips all Chatter Feed objects because downloading them requires an excessive number of API calls. You can modify SF_MirrorAll to include these objects if necessary.
Syntax
EXEC SF_MirrorAll 'linked-server', 'allow_fail', 'error_messages_only', 'opts', 'use-remote'
In this syntax:
-
The
optsparameter provides additional control over remote execution. Use' 'to follow the remote settings that are configured in the DBAmp Configuration Program, or useskipremoteto bypass remote execution entirely. If you specifyskipremote, theuse-remotesetting is ignored. -
The
use-remoteparameter specifies that you are targeting a database with this remote stored procedure. This parameter must be set to 1.
Example
This example creates either a full copy or a delta copy of all the current data from Salesforce.com. It uses the SALESFORCE linked server to replicate the data to the remote database of the remote SQL Server instance.
EXEC SF_MirrorAll 'SALESFORCE', 'no', 'no','', 1
Using the DBAmpTableOptions Table
Use the DBAmpTableOptions table to skip unnecessary tables in SF_MirrorAll. You can also use this DBAmpTableOptions table to provide options for tables when you use SF_MirrorAll. You can specify options that instruct the SF_Mirror stored procedure how to make a full copy of the table in the remote database.
If no entry is specified for a given Salesforce object that is specified in the DBAmpTableOptions table, SF_Mirror determines the best way to create a full copy of the object.
For more information on using the DBAmpTableOptions table see Using the DBAmpTableOptions Table.
Notes
-
The SF_MirrorAll stored procedure calls the SF_Mirror stored procedure for each Salesforce.com object.
-
Some Salesforce tables, like Vote and UserProfileFeed, are not included in SF_MirrorAll. The Salesforce.com API does not allow SF_MirrorAll to select all rows from these tables. SF_MirrorAll also skips Chatter Feed objects because of the excessive API calls that are required to download those objects. However, you can modify SF_MirrorAll to include the Chatter Feed objects if necessary.
-
By default, DBAmp does not download the values of Base64 fields. Instead, it sets the value to
NULL. This behavior improves performance when you replicate large datasets. -
If the table has already been mirrored, SF_MirrorAll chooses the API based on the row count of the local table when it performs a full copy. If the row count is less than 20,000, it uses the SOAP API. If the row count exceeds 20,000, it uses the Bulk API.