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!

Unix Script - Oracle SQL spooling to create a file

3391232Jul 4 2017 — edited Jul 5 2017

Hi ,

I am using Unix shell script to read data from a table and generate a flat file. The table size is about 20GB. The Unix shell script gets stop spooling data into target file after 2049MB file size.

Is there any limitation on spooling data into a file? If yes, is there any way to change it?

Here is the part of the Unix script to connect Oracle and spooling.

Status=`sqlplus -s /nolog <<EOF

set feed off pause off pages 0 head off veri off line 5000

SET ARRAYSIZE 5000

SET PAGESIZE 0

SET TRIMSPOOL ON

CONNECT $user_id/$passwd@$server

spool $rootdirectory/testing/TB_$tablename.dat

whenever sqlerror exit sql.sqlcode;

alter session set nls_date_format='YYYY.MM.DD HH24:MI:SS';

alter session set nls_timestamp_format='YYYY.MM.DD HH24:MI:SS';

$SQL_ST

spool off;

exit;

EOF`

Thanks in advance - Ravi

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 2 2017
Added on Jul 4 2017
8 comments
1,570 views