Click here to Skip to main content
15,888,283 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi!

I am reading data from Oracle database by using ODP.Net with the follwing code

C#
OracleConnection con = new OracleConnection(connectionString);
        OracleCommand cmd = new OracleCommand(_SELECT ID,RECORD(XMLType) FROM tbl_Name, con);
        con.Open();
        OracleDataReader _dataReader = cmd.ExecuteReader();
        _dataReader.FetchSize = cmd.RowSize * 25;

 		while (_dataReader.Read())
                	{
		 string rowId = _dataReader[0].ToString();
                     string xmlString = _dataReader[1].ToString();
		adding this data into Queue for further processing
		        }


It working fine but in a minute it's reading only 10000 record. If I use SqlServer database it's reading 500000 record in minute having table with same schema. I am not getting why this much difference between two databases.

For improvement I tried with following options:
C#
Pooling=true/false;
Statement Cache Size=0/1;
_dataReader.FetchSize = cmd.RowSize * 25;


but no improvement at all.

Please help me if I am missing something to read data faster using ODP.NET

Thank you.

-Dattatrya Moin
Posted
Updated 19-Apr-12 22:38pm
v3

1 solution

Hi,

please have a look at this threads, maybe you can improve performance, it's really a worth speed.

http://stackoverflow.com/questions/3655399/oracle-query-is-slow-or-fails-from-net-app-but-is-fast-from-sql-developer[^]

Discussion at Oracle Forum:
https://forums.oracle.com/forums/thread.jspa?threadID=514773[^]

With Best Regards
 
Share this answer
 
v2
Comments
Dattatrya Moin 11 23-Apr-12 2:48am    
Thank you for your suggestion. I solved that problem is in Select Query we have to use getStringVal() or getClobVal() functions in Select query. If we use directly XML column it carry some row information with that so takes more bandwidth causes low speed.

Thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900