Amount of free log space
Posted in 1997
Hi family. This must be one off the most frequently asked questions on DSA but, incredibly, I could not find it in the FAQ, nor in the Informix techinfo page. I have a query below to find the total amount of free log space. In other words, logs that are backed up, in use (not new) and have no transactions active in them. i.e. in OnLine 5 these would have been freed up already. The query is interested only in the number of free pages in the total of these free logs. --------------------------------- select sum(size) from syslogs where is_used = 1 and is_backed_up = 1 and uniqid < (select min(tx_logbeg) from systrans where tx_logbeg > 0 ) ; --------------------------------- This worked a coupe of times for me but one time it gave me 1 row with a null value. Why? well, the above has one flaw: If there are no transactions in the system, the subquery returns no rows; hence the sum from the outer query is null. Surely the query I've seen so many times has accounted for this! BTW, I tried a cute kluge: I did a BEGIN WORK; just before running this query. It still showed up null. Any idea why? Do I actually have to *do* something in order for this transaction to truly exist in the system? (Philosophical implications will be fed to the cat. ;-) Thanks. -- -- Jake (In pursuit of undomesticated aquatic avians) +----------------------------------------------------------+ |Aside from that, how did you enjoy the play, Mrs. Lincoln?| +----------------------------------------------------------+