Fantastic Unix Forums  

Go Back   Fantastic Unix Forums > Fantastic Unix Forums > Shell Programming > Unix Shell Programming

Unix Shell Programming Post here for discussing in comp.unix.shell newsgroup.

Sort command with very large files

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-27-2008
attraxion
Guest
 
Posts: n/a
Default Sort command with very large files

Hi All,

Disclaimer: I'm a newbie.

I am extracting records from many tables of a database into flat files,
and then running a sort command on all the extracted files. The files
are quite big, totalling upto 7 GB for 5 files. My ommand goes like
this -

sort -o final.tmp -k 2,2n -k 3,3 -k 1,1n table1.tmp table2.tmp
table3.tmp table4.tmp table5.tmp

and the output I get is this -

msgcnt 2 vxfs: mesg 001: vx_nospace - /dev/vg02/lvol5 file system full
(1 block extent)
sort: A write error occurred while sorting.

Can anyone please tell me why this problem is occuring? My infra team
assures me that they have 20 GB space in their file system, so 7 GB (or
even double the amount after sorted file is created) would not be
problem. Is it that the sort command has a file size limit? Is it, what
are the workarounds? I don't have bsort in my UNIX. Thanks a lot in
anticipation.

Best,
Attraxion.

Reply With Quote
  #2 (permalink)  
Old 06-27-2008
Stephane CHAZELAS
Guest
 
Posts: n/a
Default Re: Sort command with very large files

2006-12-12, 01:54(-08), attraxion:
> Hi All,
>
> Disclaimer: I'm a newbie.
>
> I am extracting records from many tables of a database into flat files,
> and then running a sort command on all the extracted files. The files
> are quite big, totalling upto 7 GB for 5 files. My ommand goes like
> this -
>
> sort -o final.tmp -k 2,2n -k 3,3 -k 1,1n table1.tmp table2.tmp
> table3.tmp table4.tmp table5.tmp
>
> and the output I get is this -
>
> msgcnt 2 vxfs: mesg 001: vx_nospace - /dev/vg02/lvol5 file system full
> (1 block extent)
> sort: A write error occurred while sorting.
>
> Can anyone please tell me why this problem is occuring? My infra team
> assures me that they have 20 GB space in their file system, so 7 GB (or
> even double the amount after sorted file is created) would not be
> problem. Is it that the sort command has a file size limit? Is it, what
> are the workarounds? I don't have bsort in my UNIX. Thanks a lot in
> anticipation.

[...]

sort uses temp files in /tmp or /var/tmp.

You may try to set the TMPDIR variable to a directory on a
filesystem where there is enough room.

Some sort implementations also have a -T option for that.

--
Stéphane
Reply With Quote
  #3 (permalink)  
Old 06-27-2008
Stephane CHAZELAS
Guest
 
Posts: n/a
Default Re: Sort command with very large files

2006-12-12, 01:54(-08), attraxion:
> Hi All,
>
> Disclaimer: I'm a newbie.
>
> I am extracting records from many tables of a database into flat files,
> and then running a sort command on all the extracted files. The files
> are quite big, totalling upto 7 GB for 5 files. My ommand goes like
> this -
>
> sort -o final.tmp -k 2,2n -k 3,3 -k 1,1n table1.tmp table2.tmp
> table3.tmp table4.tmp table5.tmp
>
> and the output I get is this -
>
> msgcnt 2 vxfs: mesg 001: vx_nospace - /dev/vg02/lvol5 file system full
> (1 block extent)
> sort: A write error occurred while sorting.
>
> Can anyone please tell me why this problem is occuring? My infra team
> assures me that they have 20 GB space in their file system, so 7 GB (or
> even double the amount after sorted file is created) would not be
> problem. Is it that the sort command has a file size limit? Is it, what
> are the workarounds? I don't have bsort in my UNIX. Thanks a lot in
> anticipation.

[...]

sort uses temp files in /tmp or /var/tmp.

You may try to set the TMPDIR variable to a directory on a
filesystem where there is enough room.

Some sort implementations also have a -T option for that.

--
Stéphane
Reply With Quote
  #4 (permalink)  
Old 06-27-2008
Stephane CHAZELAS
Guest
 
Posts: n/a
Default Re: Sort command with very large files

2006-12-12, 01:54(-08), attraxion:
> Hi All,
>
> Disclaimer: I'm a newbie.
>
> I am extracting records from many tables of a database into flat files,
> and then running a sort command on all the extracted files. The files
> are quite big, totalling upto 7 GB for 5 files. My ommand goes like
> this -
>
> sort -o final.tmp -k 2,2n -k 3,3 -k 1,1n table1.tmp table2.tmp
> table3.tmp table4.tmp table5.tmp
>
> and the output I get is this -
>
> msgcnt 2 vxfs: mesg 001: vx_nospace - /dev/vg02/lvol5 file system full
> (1 block extent)
> sort: A write error occurred while sorting.
>
> Can anyone please tell me why this problem is occuring? My infra team
> assures me that they have 20 GB space in their file system, so 7 GB (or
> even double the amount after sorted file is created) would not be
> problem. Is it that the sort command has a file size limit? Is it, what
> are the workarounds? I don't have bsort in my UNIX. Thanks a lot in
> anticipation.

[...]

sort uses temp files in /tmp or /var/tmp.

You may try to set the TMPDIR variable to a directory on a
filesystem where there is enough room.

Some sort implementations also have a -T option for that.

--
Stéphane
Reply With Quote
  #5 (permalink)  
Old 06-27-2008
Stephane CHAZELAS
Guest
 
Posts: n/a
Default Re: Sort command with very large files

2006-12-12, 01:54(-08), attraxion:
> Hi All,
>
> Disclaimer: I'm a newbie.
>
> I am extracting records from many tables of a database into flat files,
> and then running a sort command on all the extracted files. The files
> are quite big, totalling upto 7 GB for 5 files. My ommand goes like
> this -
>
> sort -o final.tmp -k 2,2n -k 3,3 -k 1,1n table1.tmp table2.tmp
> table3.tmp table4.tmp table5.tmp
>
> and the output I get is this -
>
> msgcnt 2 vxfs: mesg 001: vx_nospace - /dev/vg02/lvol5 file system full
> (1 block extent)
> sort: A write error occurred while sorting.
>
> Can anyone please tell me why this problem is occuring? My infra team
> assures me that they have 20 GB space in their file system, so 7 GB (or
> even double the amount after sorted file is created) would not be
> problem. Is it that the sort command has a file size limit? Is it, what
> are the workarounds? I don't have bsort in my UNIX. Thanks a lot in
> anticipation.

[...]

sort uses temp files in /tmp or /var/tmp.

You may try to set the TMPDIR variable to a directory on a
filesystem where there is enough room.

Some sort implementations also have a -T option for that.

--
Stéphane
Reply With Quote
  #6 (permalink)  
Old 06-27-2008
Stephane CHAZELAS
Guest
 
Posts: n/a
Default Re: Sort command with very large files

2006-12-12, 01:54(-08), attraxion:
> Hi All,
>
> Disclaimer: I'm a newbie.
>
> I am extracting records from many tables of a database into flat files,
> and then running a sort command on all the extracted files. The files
> are quite big, totalling upto 7 GB for 5 files. My ommand goes like
> this -
>
> sort -o final.tmp -k 2,2n -k 3,3 -k 1,1n table1.tmp table2.tmp
> table3.tmp table4.tmp table5.tmp
>
> and the output I get is this -
>
> msgcnt 2 vxfs: mesg 001: vx_nospace - /dev/vg02/lvol5 file system full
> (1 block extent)
> sort: A write error occurred while sorting.
>
> Can anyone please tell me why this problem is occuring? My infra team
> assures me that they have 20 GB space in their file system, so 7 GB (or
> even double the amount after sorted file is created) would not be
> problem. Is it that the sort command has a file size limit? Is it, what
> are the workarounds? I don't have bsort in my UNIX. Thanks a lot in
> anticipation.

[...]

sort uses temp files in /tmp or /var/tmp.

You may try to set the TMPDIR variable to a directory on a
filesystem where there is enough room.

Some sort implementations also have a -T option for that.

--
Stéphane
Reply With Quote
  #7 (permalink)  
Old 06-27-2008
Warren Block
Guest
 
Posts: n/a
Default Re: Sort command with very large files

attraxion <attraxion@gmail.com> wrote:
> Hi All,
>
> Disclaimer: I'm a newbie.
>
> I am extracting records from many tables of a database into flat files,
> and then running a sort command on all the extracted files.


Is it possible to avoid the problem by havin the extraction process
produce sorted files in the first place (i.e., SQL "order by")?

--
Warren Block * Rapid City, South Dakota * USA
Reply With Quote
  #8 (permalink)  
Old 06-27-2008
Warren Block
Guest
 
Posts: n/a
Default Re: Sort command with very large files

attraxion <attraxion@gmail.com> wrote:
> Hi All,
>
> Disclaimer: I'm a newbie.
>
> I am extracting records from many tables of a database into flat files,
> and then running a sort command on all the extracted files.


Is it possible to avoid the problem by havin the extraction process
produce sorted files in the first place (i.e., SQL "order by")?

--
Warren Block * Rapid City, South Dakota * USA
Reply With Quote
  #9 (permalink)  
Old 06-27-2008
Warren Block
Guest
 
Posts: n/a
Default Re: Sort command with very large files

attraxion <attraxion@gmail.com> wrote:
> Hi All,
>
> Disclaimer: I'm a newbie.
>
> I am extracting records from many tables of a database into flat files,
> and then running a sort command on all the extracted files.


Is it possible to avoid the problem by havin the extraction process
produce sorted files in the first place (i.e., SQL "order by")?

--
Warren Block * Rapid City, South Dakota * USA
Reply With Quote
  #10 (permalink)  
Old 06-27-2008
Warren Block
Guest
 
Posts: n/a
Default Re: Sort command with very large files

attraxion <attraxion@gmail.com> wrote:
> Hi All,
>
> Disclaimer: I'm a newbie.
>
> I am extracting records from many tables of a database into flat files,
> and then running a sort command on all the extracted files.


Is it possible to avoid the problem by havin the extraction process
produce sorted files in the first place (i.e., SQL "order by")?

--
Warren Block * Rapid City, South Dakota * USA
Reply With Quote
Reply

Tags
command, files, large, sort


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Sort command with very large files attraxion Unix Shell Programming 0 06-27-2008 08:26 PM
wtf. sort command seems broken? Bonsai Bonanza The Linux Operating System 6 11-05-2007 11:00 PM


All times are GMT +1. The time now is 07:28 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0