Vous êtes sur la page 1sur 1

Monitoring users access to the database

There are a number of ways to show what users are executing, this is one of my favourites:
column substr(to_char(PID),1,5) heading Oracle PID
column substr(p.!"#$%&",1,1') heading P O! ser
column !PID heading !hado( PID )ormat %1*
column substr(p.P#O+#%&,1,,*) heading P#O- Program
column substr(to_char(!ID),1,5) heading !ID
column s.!"#$%&",1,.) heading Oracle %/-
column substr(O!!"#,1,1') heading ! O! ser
column substr(to_char(s.P#O-"!!,1,11) heading P PID
column substr(s.P#O+#%&,1,,*) heading !"!! Prog
select substr(to_char(!ID),1,5)
, substr(s.!"#$%&",1,.)
, substr(p.!"#$%&",1,1')
, substr(O!!"#,1,1')
, substr(to_char(s.P#O-"!!),1,11)
, !PID
, substr(s.P#O+#%&,1,,*)
)rom 01process p, 01session s
(here p.addr2s.paddr
order b3 !ID4
The sort of results generated by this are:
!ID Oracle P O! ser ! O! ser P PID !hado( PID !"!! Prog
1' 567 oracle 8eith .9.. '':1; <%=>?mars (@$! 1AB')
1, CO$ Don Don ;5;* ;5.* </opt/bin/testprog>
Here we see that on the host mars, unix user 8eith was executing the program %=. On the host where
this script was run, unix user oracle was connecting to the database as oracle user 567 and executing
the job.
We also see a local to the host! job, being executed by unix user Don. " li#e this script because it gives
you information about remote databases accesses. "f you want more information, a simple ps Ae) E
grep ... will reveal more details.

Vous aimerez peut-être aussi