function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jayamjayam 

manage 100 millions of record in Apex

Hi,

 

How can I manage /Access /Update 100 millions of records in Apex .

 

Is it Possible using Batch Apex?

 

I think batch apex can Process 50 millions of records.

 

how can I do this?

 

any help?

 

Thanks

 

 

Best Answer chosen by Admin (Salesforce Developers) 
spraetzspraetz

My recommendation for you would be to use batch apex which can work on up to 50 million records.  To work on 100 million, you'd have to logically split up your jobs into smaller chunks and run multiple batch jobs.

 

What exactly do you want your batch job to do on such a large data set?

All Answers

spraetzspraetz

My recommendation for you would be to use batch apex which can work on up to 50 million records.  To work on 100 million, you'd have to logically split up your jobs into smaller chunks and run multiple batch jobs.

 

What exactly do you want your batch job to do on such a large data set?

This was selected as the best answer
jayamjayam

Thanks for your reply Spraetz....

 

how can I split my data to run multiple batch jobs?

 

 All the data we have to query in Start method

 

but the Scope of Database.queryLocator is 5o million  .

 

how can we call start method multiple times to query remaining Data?

 

Can u Send any example? plzzzzz

 

thank u.....

Pradeep_NavatarPradeep_Navatar

Below is sample code of JavaScript API to retrieve millions of records:

 

                                 <script type = "text/javascript">

                                                 var __sfdcSessionId = '{!GETSESSIONID()}';

                                 </script>

                                 <script src="../../soap/ajax/19.0/connection.js" type = "text/javascript"></script>

 

                                <script type = "text/javascript">

                                                var a = 0;

                                                sforce.connection.batchSize = 200;

                                                queryResult = sforce.connection.query("Select Id, Name From Target__c Where StatusId__c = " + "'" + OptionValStatus + "'");

 

                                                while(a < queryResult.size)

                                                {

                                                                if(a != 0)

                                                                {

                                                                                queryResult = sforce.connection.queryMore(queryResult.queryLocator);

                                                                }

 

                                                                var records = queryResult.getArray('records');

                                                                var TargetToAddArr = new Array();

                                                                for (var i = 0; i < records.length; i++)

                                                                {

                                                                                var Trgt = new sforce.SObject("Target__c");

                                                                                Trgt["ID"] = records[i].Id;

                                                                                Trgt["StatusId__c"] = OptionValStatusCurr ;

                                                                                Trgt["StageId__c"] = OptionValStageCurr ;

                                                                                TargetToAddArr[i] = Trgt;

                                                                                tot++;

                                                                }

                                                                sforce.connection.update(TargetToAddArr);

                                                                a = a + 200;

                                                }                             

                                </script>

 

You can also retrieve more than millions of records using batch apex.

jayamjayam

Thanks for your Reply Pradeep.

 

I want  to manage  more than   50 milllions of Records throurh Batch Apex only

 

 

How can i do this ?

 

if u Know Please share with me

 

 

thanks:

 

Jaya.

john s.john s.
Hello jayam,

Look Here (http://neerajgupta999.blogspot.de/2012/07/automate-bulk-data-loading-through.html) or some one else 

best regards john s. 
eric don 6eric don 6
The Liteblue USPS is the largest postal network in the world and hence it requires a system to manage all databases for the employees too. There are many benefits with the LiteBlue Online Login services that the users get. It will most importantly allow the users to access their employment status, work status and career guidelines within the Postal community. https://liteblue.red
Binh Tran ThanhBinh Tran Thanh
You can move your data to postgresql and sync it to salesforce