Re: onmode and system shutdown
Posted in 1997
Topics: Server Administration
Mark Spears wrote:
>
> We have a weekly shutdown procedure that requires us to reboot one of
> our production machines that runs informix. Recently we had a slight
> problem; there was an index rebuild occuring when the automated reboot
> script kicked in. The system shut down, and on reboot Online went into
> recovery mode for about four hours.
>
> My question: is there a straightforward way to determine what the
> Online 7.12 engine is doing? Some option to onstat, for example, that
> would allow a script to intelligently opt for or against shutting down
> the informix system?
>
> My next question: After giving an onmode -ky command, is there any way
> to "undo" that and tell the engine that we dont want it to go offline
> after all? (We found that it is possible for the engine to go into
> quiescent mode for quite a while before actually going offline... )
>
> Thanks,
> Jeff Anderson
> Service Merchandise
> (thanks Mark for letting me use this account)
Mark,
Could you insert a section into your shutdown script that would:
1. Issue a onmode -s command
2. Recursively issue a onstat command until...
------------------------------------
Okay, it gets a little sticky here. Were currently using 5.0, so you
would have to verify how this would work in 7.x. In 5.0 it goes
something like this...
tbstat | head -2 | tail -1 | cut (XX)
(We use the cut command to get the current status (Online/Offline) of
the database. Where xx is the column that contains the mode.)
By assigning the output from the above command to a variable we can have
the script wait here in a loop until the database is gracefully offline.
Then continue...
----------------------------------
3. Issue your onmode -ky.
Okay so it's not a very elegant solution but we have used it on a
limited basis with some of our maintenance scripts and it works
surprisingly well.
Doug