I have Oracle 9.2.0.6 database on Hp-Unix. Users connect to the database using Application Server/Web Server.

I have noticed some of the queries run for long long time.. Ex.
Duration=36411 sec
Duration=36091 sec
Duration=33628 sec

before error out with ORA-01555 caused by SQL statement below. I have the SQLs causing this displayed in Alert Log.

My question is, Is there a way I can set sometime limit for such queries so if the SQL don't finish in lets say 10 mints or so it times out or any of my code can end/kill these SQLs?

Thanks