Archive for October, 2009

Sessions sorted by logon time

set lines 100 pages 999 col ID format a15 col osuser format a15 col login_time format a14 select username , osuser , sid || ',' || serial# "ID" , status , to_char(logon_time, 'hh24:mi dd/mm/yy') login_time , last_call_[...]


Show all connected users

set lines 100 pages 999 col ID format a15 select username , sid || ',' || serial# "ID" , status , last_call_et "Last Activity" from v$session where username is not null order by status desc , las[...]


Purge old files using “find” command

I’ve noticed that one of our interface directories has a lot of old files, some of them were more than a year old. I checked it with our implementers and it turns out that we can delete all files that are older tha[...]


Startup time

select to_char(startup_time, 'HH24:MI DD-MON-YY') "Startup time" from v$instance / [...]


Is java installed in the database?

This will return 9000′ish if it is… select count(*) from all_objects where object_type like '%JAVA%' and owner = 'SYS' / [...]


List open cursors per user

set pages 999 select sess.username , sess.sid , sess.serial# , stat.value cursors from v$sesstat stat , v$statname sn , v$session sess where sess.username is not null and sess.sid = stat.sid and stat.statistic# = sn.sta[...]


Show latent parameter changes

select name , value from v$parameter where ismodified != 'FALSE' / [...]


Reset/Unset a spfile parameter

Setting a parameter to =’ ‘ often isn’t enough. Do this instead… alter system reset <parameter> scope=spfile sid='*' / The sid='*' bit is always necessary, even in non RAC database. [...]


Show non-default parameters

select name , value from v$parameter where ismodified != 'FALSE' / or for name='parameter' style... set pages 999 lines 100 select name || '=' || decode(type, 2, '''') || value || decode(type, 2, '''') param[...]




sponsored link