Skip to main content

Replicating Salesforce data to Oracle

The following TQL will load all data from the Salesforce Business_c object to the Oracle table BUSINESS_ORACLE_P, then stop writing (in other words, new data will be ignored). Replace ******** with your Salesforce access token (see Understanding the Web Server OAuth Authentication Flow on developer.salesforce.com).

CREATE SOURCE SalesforceCloud USING SalesForceReader (
  sObjects: 'Business__c',
  authToken: '********',
  mode: 'BulkLoad',
  apiEndPoint: 'https://ap2.salesforce.com',
  autoAuthTokenRenewal: false
)
OUTPUT TO DataStream;

CREATE TARGET OracleOnPremise USING DatabaseWriter (
  ConnectionURL:'jdbc:oracle:thin:@192.168.123.18:1521/XE',
  Username:'system',
  Password:'manager',
  Tables: 'Business__c,SYSTEM.BUSINESS_ORACLE_P'
)
INPUT FROM DataStream;

The following TQL will replicate multiple objects:

CREATE SOURCE SalesforceCloud USING SalesForceReader (
  sObjects: 'Business1__c;Business2__c',
  apiEndPoint: 'https://ap2.salesforce.com',
  mode: 'Incremental',
  authToken: '***' )
OUTPUT TO DataStream;

CREATE TARGET OracleOnPremise USING DatabaseWriter (
  ConnectionURL: 'jdbc:oracle:thin:@localhost:1521/XE',
  Username: 'qatest',
  Tables: 'Business1__c,qatest.BUSINESS_ORACLE_P1 COLUMNMAP(ID=ID);Business2__c,qatest.BUSINESS_ORACLE_P2
    COLUMNMAP(ID=ID)',
  Password: '***'
INPUT FROM DataStream;

The following TQL will replicate new data continuously:

CREATE SOURCE SalesforceCloud USING SalesForceReader ( 
  sObject: 'Business__c',
  authToken: '********',
  pollingInterval: '5 min',
  apiEndPoint: 'https://ap2.salesforce.com',
  mode: 'Incremental'
 ) 
OUTPUT TO DataStream;

CREATE TARGET OracleOnPremise USING DatabaseWriter ( 
  DriverName:'oracle.jdbc.OracleDriver',
  ConnectionURL:'jdbc:oracle:thin:@192.168.123.18:1521/XE',
  Username:'system',
  Password:'manager',
  Tables: 'Business__c,SYSTEM.BUSINESS_ORACLE_P'
 ) 
INPUT FROM DataStream;