Re: Turning off transaction logging from command line?
Posted in 1992
> Every weekend, we're loading a LOT of data from text files into > Informix. Because the amount of data is so large, the transaction log > would overflow the disk where the transaction log file is kept. > > So, before the data is loaded, Informix is manually brought down, > transaction logging is disabled, then the data is loaded into > Informix. > > I would like to know if there is a better way of doing this. > Ideally, I would like to do the following from a shell script: > 1. disable transaction logging > 2. load all text files into Informix > 3. enable transaction logging -------------------------------------------------------- Fredrik, first of ALL, what version of Informix are you running??? Assuming you're running OnLine 4.* or 5.*, I believe the following works [taken from the 5.0 System Admin Manual, but most is applicable to 4.*. This manual, by the way, is worth its weight in gold - and that's pretty much what they charge]. tbtape -N {dbname} to turn off logging echo "0" | tbtape -s -B {dbname} to turn on BUFFERED logging [NOTE that the manual is a bit fuzzy here - BOTH options must be done on the command line. From reading the manual, I thought you might be able to do them separately.] Use U for unbuffered logging. Note, however, that this last command creates a level 0 archive. If you don't want an archive, you can have your tape device set to /dev/null. [Set you tape size value to something very large, so that you're not prompted to change tapes]. Also note, that if you're just loading, and not doing any reading, it's faster to drop any indices on the table, and then re-create them. This is especially true if you have 5.0, or the very latest 4.1 with the new fast indexing strategies. [Again, if you're doing this a LOT it might be especially helpful to upgrade]. Hope that helps, Ihor Kinal att!cbnewsh!ijk P.S. Speaking of fast-indexing, what I would really like to see is this: I usually have several indices on my large files. Since the number of records exceeds my buffer cache, I believe that this means that Informix rescans the table, once for each index. I would like a means of telling Informix to realize it will create several indices, and that it needs to read each record only once [the info would then be stored in several temp files, one for each index]. If I WERE WRITING THE INDEXING CODE, that's how I would have done it in the first place. Should be much faster.