SCRIPTS UTEIS PARA TRABALHAR COM ASM.

SCRIPTS UTEIS PARA TRABALHAR COM ASM.

-----
 -- Consultando as Views Dinamicas do ASM
 -----
SET LINESIZE 100
 SET PAGESIZE 60
-----
 -- V$ASM_ALIAS
 -- Mostra todos os alias para cada grupo de disco montado pela instância ASM
-----
 TTITLE 'ASM Disk Group Aliases (From V$ASM_ALIAS)'
 COL name                FORMAT A48              HEADING 'Disk Group Alias'
 COL group_number        FORMAT 99999            HEADING 'ASM|File #'
 COL file_number         FORMAT 99999            HEADING 'File #'
 COL file_incarnation    FORMAT 99999            HEADING 'ASM|File|Inc#'
 COL alias_index         FORMAT 99999            HEADING 'Alias|Index'
 COL alias_incarnation   FORMAT 99999            HEADING 'Alias|Incn#'
 COL parent_index        FORMAT 99999            HEADING 'Parent|Index'
 COL reference_index     FORMAT 99999            HEADING 'Ref|Idx'
 COL alias_directory     FORMAT A4               HEADING 'Ali|Dir?'
 COL system_created      FORMAT A4               HEADING 'Sys|Crt?'
 SELECT
 name
 ,group_number
 ,file_number
 ,file_incarnation
 ,alias_index
 ,alias_incarnation
 ,parent_index
 ,reference_index
 ,alias_directory
 ,system_created
 FROM v$asm_alias
 ;
-----
 -- V$ASM_CLIENT
 - Mostra grupos de disco por instancia
 -----
 TTITLE 'ASM Client Database Instances (From V$ASM_CLIENT)'
 COL group_number    FORMAT 99999    HEADING 'ASM|File #'
 COL instance_name   FORMAT A32      HEADING 'Serviced Database Client' WRAP
 COL db_name         FORMAT A08      HEADING 'Database|Name'
 COL status          FORMAT A12      HEADING 'Status'
 SELECT
 group_number
 ,instance_name
 ,db_name
 ,status
 FROM v$asm_client
 ;
-----
 -- V$ASM_DISK
 - Lista cada disco descoberto pela instância ASM, incluindo discos que não fazem parte de nenhum grupo de discos ASM
-----
 TTITLE 'ASM Disks - General Information (From V$ASM_DISK)'
 COL group_number        FORMAT 99999    HEADING 'ASM|Disk|Grp #'
 COL disk_number         FORMAT 99999    HEADING 'ASM|Disk|#'
 COL name                FORMAT A32      HEADING 'ASM Disk Name' WRAP
 COL total_mb            FORMAT 99999999 HEADING 'Total|Disk|Space(MB)'
 COL compound_index      FORMAT 999      HEADING 'Cmp|Idx|#'
 COL incarnation         FORMAT 999      HEADING 'In#'
 COL mount_status        FORMAT A07      HEADING 'Mount|Status'
 COL header_status       FORMAT A12      HEADING 'Header|Status'
 COL mode_status         FORMAT A08      HEADING 'Mode|Status'
 COL state               FORMAT A07      HEADING 'Disk|State'
 COL redundancy          FORMAT A07      HEADING 'Redun-|dancy'
 COL path                FORMAT A32      HEADING 'OS Disk Path Name' WRAP
 SELECT
 group_number
 ,disk_number
 ,name
 ,total_mb
 ,compound_index
 ,incarnation
 ,mount_status
 ,header_status
 ,mode_status
 ,state
 ,redundancy
 ,path
 FROM v$asm_disk
 ;
TTITLE 'ASM Disks - I/O Status (From V$ASM_DISK)'
 COL group_number        FORMAT 99999    HEADING 'ASM|Disk|Grp #'
 COL disk_number         FORMAT 99999    HEADING 'ASM|Disk|#'
 COL mount_status        FORMAT A07      HEADING 'Mount|Status'
 COL total_mb            FORMAT 999999   HEADING 'Total|Disk|Space(MB)'
 COL free_mb             FORMAT 999999   HEADING 'Free|Disk|Space(MB)'
 COL reads               FORMAT 999999   HEADING 'Disk|Reads'
 COL mb_read             FORMAT 999999   HEADING 'Reads|(MB)'
 COL read_time           FORMAT 999999   HEADING 'Read|Time'
 COL read_errs           FORMAT 999999   HEADING 'Read|Errors'
 COL writes              FORMAT 999999   HEADING 'Disk|Writes'
 COL write_errs          FORMAT 999999   HEADING 'Write|Errors'
 COL write_time          FORMAT 999999   HEADING 'Write|Time'
 SELECT
 group_number
 ,disk_number
 ,mount_status
 ,total_mb
 ,free_mb
 ,reads
 ,(bytes_read / (1024*1024)) mb_read
 ,read_errs
 ,read_time
 ,writes
 ,write_errs
 ,write_time
 FROM v$asm_disk
 ;
-----
 -- V$ASM_DISKGROUP
 - Descreve informações sobre grupos de discos ASM montado pela instância ASM
 -----
 TTITLE 'ASM Disk Groups (From V$ASM_DISKGROUP)'
 COL group_number        FORMAT 99999    HEADING 'ASM|Disk|Grp #'
 COL name                FORMAT A12      HEADING 'ASM Disk|Group Name' WRAP
 COL sector_size         FORMAT 99999999 HEADING 'Sector|Size'
 COL block_size          FORMAT 999999   HEADING 'Block|Size'
 COL au_size             FORMAT 99999999 HEADING 'Alloc|Unit|Size'
 COL state               FORMAT A11      HEADING 'Disk|Group|State'
 COL type                FORMAT A06      HEADING 'Disk|Group|Type'
 COL total_mb            FORMAT 999999   HEADING 'Total|Space(MB)'
 COL free_mb             FORMAT 999999   HEADING 'Free|Space(MB)'
 SELECT
 group_number
 ,name
 ,sector_size
 ,block_size
 ,allocation_unit_size au_size
 ,state
 ,type
 ,total_mb
 ,free_mb
 FROM v$asm_diskgroup
 ;
-----
 -- V$ASM_FILE
 -- Lista cada arquivo ASM em cada grupo de discos ASM montado pela instância ASM
 -----
 TTITLE 'ASM Files (From V$ASM_FILE)'
 COL group_number        FORMAT 99999    HEADING 'ASM|File #'
 COL file_number         FORMAT 99999    HEADING 'File #'
 COL compound_index      FORMAT 999      HEADING 'Cmp|Idx|#'
 COL incarnation         FORMAT 999      HEADING 'In#'
 COL block_size          FORMAT 999999   HEADING 'Block|Size'
 COL blocks              FORMAT 999999   HEADING 'Blocks'
 COL bytes_mb            FORMAT 999999   HEADING 'Size|(MB)'
 COL space_alloc_mb      FORMAT 999999   HEADING 'Space|Alloc|(MB)'
 COL type                FORMAT A32      HEADING 'ASM File Type' WRAP
 COL redundancy          FORMAT A06      HEADING 'Redun-|dancy'
 COL striped             FORMAT A07      HEADING 'Striped'
 COL creation_date       FORMAT A12      HEADING 'Created On'
 COL modification_date   FORMAT A12      HEADING 'Last|Modified'
 SELECT
 group_number
 ,file_number
 ,compound_index
 ,incarnation
 ,block_size
 ,blocks
 ,(bytes / (1024*1024)) bytes_mb
 ,(space / (1024*1024)) space_alloc_mb
 ,type
 ,redundancy
 ,striped
 ,creation_date
 ,modification_date
 FROM v$asm_file
 ;
-----
 -- V$ASM_OPERATION
 - Mostra cada operação ASM de longa duração na instância ASM
 -----
 TTITLE 'Long-Running ASM Operations (From V$ASM_OPERATIONS)'
 COL group_number        FORMAT 99999    HEADING 'ASM|Disk|Grp #'
 COL operation           FORMAT A08      HEADING 'ASM|Oper-|ation'
 COL state               FORMAT A08      HEADING 'ASM|State'
 COL power               FORMAT 999999   HEADING 'ASM|Power|Rqstd'
 COL actual              FORMAT 999999   HEADING 'ASM|Power|Alloc'
 COL est_work            FORMAT 999999   HEADING 'AUs|To Be|Moved'
 COL sofar               FORMAT 999999   HEADING 'AUs|Moved|So Far'
 COL est_rate            FORMAT 999999   HEADING 'AUs|Moved|PerMI'
 COL est_minutes         FORMAT 999999   HEADING 'Est|Time|Until|Done|(MM)'
 SELECT
 group_number
 ,operation
 ,state
 ,power
 ,actual
 ,est_work
 ,sofar
 ,est_rate
 ,est_minutes
 FROM v$asm_operation
 ;
-----
 -- V$ASM_TEMPLATE
 -- Lista cada template presente em cada grupo de discos ASM montado pela instância ASM
 -----
 TTITLE 'ASM Templates (From V$ASM_TEMPLATE)'
 COL group_number        FORMAT 99999    HEADING 'ASM|Disk|Grp #'
 COL entry_number        FORMAT 99999    HEADING 'ASM|Entry|#'
 COL redundancy          FORMAT A06      HEADING 'Redun-|dancy'
 COL stripe              FORMAT A06      HEADING 'Stripe'
 COL system              FORMAT A03      HEADING 'Sys|?'
 COL name                FORMAT A30      HEADING 'ASM Template Name' WRAP
 SELECT
 group_number
 ,entry_number
 ,redundancy
 ,stripe
 ,system
 ,name
 FROM v$asm_template

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 ASM, PLSQL SCRIPTS, RMAN, TUTORIAL e marcado , , , , , , , , , , , , , , , , . Guardar link permanente.

Deixe uma resposta

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair / Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair / Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair / Alterar )

Foto do Google+

Você está comentando utilizando sua conta Google+. Sair / Alterar )

Conectando a %s