Ingres automatic shutdown

> psau@yorku.ca (Pak Sau) writes:
>
> We are using Ingres 6.4/0.4 on sco.us5/00 and we will like to force people out 
> of the database (if they FORGET to logoff) before running our nightly jobs.  
> Currently, our Production Control personnel uses IPM to kill the active 
> session out of the system but sometime they forget too.  Is there an way that 
> I can force the database (or user) to come down?  I know in Oracle they can 
> issue something like SHUTDOWN FORCE to kill all sessions and bring down the 
> db, is there such optional parameter on Ingres?  Do we need to write some kind
> of script to kill the active session before issuing iishutdown?  Has anyone 
> written such a script?  Can we get a sample?  Your help will be greatly 
> appreciated.  Thanks.
> 
> 
> 
> Pak Sau
> York University
> Toronto, Canada
> psau@yorku.ca

You need to write a script.  Most people parse the session numbers out
of the iimonitor output and then use iimonitor to remove sessions.

Here are things to worry about:

 1) Ingres 6.4/04 has some bugs on some platforms that make using
    the REMOVE command in iimonitor very dangerous to data integrity.
    You may want to check with CA.

 2) After you kill all the sessions, Ingres may still not be "quiet",
    as the recovery process may spend a considerable amount of time
    backing out failed transactions from the killed sessions.

 3) If you shut down Ingres at this point, it may say it is shut down,
    but it might not actually be completely shut down.  Check that
    the recovery process is completely gone before assuming Ingres is
    down. 

Cheers,

Michael Leo            mleo@cariboulake.com        mal@visi.com
Caribou Lake Software  http://www.cariboulake.com  Java/RDBMS Solutions


 
You should not need to force out active users before running iishutdown. 
The iishutdown script (yes, it is a script and you should read it to get 
a better feel for what is involved) should issue the appropriate OS 
level "kill" command to abort a server if it refuses to come down 
gracefully. By the way you can recycle the different components of the 
Ingres architecture (GCN, GCC, DBMS, ACP) individually using different 
Ingres utilities like iinamu, netu and iimonitor or operating system 
"kil. You cannot do this with Oracle. For example, if you wish to 
recycle just the DBMS server and force everybody out of the database use 
the iimonitor utility and issue the "stop server" command. The RCP 
process will then take over and recover all the aborted transactions. 
Bye the way the iishutdown script typically issues the "set server shut" 
command which prevents new connections but only takes the server down 
when all currently active connections exit voluntarily. That is why an 
OS kill command is usually needed. You might want to consider modifying 
the iishutdown command and change "set server shut" to "stop server" if 
you consider this more appropriate.

Ignatius.

P.S. My opinion only. Computer Associates should always be consulted for 
the final word on any Ingres matter.



From: "Jones, Gerard" (GJones@aylesburyvaledc.gov.uk)

Hi William,

I would just like to add the following to this thread (Ingres automatic
shutdown):

If there are live sessions on the system connected via Ingres net then
iishutdown just waits for them to close.
You could try running a script to check if there are any sessions on the
server accessing the database, if none it could then run iimonitor,
something like this in a Unix shell script: -
iimonitor `grep II_DBMS_SERVER $II_SYSTEM/ingres/files/errlog.log|tail -1|cut -115-118` << END >>  output file

show sessions

quit

END

You could then interrogate that file and if there are any user sessions netu
can be used , within the script, to stop Ingres net: -
netu << EOF >> output file
S
E
EOF



Gerard E. Jones   -  AVDC I.T. Division  01296 585302
                              Mobile Phone 0798 0039833
Ingres Q & A
To William's Home Page

© William Yuan 2000

Email William