Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Spooling to Text File - 30 million records - Getting Out of Memory Error

spalato76Dec 19 2010 — edited Dec 19 2010
Hi All,

I have an extremely large oracle table that I need to spool to a .txt file. The table has approximately 30 million records. I'm using Toad For Oracle version 10.5 and I'm on Oracle 10g. I've tried running the following spool command a few times and it keeps crashing...I'm getting a "Out of Memory" error in my Toad window when I execute it as a script. Here's the code:

Spool on
set heading off
SET PAGESIZE 0
SET TRIMSPOOL ON
SET LINESIZE 100
set feedback off
set echo off
set termout off
Spool "C:\spooledtext.txt"
select
column1
from test_table
order by
column2,
column1
Spool off;

An ideas as to how I can get this query to spool to a text file without crashing and running out of memory?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 16 2011
Added on Dec 19 2010
1 comment
999 views