Using ingstop -force once a week

Using ingstop -force once a week

Post by Carm » Wed, 12 Sep 2001 05:02:52



We have some cron jobs executing application shutdown, ingstop,
ingstart, optimizedb and sysmod once a week.  However, the ingstop
doesn't work due to orphaned process keeping a database session open
after the application is shutdown.  It pretty much defeats the purpose
to have cron perform these automated weekly maintenance processes if
these orphaned sessions cause the processes to abort.  We thought of
executing an "ingstop -force" instead of just an ingstop but are
concerned that ingstop -force may cause additional problems.  How safe
is it to use this command once a week and what impacts will we see?
 
 
 

Using ingstop -force once a week

Post by Gerhard Hofma » Wed, 12 Sep 2001 16:20:42


If you have Ingres II, you can use imadb's procedure ima_remove_ression to
delete all sessions before ingstopping.

I made an Ingres report for automating this:

---begin---

.name removesessions
.output removesessions.sql
.query
  select server, session_id from
  ima_server_sessions
  where db_name = 'fepa404'
.header report
 .noff
 .nl

 .print "set autocommit on \\g" .nl
 .print "\\sql" .nl
.detail
 .print "execute procedure" .nl
 .print "ima_remove_session(server_id = '" .print server .print "'," .nl
 .print "session_id = '" .print session_id .print "')" .nl
 .print "\\p\\g" .nl

---end---

Load it into imadb with "sreport". Then run it against imadb with "report".
This will generate a script removesessions.sql. Run removesessions.sql
against imadb -> all sessions will be removed.

Note that you must change the line

   where db_name ...

in the report so that it fits the name of your database(s).

HTH
Gerhard Hofmann

> -----Original Message-----


> Sent: Monday, September 10, 2001 10:03 PM

> Subject: Using ingstop -force once a week

> We have some cron jobs executing application shutdown, ingstop,
> ingstart, optimizedb and sysmod once a week.  However, the ingstop
> doesn't work due to orphaned process keeping a database session open
> after the application is shutdown.  It pretty much defeats the purpose
> to have cron perform these automated weekly maintenance processes if
> these orphaned sessions cause the processes to abort.  We thought of
> executing an "ingstop -force" instead of just an ingstop but are
> concerned that ingstop -force may cause additional problems.  How safe
> is it to use this command once a week and what impacts will we see?