1_Configure_Environment.sql
set pagesize 1000
set linesize 1000
column column_name format a20
column index_name format a30
column SEGMENT_NAME format a30
column tablespace_name format a25
column t.owner format a10
column instance_name format a15
column host_name format a15
column startup format a21
column hoje format a21
column sid format 99999
column serial# format 99999
column so_proc format a10
column username format a20
column program format a40
column osuser format a20
column machine format a25
column module format a40
column minutos format 999999.99
column object_name format a30
define Prompt = ''
column MyPrompt new_value Prompt
select host_name || '_' || instance_name MyPrompt from v$instance;
set sqlprompt '&&Prompt>'
select sid, serial#, username, machine from v$session order by 3,4;
select host_name, instance_name, version,
to_char(startup_time, 'DD-MON-RRRR HH24:MI:SS') STARTUP,
to_char(sysdate, 'DD-MON-RRRR HH24:MI:SS') HOJE
from v$instance;
select count(username) as QTDE, 'TOTAL' as CONEXOES
from v$session where username is not null
UNION
select count(username), 'ATIVOS'
from v$session where username is not null and status = 'ACTIVE'
UNION
select count(username), 'INATIVOS'
from v$session where username is not null and status = 'INACTIVE'
UNION
select count(username), 'PERDIDOS'
from v$session where username is not null and status = 'SNIPED'
order by 1, 2;
select username, status, count(username) TOTAL
from v$session
where username is not null
group by username, status
order by 1, 2;
Nenhum comentário:
Postar um comentário