Hay que aplicar el monitoreo, casos básicos:
/*
select * from v$resource_limit where resource_name = 'processes' or resource_name = 'sessions'
SELECT * FROM V$SQL
SELECT * FROM V$OPEN_CURSOR
SELECT /*+ choose */
s.status "Status", s.serial# "Serial#", s.TYPE "Type",
s.username "DB User", s.osuser "Client User", s.server "Server",
s.machine "Machine", s.module "Module", s.terminal "Terminal",
s.program "Program", p.program "O.S. Program",
s.logon_time "Connect Time", lockwait "Lock Wait",
si.physical_reads "Physical Reads", si.block_gets "Block Gets",
si.consistent_gets "Consistent Gets",
si.block_changes "Block Changes",
si.consistent_changes "Consistent Changes", s.process "Process",
p.spid, p.pid, si.sid, s.sql_address "Address",
s.sql_hash_value "Sql Hash", s.action
FROM v$session s, v$process p, sys.v_$sess_io si
WHERE s.paddr = p.addr(+)
AND si.sid(+) = s.sid
AND (s.username IS NOT NULL)
AND (NVL (s.osuser, 'x') <> 'SYSTEM')
AND (s.TYPE <> 'BACKGROUND')
ORDER BY 4 DESC
select username, action_name, priv_used, returncode from dba_audit_trail
select name, value from v$parameter
where name like 'audit_trail'
select * from dba_audit_trail WHERE TO_CHAR(TIMESTAMP, 'DD/MM/YYYY') = '08/02/2010'
select count(*), userhost,TIMESTAMP, os_username from dba_audit_trail group by TIMESTAMP, userhost, os_username order by TIMESTAMP, userhost, os_username
*/
"Escribo conforme voy viviendo. El trabajo emana de mí en un flujo no diferenciado y continuo." Alfonso Reyes (1889-1959) Escritor y poeta mexicano.
jueves, 15 de marzo de 2012
tunning & monitoreo
Para el tunning & monitoreo
/*
select to_char(sysdate,'DD-MM-YYYY'), name,fa.tablespace_name,
to_char(df.size_GB,'99990D99') size_GB,
to_char(fa.free_auto_GB+f.free_GB ,'99990D99') free_total,
to_char((fa.free_auto_GB+f.free_GB)/df.size_GB*100,'990D99') percentage_free
from
v$database,
(select f.tablespace_name,sum(decode(autoextensible,'YES',(maxbytes-f.bytes)/1024/1024/1024,0)) free_auto_GB from dba_data_files f
where f.tablespace_name not like ('%UNDO%')
group by f.tablespace_name) fa,
(select s.tablespace_name,sum(s.bytes/1024/1024/1024) free_GB from dba_free_space s
where s.tablespace_name not like ('%UNDO%')
group by s.tablespace_name) f,
(select df.tablespace_name,sum(decode(autoextensible,'YES',maxbytes,bytes))/1024/1024/1024 size_GB from dba_data_files df
where df.tablespace_name not like ('%UNDO%')
group by df.tablespace_name) df
where fa.tablespace_name=f.tablespace_name
and df.tablespace_name = f.tablespace_name
SELECT TO_CHAR (SYSDATE, 'yyyy/mm/dd hh24:mi:ss ') || SYS_CONTEXT ('USERENV', 'TERMINAL') stid FROM DUAL;
select sid,
opname,
target,
sofar,
totalwork,
units,
(totalwork-sofar)/time_remaining bps,
time_remaining,
sofar/totalwork*100 fertig
SELECT *
from v$session_longops
where time_remaining > 0
*/
Suscribirse a:
Entradas (Atom)