Re: How can you log number of rows returned by all queries?

  • From: Jared Still <jkstill@xxxxxxxxx>
  • To: Chris Dunscombe <cdunscombe@xxxxxxxxx>
  • Date: Tue, 29 Oct 2013 11:11:07 -0700

On Tue, Oct 29, 2013 at 8:32 AM, Chris Dunscombe <cdunscombe@xxxxxxxxx>wrote:
> The reason is to do with audit and alerting based on thresholds of numbers
> of rows returned by queries. (Audit are asking).


that is a flawed (and probably useless) metric, at least IMO.

with subversive as (
  select count(*) salcount
  from hr.salaries s
  join hr.dept d on d.deptno = s.deptno
  where s.salary > 100000
)
select salcount from subversive

1 row returned, lots of information.

Might be worth discussing with the auditors.

That and the near impossibility of auditing on number of rows returned.

Do they really want to an audit on this:

with a as (
   select level c1 from dual connect by level <= 1000000
) ,
b as (
   select level c1 from dual connect by level <= 1000000
)
select a.c1, b.c1
from a, b

I see lots of false positive from cartesian joins in their future.

Probably caused by queries written by auditors.

Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist
Oracle Blog: http://jkstill.blogspot.com
Home Page: http://jaredstill.com


--
//www.freelists.org/webpage/oracle-l


Other related posts: