tstop_blkwrt.sql

----------------------------------
-- SCRIPT  tstop_blkwrt.sql
-- INICO DO SCRIPT 
-- ALEXANDRE PIRES 14/05/2012
----------------------------------
rem
rem ARQUIVO
rem    tstop_blkwrt.sql
rem
rem FINALIDADE
rem    Lista das tablespaces mais acessadas em blocos escritos
rem
rem MODIFICACOES
rem 14/05/2012 ALEXANDRE PIRES
rem

set feedback off

break on report
compute sum of WRITEPCT on report
compute sum of READPCT on report
compute sum of IOPCT on report

select * from
  (  SELECT TABLESPACE_NAME
     , sum(PHYRDS) as PHYRDS
     , sum(PHYWRTS) as PHYWRTS
     , sum(PHYBLKRD) as PHYBLKRD
     , sum(PHYBLKWRT) as PHYBLKWRT
     , sum(READPCT) as READPCT
     , sum(WRITEPCT) as WRITEPCT
     , sum(IOPCT) as IOPCT
    FROM
     ( SELECT
           decode (dt.extent_management, 'LOCAL', 'L|', 'D|')
       ||  ts.name
       as  tablespace_name
       ,   fs.PHYRDS
       ,   fs.PHYWRTS
       ,   fs.PHYBLKRD
       ,   fs.PHYBLKWRT
       ,   100 * ratio_to_report(fs.PHYBLKRD) over () as readpct
       ,   100 * ratio_to_report(fs.PHYBLKWRT) over () as writepct
       ,   100 * ratio_to_report(fs.PHYBLKRD+fs.PHYBLKWRT) over () as iopct
       FROM V$FILESTAT fs, V$DATAFILE df, v$tablespace ts, dba_tablespaces dt
       WHERE fs.file# = df.file#
         AND df.ts# = ts.ts#
         AND dt.tablespace_name = ts.name )
    GROUP BY tablespace_name
    ORDER BY writepct desc )
where rownum < 11
/
prompt
clear breaks compute
set feedback 6
----------------------------------
-- FIM DO SCRIPT  -- 

Sobre Alexandre Pires

ORACLE OCS Goldengate Specialist, OCE RAC 10g R2, OCP 12C, 11g, 10g , 9i e 8i - Mais de 25 anos de experiência na área de TI. Participei de projetos na G&P alocado na TOK STOK, EDINFOR alocado na TV CIDADE "NET", 3CON Alocado no PÃO DE AÇUCAR, DISCOVER alocado na VIVO, BANCO IBI e TIVIT, SPC BRASIL, UOLDIVEO alocado no CARREFOUR e atualmente na ORACLE ACS atendendo os seguintes projetos: VIVO, CLARO, TIM, CIELO, CAIXA SEGUROS, MAPFRE, PORTO SEGURO, SULAMERICA, BRADESCO SEGUROS, BANCO BRADESCO, BASA, SANTANDER, CNJ, TSE, ELETROPAULO, EDP, SKY, NATURA, ODEBRESHT, NISSEI, SICREDI, CELEPAR, TAM, TIVIT, IBM, SMILES, CELEPAR, SERPRO,OKI,BANCO PAN, etc
Esse post foi publicado em ORACLE 11gR2, PLSQL SCRIPTS e marcado , , , . Guardar link permanente.

Deixe um comentário