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 ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| 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 |
| |||
| 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/ |
| |||
| 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/ |
| ||||
| 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 |