Using the DBAmpTableOptions table


Using the DBAmpTableOptions table


Use the DBAmpTableOptions table to skip tables that are not needed locally in the SF_Mirror and SF_MirrorAll stored procedures. Additionally, use the DBAmpTableOptions table to provide options for tables when using SF_Mirror and SF_MirrorAll.

The DBAmpTableOptions table contains these columns:

  • TableName—the name of the Salesforce object. There can only be one row per Salesforce object in this table. This column cannot be null.

  • Options—any options that can be specified in the options parameter of SF_Mirror. This includes: bulkapi, pkchunk, batchsize, soap, subset, etc. This column can be null.

  • SkipTable—this is a bit column. Specify 1 to skip the Salesforce object in SF_MirrorAll. The default is 0.

  • Comments—(optional) any comments you want to include about why the Salesforce object entry is in the DBAmpTableOptions table.

Examples for individual tables

  • To stop the AcceptedEventRelation table from being replicated or refreshed locally and provide a reason for doing so, run the following command in the Salesforce Backups database:

     INSERT INTO DBAmpTableOptions (TableName, SkipTable, Comments) Values
     ('AcceptedEventRelation', 1, 'Not needed locally')
    
  • To use the pkchunk and batchsize options SF_Mirror and SF_MirrorAll when the Accounttable is being replicated locally and provide a reason for doing so, run the following command in the Salesforce Backups database:

     INSERT INTO **DBAmpTableOptions**  (TableName, Options, Comments) Values
     ('Account', 'pkchunk,batchsize(50000)', 'Use pkchunk when replicating  Account')
    

Wildcards

In addition to specifying individual table names, wildcard names can also be specified. For example, %Share or Solution%:

  • %Share skips every table name that ends with “Share”.
  • Solution% skips every table that starts with “Solution”.

NOTE: Specific table names override wildcard names. For example, if %Share and AccountShare are specified in the DBAmpTableOptions table, the AccountShare entry is chosen over %Share.

Examples that Use Wildcards

  • To skip all tables that end with History from being replicated or refreshed locally and provide a reason for doing so, run the following command in the Salesforce Backups database:

    INSERT INTO DBAmpTableOptions (TableName, SkipTable, Comments) Values
    ('%History', 1, 'Not needed locally')
    
  • To use the bulkapi option with SF_Mirror and SF_MirrorAll when all tables that end with “Share” are being replicated locally and provide a reason for doing so, run the following command in the Salesforce backups database:

     INSERT INTO DBAmpTableOptions (TableName, Options, Comments) Values
     ('%Share', 'bulkapi', 'Use bulkapi when replicating any table that ends with
     Share')
    
  • To use the pkchunk option with SF_Mirror and SF_MirrorAll, when using ColumnSubset on the Account table, and provide a reason for doing so, run the following command in the Salesforce Backups database:

     INSERT INTO DBAmpTableOptions (TableName, Options, Comments) Values
     ('Account', 'pkchunk', 'Use pkchunk when replicating Account_ColumnSubsetAM
     and Account_ColumnSubsetNZ')
    

    When using the DBAmpTableOptions table with a ColumnSubset table, enter the Salesforce object name as the TableName. For example, if the ColumnSubset table is Contact_ColumnSubsetAM, enter “Contact”.

  • To skip all tables except tables that start with “Account” from SF_MirrorAll, run the following commands in the Salesforce backups database:

     INSERT INTO DBAmpTableOptions (TableName, SkipTable, Comments) Values ('%',
     1, 'Used to skip all tables from being replicated/refreshed')
    
     INSERT INTO DBAmpTableOptions (TableName, Options, SkipTable, Comments)
     Values ('Account%', 'bulkapi', 0, 'Used to replicate/refresh all tables that
     start with Account')
    

The % wild card character with SkipTable set to 1 directs SF_MirrorAll to skip every table.

NOTE: The DBAmpTableOptions table is user-maintained and is not overwritten in either of these cases:

  • You upgrade DBAmp
  • You execute Create DBAmp SPROCS to update the DBAmp stored procedures

The DBAmpTableOptions table also impacts the older SF_ReplicateAll and SF_RefreshAll stored procedures.