Re: Q: Trigger when users connect or disconnect ??
Date: 1996/05/01
Message-ID: <4m8pqn$dcu_at_bagan.srce.hr>#1/1
Dale (dale_at_fox.nstn.ca) wrote:
: In article <michel.lalonde.72.000F1404_at_sit.ulaval.ca>,
: michel.lalonde_at_sit.ulaval.ca says...
: >
: >In article <4l9c9l$7oq_at_news.nstn.ca> dale_at_fox.nstn.ca (Dale) writes:
: >>From: dale_at_fox.nstn.ca (Dale)
: >>Subject: Q: Trigger when users connect or disconnect ??
: >>Date: 20 Apr 1996 00:48:53 GMT
: >>I want to be able to tell when a user connects or
: >>disconnects so that I may go in an clean-up any results sets
: >>that were saved in our "temporary" table (used to hold
: >>intermediate result sets of queries).
: >>I believe that I cannot put triggers on the system tables
: >>(v$session, etc). Is anyone doing something similar to this?
: >>and how?
: >>Thanks in Advance
: >>Babette Dale Underwood (dale_at_fox.nstn.ca)
: >
: >What we do is :
: >
: >- time stamp each row in your "temporary table"
: >- run a cron job to clean up old timestamped rows
: >
: >works fine.
: >
: >Michel lalonde
: Sorry, I forgot to mention it is an NT environment and the user cannot be
: currently connected.
: Babette
Cleaning temporary tables with cron is good solution in your case ( if you are on UNIX ). But cron can be invoked in intervals of at least 1 minute. And it must start a program like this one :
- connect to the database
- clean temporary tables
- disconnect from the database
It must be invoked very often by cron. And creating a new process, connecting to and disconnecting from a database is not a trivial task for a computer. It could result in a poor performance of a system. And what to do in a case when user disconnects and reconnects immediately. How can you be sure that program for clearing temporary tables was invoked in this short period of time ?
My opinion is that it is absolutely necessary to avoid use of temporary tables in aplications. It is possible in any application I believe. I am currently developing an application with about 300 entities . Me and my team have never used any temporary table. If you have to store intermediate results of queries than use views ! They are nothing else but "stored queries". Another thing that could not be easily forgotten is that high activity on temporary tables could lead in faster database fragmentation and decreasing performance.
Sorry about that.
Mario Simic B.Sc.E.E.
marios_at_open.hr
ORACLE DBA and application programmer
IN2 d.o.o. ( Ltd )
Zagreb, Croatia
Received on Wed May 01 1996 - 00:00:00 CEST