----------/************ DISPLAYS ALL CONNECTED SESSIONS
select rpad(c.name||':',11)||rpad(' current logons='||(to_number(b.sessions_current)),20)||'cumulative logons='||rpad(substr(a.value,1,10),10)||'highwater mark='|| b.sessions_highwater Information
from v$sysstat a,v$license b,v$database c
where a.name = 'logons cumulative';
select 'Sessions on database '||substr(name,1,8) from v$database;
--------------/************* DBNAME DATABASE|UNIX/ORACLE SESSIONS
select a.spid pid,b.sid sid,b.serial# ser#,b.machine box,b.username username,b.osuser os_user,b.program program
------substr(a.spid,1,9) pid,substr(b.sid,1,5) sid,substr(b.serial#,1,5) ser#,substr(b.machine,1,6) box,substr(b.username,1,10) username,substr(b.osuser,1,8) os_user,substr(b.program,1,30) program
from v$session b,v$process a
where b.paddr = a.addr and type='USER' AND B.USERNAME='CLEANSER' order by spid;
----select 'To kill, enter SQLPLUS> ALTER SYSTEM KILL SESSION '''||'SID, SER#'||''''||';' from dual;
------------/******** The following script can be used in order quickly identify all lock objects within your Oracle system
select c.owner,c.object_name,c.object_type,b.sid,b.serial#,b.status,b.osuser,b.machine
from v$locked_object a ,v$session b,dba_objects c
where b.sid = a.session_id and a.object_id = c.object_id;
----------------------/*************** RELEASE LOCKS **************/----
select distinct 'ALTER SYSTEM KILL SESSION '||''''||b.sid||','||b.serial#||''''||';'
from v$locked_object a ,v$session b,dba_objects c
where b.sid = a.session_id and a.object_id = c.object_id;
select rpad(c.name||':',11)||rpad(' current logons='||(to_number(b.sessions_current)),20)||'cumulative logons='||rpad(substr(a.value,1,10),10)||'highwater mark='|| b.sessions_highwater Information
from v$sysstat a,v$license b,v$database c
where a.name = 'logons cumulative';
select 'Sessions on database '||substr(name,1,8) from v$database;
--------------/************* DBNAME DATABASE|UNIX/ORACLE SESSIONS
select a.spid pid,b.sid sid,b.serial# ser#,b.machine box,b.username username,b.osuser os_user,b.program program
------substr(a.spid,1,9) pid,substr(b.sid,1,5) sid,substr(b.serial#,1,5) ser#,substr(b.machine,1,6) box,substr(b.username,1,10) username,substr(b.osuser,1,8) os_user,substr(b.program,1,30) program
from v$session b,v$process a
where b.paddr = a.addr and type='USER' AND B.USERNAME='CLEANSER' order by spid;
----select 'To kill, enter SQLPLUS> ALTER SYSTEM KILL SESSION '''||'SID, SER#'||''''||';' from dual;
------------/******** The following script can be used in order quickly identify all lock objects within your Oracle system
select c.owner,c.object_name,c.object_type,b.sid,b.serial#,b.status,b.osuser,b.machine
from v$locked_object a ,v$session b,dba_objects c
where b.sid = a.session_id and a.object_id = c.object_id;
----------------------/*************** RELEASE LOCKS **************/----
select distinct 'ALTER SYSTEM KILL SESSION '||''''||b.sid||','||b.serial#||''''||';'
from v$locked_object a ,v$session b,dba_objects c
where b.sid = a.session_id and a.object_id = c.object_id;
No comments :
Post a Comment