Sunteți pe pagina 1din 2

3) If the temporary Tablespace is not temporary then create a new temporary

Tablespace & switch over all the users from old to new temporary Tablespace
CREATE TEMPORARY TABLESPACE TEMP TEMPFILE '/home1/oradata/enggaprd/TEMP01.DBF' S
IZE 750M AUTOEXTEND OFF EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M SEGMENT SPACE MA
NAGEMENT MANUAL;
4) The below Query is used to find which user is consuming more in temporar
y tablespaces.
select s.username,u.tablespace, u.contents,u.extents, u.blocks from v$session s,
v$sort_usage u where s.saddr=u.session_addr;
5) To find out if a TEMP Segment is FREE or being USED and also in which Ta
blespace the segment resides, query the new dynamic performance view V$SORT_SEGM
ENT
select TABLESPACE_NAME,TOTAL_BLOCKS,USED_BLOCKS,FREE_BLOCKS
from v$sort_segment;
6) Check for the Undo tablespaces, if not create a new undo Tablespace & dr
op the rollback tablespaces & segments.
7) Check the Memory Usage
REM Monitor memory usage
select sid, name, value from v$statname n, v$sesstat s
where n.statistic# = s.statistic# and n.name like '%memory%' order by sid;
REM monitor CPU usage
select sid, name, value
from v$statname n, v$sesstat s where n.statistic# = s.statistic# and n.name like
'%cpu%' order by sid;
REM monitor I/O
select file#, phyrds, phywrts from v$filestat;
Depending upon the phyrds we can able to find which file is having more hits & i
f possible move the file to some other disk for reducing the cpu hit.
REM The Following Query can give a good idea of what the session is doing and ho
w much CPU they have consumed
select ss.sid,se.command,ss.value CPU ,se.username,se.program
from v$sesstat ss, v$session se where ss.statistic# in (select statistic# from v
$statname where name = 'CPU used by this session') and se.sid=ss.sid and ss.sid
>6 order by ss.sid
8) System-wide wait Analysis can be done by using the below query.
##################Script#############################################
set pages 999
set lines 90
column c1 heading 'Event|Name' format a30
column c2 heading 'Total|Waits' format 999,999,999
column c3 heading 'Seconds|Waiting' format 999,999
column c4 heading 'Total|Timeouts' format 999,999,999
column c5 heading 'Average|Wait|(in secs)' format 99.999
ttitle 'System-wide Wait Analysis|for current wait events'
select
event c1,
total_waits c2,
time_waited / 100 c3,
total_timeouts c4,
average_wait /100 c5
from
sys.v_$system_event
where
event not in (
'dispatcher timer',
'lock element cleanup',
'Null event',
'parallel query dequeue wait',
'parallel query idle wait - Slaves',
'pipe get',
'PL/SQL lock timer',
'pmon timer',
'rdbms ipc message',
'slave wait',
'smon timer',
'SQL*Net break/reset to client',
'SQL*Net message from client',
'SQL*Net message to client',
'SQL*Net more data to client',
'virtual circuit status',
'WMON goes to sleep'
)
AND
event not like 'DFS%'
and
event not like '%done%'
and
event not like '%Idle%'
AND
event not like 'KXFX%'
order by
c2 desc;
##################Script#############################################
9) Check the dbcache advice & increase the db_cache_size if possible.

S-ar putea să vă placă și