[Info-ingres] Checking logging status of a session

Roy Hann specially at processed.almost.meat
Fri Aug 28 11:09:14 UTC 2020


Steve wrote:

> Sorry, transaction logging.
>
> I was editing a shell script process where someone had commented out ALL 
> the error handling! Some of the commented out error handling code
> indicated the database would be marked inconsistent if the transaction
> failed with nologging enabled. 

That is exactly what would happen and it is unrecoverable. So if you are
going to turn logging off you may as well comment out the error handling
because you are screwed. There is no handling to be done. The only
option is to roll forward from the last good checkpoint up to the moment
logging was turned off.

> Hence I wondered if there was a way to
> check if logging was enabled/disabled from within a shell script.
>
> Could one turn off logging using ING_SET?

If one were absolutely insane, yes. Set ING_SET and restart Ingres. I
can think of no defensible reason ever to do that. 

So to answer your question a little differently, you don't need to check
if logging is turned off because it is such a grossly abnormal situation
you just shouldn't be routinely running Ingres that way. I'll repeat my
earlier comment: if you only suspect logging is turned off (i.e. you
didn't turn it off yourself having first taken the necessary
precautions so you know *for sure* it is off) shut Ingres down and
restart it. You should also do an off-line checkpoint to reinitialize
journaling before you start using the database(s) again.

Roy






More information about the Info-ingres mailing list