Return-Path: <oracle-l-bounce@freelists.org>
Delivered-To: 2-oracle-l@orafaq.com
Received: (qmail 14768 invoked from network); 6 Jun 2006 22:51:15 -0500
Received: from freelists-180.iquest.net (HELO turing.freelists.org) (206.53.239.180)
  by 69.64.49.119 with SMTP; 6 Jun 2006 22:51:15 -0500
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 4D20C34DA36;
 Tue,  6 Jun 2006 23:51:15 -0400 (EDT)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 08920-03; Tue, 6 Jun 2006 23:51:15 -0400 (EDT)
Received: from turing (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id B94C234D5EE;
 Tue,  6 Jun 2006 23:51:14 -0400 (EDT)
Received: with ECARTIS (v1.0.0; list oracle-l); Tue, 06 Jun 2006 23:50:31 -0400 (EDT)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 9ECFD34D66C
 for <oracle-l@freelists.org>; Tue,  6 Jun 2006 23:50:31 -0400 (EDT)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 08416-08 for <oracle-l@freelists.org>;
 Tue, 6 Jun 2006 23:50:31 -0400 (EDT)
Received: from bnepms03.mincom.oz.au (mail1.mincom.com [203.13.90.248])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 874E434D73D
 for <oracle-l@freelists.org>; Tue,  6 Jun 2006 23:50:30 -0400 (EDT)
Received: from bnedom05.mincom.oz.au (unverified) by bnepms03.mincom.oz.au 
    (Clearswift SMTPRS 5.2.3) with ESMTP id 
    <T78bb2cc4dacb0d5af81384@bnepms03.mincom.oz.au>; Wed, 7 Jun 2006 
    13:52:28 +1000
Subject: RE: SPOOL Problem
From: Graeme.Farmer@mincom.com
Cc: oracle-l@freelists.org
To: yaoyongping@gmail.com
MIME-Version: 1.0
Message-ID: <OF18014D56.7FA835CF-ON4A257186.001515F0-4A257186.001517CB@mincom.com>
Date: Wed, 7 Jun 2006 13:50:27 +1000
X-MIMETrack: Serialize by Router on 
    BNEDOM05/AU/Mincom(Release 6.5.4FP1|June 19, 2005) at 07/06/2006 
    01:50:28 PM, Serialize complete at 07/06/2006 01:50:28 PM
Content-Type: text/html; charset="ISO-8859-1"
X-archive-position: 35695
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: Graeme.Farmer@mincom.com
Precedence: normal
Reply-to: Graeme.Farmer@mincom.com
X-list: oracle-l
X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at avenirtech.net

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<META Content-Type: multipart/alternative; boundary="----=_Part_5719_24491675.1149650734790"
>

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"
 downloadurl="http://www.5iamas-microsoft-com:office:smarttags"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place" downloadurl="http://www.5iantlavalamp.com/"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
	{font-family:Verdana;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
h2
	{margin-top:12.0pt;
	margin-right:0cm;
	margin-bottom:3.0pt;
	margin-left:-14.4pt;
	text-indent:-21.6pt;
	page-break-after:avoid;
	mso-list:l0 level2 lfo5;
	font-size:14.0pt;
	font-family:Arial;
	font-weight:bold;
	font-style:italic;}
h3
	{margin-top:12.0pt;
	margin-right:0cm;
	margin-bottom:3.0pt;
	margin-left:7.2pt;
	text-indent:-25.2pt;
	page-break-after:avoid;
	mso-list:l0 level3 lfo5;
	border:none;
	padding:0cm;
	font-size:13.0pt;
	font-family:Arial;
	color:#666699;
	font-weight:normal;}
h4
	{margin-top:12.0pt;
	margin-right:0cm;
	margin-bottom:3.0pt;
	margin-left:32.4pt;
	text-indent:-32.4pt;
	page-break-after:avoid;
	mso-list:l0 level4 lfo5;
	border:none;
	padding:0cm;
	font-size:14.0pt;
	font-family:Arial;
	color:#666699;
	font-weight:normal;}
h5
	{margin-top:12.0pt;
	margin-right:0cm;
	margin-bottom:3.0pt;
	margin-left:57.6pt;
	text-indent:-57.6pt;
	page-break-after:avoid;
	mso-list:l0 level5 lfo5;
	font-size:12.0pt;
	font-family:Arial;
	color:#666699;
	font-weight:bold;
	font-style:italic;}
h6
	{margin-top:12.0pt;
	margin-right:0cm;
	margin-bottom:3.0pt;
	margin-left:0cm;
	page-break-after:avoid;
	font-size:10.0pt;
	font-family:"Times New Roman";
	color:#666699;
	font-weight:normal;
	font-style:italic;}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:blue;
	text-decoration:underline;}
p
	{mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	font-size:12.0pt;
	font-family:"Times New Roman";}
span.EmailStyle20
	{mso-style-type:personal-reply;
	font-family:Verdana;
	color:blue;
	font-weight:normal;
	font-style:normal;
	text-decoration:none none;}
@page Section1
	{size:595.3pt 841.9pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
	{page:Section1;}
 /* List Definitions */
 @list l0
	{mso-list-id:1210220442;
	mso-list-template-ids:1478648754;}
@list l0:level1
	{mso-level-tab-stop:-36.0pt;
	mso-level-number-position:left;
	margin-left:-36.0pt;
	text-indent:-18.0pt;}
@list l0:level2
	{mso-level-style-link:"Heading 2";
	mso-level-text:"%1\.%2\.";
	mso-level-tab-stop:-14.4pt;
	mso-level-number-position:left;
	margin-left:-14.4pt;
	text-indent:-21.6pt;}
@list l0:level3
	{mso-level-style-link:"Heading 3";
	mso-level-text:"%1\.%2\.%3\.";
	mso-level-tab-stop:7.2pt;
	mso-level-number-position:left;
	margin-left:7.2pt;
	text-indent:-25.2pt;}
@list l0:level4
	{mso-level-style-link:"Heading 4";
	mso-level-text:"%1\.%2\.%3\.%4\.";
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	margin-left:32.4pt;
	text-indent:-32.4pt;}
@list l0:level5
	{mso-level-style-link:"Heading 5";
	mso-level-text:"%1\.%2\.%3\.%4\.%5\.";
	mso-level-tab-stop:72.0pt;
	mso-level-number-position:left;
	margin-left:57.6pt;
	text-indent:-57.6pt;}
@list l0:level6
	{mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.";
	mso-level-tab-stop:90.0pt;
	mso-level-number-position:left;
	margin-left:82.8pt;
	text-indent:-46.8pt;}
@list l0:level7
	{mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.";
	mso-level-tab-stop:126.0pt;
	mso-level-number-position:left;
	margin-left:108.0pt;
	text-indent:-54.0pt;}
@list l0:level8
	{mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8\.";
	mso-level-tab-stop:144.0pt;
	mso-level-number-position:left;
	margin-left:133.2pt;
	text-indent:-61.2pt;}
@list l0:level9
	{mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8\.%9\.";
	mso-level-tab-stop:180.0pt;
	mso-level-number-position:left;
	margin-left:162.0pt;
	text-indent:-72.0pt;}
ol
	{margin-bottom:0cm;}
ul
	{margin-bottom:0cm;}
-->
</style>

<meta Content-Transfer-Encoding: 7bit Content-Type: text /html; charset=ISO-8859-1
Content-Disposition: inline ------="_Part_5719_24491675.1149650734790">
</head>

<body lang=EN-AU link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span style='font-size:
10.0pt;font-family:Verdana;color:blue'>You would probably be best to write a
PL/SQL procedure to achieve this making use of UTL_FILE to write directly to a
file rather than via the SPOOL mechanism in SQL*Plus.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span style='font-size:
10.0pt;font-family:Verdana;color:blue'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span style='font-size:
10.0pt;font-family:Verdana;color:blue'>Using PL/SQL gives the ability to perform
BULK fetches from the source data too which can significantly improve
performance.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span style='font-size:
10.0pt;font-family:Verdana;color:blue'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span style='font-size:
10.0pt;font-family:Verdana;color:blue'>If you look hard enough, you will
probably find some code on the web that will unload to CSV or SQL*Loader format
text files.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span style='font-size:
10.0pt;font-family:Verdana;color:blue'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span style='font-size:
10.0pt;font-family:Verdana;color:blue'>What is the purpose of writing the
tables to text file? Do you need to archive the data in a portable format?
Loading data to another system? Different platform/rdbms?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span style='font-size:
10.0pt;font-family:Verdana;color:blue'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal style='line-height:12.0pt'><font size=2 color=black
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:black'>Cheers<o:p></o:p></span></font></p>

<p class=MsoNormal style='line-height:12.0pt'><b><font size=2 color=black
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:black;
font-weight:bold'><o:p>&nbsp;</o:p></span></font></b></p>

<p class=MsoNormal style='line-height:12.0pt'><b><font size=2 color=black
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:black;
font-weight:bold'>Graeme Farmer <o:p></o:p></span></font></b></p>

</div>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span style='font-size:
10.0pt;font-family:Verdana;color:blue'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
oracle-l-bounce@freelists.org [mailto:oracle-l-bounce@freelists.org] <b><span
style='font-weight:bold'>On Behalf Of </span></b>&quot;Yongping Yao&quot;
&lt;yaoyongping@gmail.com&gt;<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, 7 June 2006 1:26
PM<br>
<b><span style='font-weight:bold'>To:</span></b> &quot;Graeme.Farmer<br>
<b><span style='font-weight:bold'>Cc:</span></b> oracle-l@freelists.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: SPOOL Problem</span></font><span
lang=EN-US><o:p></o:p></span></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Well, I want to
&quot;unload&quot; a table to text file( or files, as I do now, just to keep
each file small). That would be more than 10 GB. There is some tools to do it,
but they run on Windows( for instance, Golden has a good tool to
&quot;unload&quot;, TOAD has some memory problem too. ). <o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><span class=gmailquote><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>On 6/7/06, <b><span style='font-weight:bold'><a
href="mailto:Graeme.Farmer@mincom.com">Graeme.Farmer@mincom.com</a></span></b>
&lt;<a href="mailto:Graeme.Farmer@mincom.com">Graeme.Farmer@mincom.com </a>&gt;
wrote:</span></font></span><o:p></o:p></p>

<div>

<div link=blue vlink=blue>

<div>

<p><font size=2 color=blue face=Verdana><span style='font-size:10.0pt;
font-family:Verdana;color:blue'>I would expect that it is an SQL*Plus bug as
this is the program that is responsible for accepting the data from the RDBMS
and outputting it to file. (The fact that the realloc system call is unhandled
would indicate to me that the memory allocation routine is not being tested
which is certainly a bug).</span></font><o:p></o:p></p>

<p><font size=2 color=blue face=Verdana><span style='font-size:10.0pt;
font-family:Verdana;color:blue'>&nbsp;</span></font><o:p></o:p></p>

<p><font size=2 color=blue face=Verdana><span style='font-size:10.0pt;
font-family:Verdana;color:blue'>Typically a program would read the incoming
data (from the RDBMS) into a buffer and then writing from that buffer to the
output destination (eg terminal/disk file). </span></font><o:p></o:p></p>

<p><font size=2 color=blue face=Verdana><span style='font-size:10.0pt;
font-family:Verdana;color:blue'>&nbsp;</span></font><o:p></o:p></p>

<p><font size=2 color=blue face=Verdana><span style='font-size:10.0pt;
font-family:Verdana;color:blue'>If memory is continuously being allocated to
increase the size of the buffer but it is not being released then this leads to
a memory leak.</span></font><o:p></o:p></p>

<p><font size=2 color=blue face=Verdana><span style='font-size:10.0pt;
font-family:Verdana;color:blue'>&nbsp;</span></font><o:p></o:p></p>

<p><font size=2 color=blue face=Verdana><span style='font-size:10.0pt;
font-family:Verdana;color:blue'>Of course, there could be another reason for
your problem so best to raise a TAR and have the guys that write the software
give you the definitive answer. To be honest, I've never tried creating a spool
file that large and it may be that the developers of SQL*Plus didn't anticipate
users would have this requirement either!</span></font><o:p></o:p></p>

<p><font size=2 color=blue face=Verdana><span style='font-size:10.0pt;
font-family:Verdana;color:blue'>&nbsp;</span></font><o:p></o:p></p>

<p><font size=2 color=blue face=Verdana><span style='font-size:10.0pt;
font-family:Verdana;color:blue'>What are you actually trying to achieve, there
may be an alternative solution?</span></font><o:p></o:p></p>

<p><font size=2 color=blue face=Verdana><span style='font-size:10.0pt;
font-family:Verdana;color:blue'>&nbsp;</span></font><o:p></o:p></p>

<div>

<p style='line-height:12.0pt'><font size=2 color=black face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:black'>Cheers</span></font><o:p></o:p></p>

<p style='line-height:12.0pt'><b><font size=2 color=black face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:black;font-weight:bold'>&nbsp;</span></font></b><o:p></o:p></p>

<p style='line-height:12.0pt'><b><font size=2 color=black face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:black;font-weight:bold'>Graeme
Farmer </span></font></b><o:p></o:p></p>

</div>

</div>

</div>

</div>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>-- <br>
<st1:City w:st="on"><st1:place w:st="on">Yao</st1:place></st1:City> Yongping<br>
Learning Oracle, UNIX/Linux...<br>
Love <st1:City w:st="on"><st1:place w:st="on">Reading</st1:place></st1:City>,
Classical Music, Philosophy, Economics etc.<br>
Blog:&nbsp;&nbsp;<a href="http://spaces.msn.com/members/yaoyp/">http://spaces.msn.com/members/yaoyp/
</a><o:p></o:p></span></font></p>

</div>


<p><span style="font-family:'MS Sans Serif';font-size:8.2pt;">-- </span></p>
<p><span style="font-family:'MS Sans Serif';font-size:8.2pt;">This transmission is for the intended addressee only and is confidential information. If you have received this transmission in error, please notify the sender and delete the transmission. The contents of this e-mail are the opinion of the writer only and are not endorsed by the Mincom Group of companies unless expressly stated otherwise.</span></p>
<p><span style="font-family:'MS Sans Serif';font-size:8.2pt;">&nbsp;</span></p></body>

</html>

--
http://www.freelists.org/webpage/oracle-l


