Dynamically allocate a buffer for a database query according to the actual record size

I am using Perl 5.8.3 script to query Oracle 11g database. Connection established with Win32 ODBC extension:

http://search.cpan.org/~gsar/libwin32-0.191/ODBC/ODBC.pm

As you can see in the documentation (link), the buffer size is limited to 10K. This buffer size is in some cases insufficient (ie, too small).

  • Excerpt from the above link: "The amount of memory that is allocated to receive field record data is dynamic and changes when it needs to be larger." I tested it and the buffer size doesn't grow with big data. These are just mistakes. Is there any configuration / setting / initialization / parameters I need to do? Am I missing something here?
  • What is the lifetime of the allocated buffer? Is this for the entire time of an open connection?
  • I can increase the buffer size with SetMaxBuffer up to 2GB. But to what size? Having too much can lead to server stability. One option is to get the row length (actual byte size for all columns to write, not average) so that we can dynamically allocate enough buffer size. Is there an easy way to do this, or should I count the sum of all columns? This option will increase the DB trips, but in this particular case it is not a problem. Related: Oracle - How to get the actual size of a specific ROW? http://www.dba-oracle.com/t_get_length_of_row.htm

Thanks in advance!

+1


source to share





All Articles