FORCEGC

To eliminate overhead memory usage a garbage collection can explicitly be configured to be run after this amount of rows. This is only necessary in case of limited amount of memory on the server.

Syntax:

FORCEGC count_of_rows

Example:

/* In this example we are using the Oracle Managed Data provider and retrieving data from an Oracle database */ 
LOAD ASSEMBLY 'Oracle.ManagedDataAccess.dll'
DATASOURCE oracledb=DOTNET CONNECTION 'Oracle.ManagedDataAccess.Client.OracleConnection'
'data source=(DESCRIPTION =(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =myOracleServer)(PORT = 1521)))
(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = )));User Id = oracleLogin; Password = readOraclePassword'

/* Force garbage collection to run every 10 million rows in this script – thereby freeing up memory during the import process*/
FORCEGC 10000000
/* Read the SalesInvoiceLines table with 400 mill rows */
IMPORT SalesInvoiceLines=oracledb.{SELECT * FROM SALESINVOICELINES}
/* Write the table to disk and release memory */
FLUSH
/* Import other tables where we don't need to worry about memory */
DO PARALLEL
IMPORT LOCATIONS=oracledb.{SELECT * FROM LOCATIONS}
IMPORT DEPARTMENTS=oracledb.{SELECT * FROM DEPARTMENTS}
IMPORT PRODUCTS=oracledb.{SELECT * FROM PRODUCTS}
IMPORT EMPLOYEES=oracledb.{SELECT * FROM EMPLOYEES}
END PARALLEL
/* Commit data to disk */
SAVE
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.