SF_MirrorAll


SF_MirrorAll


Usage

SF_MirrorAll 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 do a full copy or delta copy on each individual table in the list.

If SF_MirrorAll decides to do a full copy on the individual table, it creates a full backup with the contents of the Salesforce.com object as a table in the remote database of the remote SQL Server Instance. If SF_MirrorAll decides to do a delta copy on the individual table, it compares the current table in the remote database with the contents of the same object at Salesforce.com. It detects any changes (insert, deletes, or updates) and updates the table with those changes.

Salesforce objects that cannot be queried via the Salesforce API with no WHERE clause (like ActivityHistory) are not included. SF_MirrorAll also skips all Chatter Feed objects because of the excessive API calls required to download those objects. You can modify SF_MirrorAll to include them if needed.

Syntax

EXEC SF_MirrorAll '𝘭𝘪𝘯𝘬𝘦𝘥_𝘴𝘦𝘳𝘷𝘦𝘳', 'allow_fail', 'error_messages_only', 'use_remote'

where linked_server is your linked server name. use_remote must be set to 1.

Example

The following example creates a full copy or does a delta copy of all the current data on Salesforce.com using the SALESFORCE linked server in 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 unneeded tables in SF_MirrorAll. Also, use the DBAmpTableOptions table to provide options for tables when using SF_MirrorAll. You can specify options that tell SF_Mirror how to make a full copy of the table in the remote database. If there is not an entry for a given Salesforce object specified in the DBAmpTableOptions table, SF_Mirror decides the best way to make a full copy of the object. See “Using the DBAmpTableOptions Table” for more information.

Notes

• SF_MirrorAll calls SF_Mirror for each Salesforce.com object. • There are some Salesforce tables, like Vote and UserProfileFeed, that are not included in SF_MirrorAll. The Salesforce.com API does not allow selecting all rows from these tables. SF_MirrorAll also skips Chatter Feed objects because of the excessive API calls required to download those objects. You can modify SF_MirrorAll to include the Feed objects if needed. • By default, DBAmp does not download the values of Base64 fields but instead sets the value to NULL. This is done for performance reasons.

NOTE: If you have mirrored the table, SF_MirrorAll uses the • SOAP API when the row count of the local table is below 20,000 • BulkAPI when the row count is above 20,000 when doing a full copy.