Академический Документы
Профессиональный Документы
Культура Документы
NORMAL TABLESPACES
select
(BYTES/1024)/1024 "Used Space(MB)",
total "allocated size(MB)",
maxi "maximum allowable (MB)",
maxi-(BYTES/1024)/1024 "effectivefree(MB)",
--maxi-total "free(MB)",
round(((maxi-(BYTES/1024)/1024)/maxi)*100,2) "% FREE"
from
SM$TS_USED,(select sum((BYTES/1024)/1024)
total,sum((decode(MAXBYTES,0,bytes,maxbytes)/1024)/1024) maxi from
dba_data_files where tablespace_name in ('&&tbs')) where
tablespace_name in ('&tbs');
cd /ptsadmin/common/OHSMON
alter tablespace &tablespace_name add datafile '&filefullpath' size 200M autoextend on next 20M
maxsize 1800M;
UNDO TABLESPACE
select tablespace_name,
status,
count(extent_id) "Extent Count",
sum(blocks) "Total Blocks",
sum(blocks)*8/(1024*1024) total_space
from dba_undo_extents
group by tablespace_name, status;
select
UNDOBLKS,BEGIN_TIME,MAXQUERYLEN,UNXPSTEALCNT,EXPSTEALCNT,NOSPACEER
RCNT from stats$undostat where BEGIN_TIME between sysdate-90 and sysdate and
UNXPSTEALCNT > 0;
select
sum(ssolderrcnt) "Total ORA-1555s",
round(max(maxquerylen)/60/60) "Max Query HRS",
sum(unxpstealcnt) "UNExpired STEALS",
sum(expstealcnt) "Expired STEALS"
from v$undostat
order by begin_time
set head on
select usn,extents,round(rssize/1048576)
rssize,hwmsize,xacts,waits,optsize/1048576 optsize,shrinks,wraps
from v$rollstat where xacts>0
order by rssize;
select tablespace_name,file_name,file_id,autoextensible,bytes/1048576
Mbytes, maxbytes/1048576 maxMbytes
from dba_data_files
where tablespace_name like '%UNDO%'
or tablespace_name like '%RBS%'
order by tablespace_name,file_name;
select s.sid,
s.serial#,
'*'||s.process||'*' Client,
p.spid Server,
s.sql_address,
s.sql_hash_value,
s.username,
s.action,
s.program || s.module,
s.terminal,
s.machine,
s.status,
--s.last_call_et
s.last_call_et/3600
from gv$session s, gv$process p
where p.addr=s.paddr and
s.sid=nvl('&sid',s.sid) and
p.spid=nvl('&spid',p.spid) and
nvl(s.process,-1) = nvl('&ClientPid',nvl(s.process,-1));
select piece,sql_text from v$sqltext where HASH_VALUE = &hash and ADDRESS ='&addr' order by
piece;
select username,
t.used_ublk ,t.used_urec
from gv$transaction t,gv$session s
where t.addr=s.taddr and
s.sid='&sessionid';
To find Avg,Max,Min times of a concurrent Program with completed Normal status in Past of a
given Concurrent Program
4961677.992
15846770.6
15633722.6
15643864.6
15705134.6
15617880.6
15847188.6
15607192.6
15622794.6
15628664.6
15631236.6
15642018.6
15639904.6
15648138.6
15697214.6
15734702.6
15744516.6
4959343.993
15606708.6
15606910.6
15852604.6
15601628.6
15602400.6
15604016.6
15607078.6
15612108.6
15620910.6
15628672.6
15629660.6
15626468.6
15633822.6
15639350.6
15641846.6
15702486.6
15639876.6
15639818.6
15640526.6
15642328.6
15647524.6
15687940.6
15688126.6
15685098.6
15676152.6
15695108.6
15697680.6
15703244.6