Unix Technical Forum

Unload to tape

This is a discussion on Unload to tape within the Informix forums, part of the Database Server Software category; --> Good day. Environment: IDS 9.3, HP-UX 11. There is a table. If unloaded using SQL command, it takes more ...


Go Back   Unix Technical Forum > Database Server Software > Informix

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 08:34 PM
Andris
 
Posts: n/a
Default Unload to tape

Good day.

Environment: IDS 9.3, HP-UX 11.

There is a table. If unloaded using SQL command, it takes more than
2GB space, and unload breaks.

One of options would be to unload table to tape. I know that I can use
dbexport command and put tape as a output device. But is it possbile
to unload to tape using SQL UNLOAD command? If yes, how?

Thanks!

Andris
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 08:34 PM
Art S. Kagel
 
Posts: n/a
Default Re: Unload to tape

On Fri, 27 Feb 2004 07:19:39 -0500, Andris wrote:

Yes, add the '-t <tapedevice>' option.

Art S. Kagel


> Good day.
>
> Environment: IDS 9.3, HP-UX 11.
>
> There is a table. If unloaded using SQL command, it takes more than 2GB
> space, and unload breaks.
>
> One of options would be to unload table to tape. I know that I can use
> dbexport command and put tape as a output device. But is it possbile to
> unload to tape using SQL UNLOAD command? If yes, how?
>
> Thanks!
>
> Andris

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 08:35 PM
Jonathan Leffler
 
Posts: n/a
Default Re: Unload to tape

Art S. Kagel wrote:

> On Fri, 27 Feb 2004 07:19:39 -0500, Andris wrote:
>
> Yes, add the '-t <tapedevice>' option.


Did you read the question carefully enough, Art?

Unless we're talking about very different critters, there is no '-t
<tapedevice>' option to the SQL UNLOAD command.

>>Environment: IDS 9.3, HP-UX 11.
>>
>>There is a table. If unloaded using SQL command, it takes more than 2GB
>>space, and unload breaks.
>>
>>One of options would be to unload table to tape. I know that I can use
>>dbexport command and put tape as a output device. But is it possbile to
>>unload to tape using SQL UNLOAD command? If yes, how?


UNLOAD TO "/dev/rmt0" SELECT ...;

Assuming that /dev/rmt0 is your tape device.

--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-19-2008, 08:35 PM
Jonathan Leffler
 
Posts: n/a
Default Re: Unload to tape

Jonathan Leffler wrote:

> Art S. Kagel wrote:
>> On Fri, 27 Feb 2004 07:19:39 -0500, Andris wrote:
>>> Environment: IDS 9.3, HP-UX 11.
>>>
>>> There is a table. If unloaded using SQL command, it takes more than 2GB
>>> space, and unload breaks.
>>>
>>> One of options would be to unload table to tape. I know that I can use
>>> dbexport command and put tape as a output device. But is it possbile to
>>> unload to tape using SQL UNLOAD command? If yes, how?

>
>
> UNLOAD TO "/dev/rmt0" SELECT ...;
>
> Assuming that /dev/rmt0 is your tape device.


Ugh - incomplete answer.

That assumes that you don't need to worry about tape blocking factors
and other such nasties. If you do need to worry about them, then you
need to work a bit harder. If you've got a reasonably modern version
of Unix, chances are it has /dev/stdout or /dev/fd/1, and you can
write to either of those instead of /dev/rmt0. From there, you can
output the overall output of the UNLOAD command to the Unix dd command
- with an output block size as appropriate (obs=256k, or whatever).

SQLCMD (see http://www.iiug.org/software) fares marginally better -
but only marginally so! It has a command UNLOAD TO PIPE "dd obs=256k
of=/dev/rmt0" SELECT ...

However, there is a good reason why this is not really publicized.
SQLCMD does not handle SIGPIPE during such output properly (and
SIGPIPE will happen if the command exits before the output ends;
consider UNLOAD TO PIPE "sed 1q" SELECT * FROM Systables).
Retrofitting better signal handling into SQLCMD is mostly fiddly and
just a bit more awkward than I'd like.

--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-19-2008, 08:36 PM
Art S. Kagel
 
Posts: n/a
Default Re: Unload to tape

On Mon, 01 Mar 2004 00:38:02 -0500, Jonathan Leffler wrote:

> Art S. Kagel wrote:
>
>> On Fri, 27 Feb 2004 07:19:39 -0500, Andris wrote:
>>
>> Yes, add the '-t <tapedevice>' option.

>
> Did you read the question carefully enough, Art?


Obviously not.

Art S. Kagel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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

vB 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


All times are GMT. The time now is 10:31 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com