--- sprawdzenie VotinGDisk

crsctl query css votedisk


acfsutil size +80G /css 



SELECT dg.name AS diskgroup, v.volume_name, v.bytes_read, v.bytes_written
    FROM V$ASM_DISKGROUP dg, V$ASM_VOLUME_STAT v 
    WHERE dg.group_number = v.group_number and dg.name like 'OCRVOTE';



    SELECT SUBSTR(dg.name,1,16) AS diskgroup, SUBSTR(d.name,1,16) AS asmdisk,
d.mount_status, d.state, SUBSTR(d.failgroup,1,16) AS failgroup
FROM V$ASM_DISKGROUP dg, V$ASM_DISK d WHERE dg.group_number = d.group_number;



select d.group_number, g.name, d.os_mb/1024 GB
from v$asm_disk d left outer join v$asm_diskgroup g
on (d.group_number = g.group_number)
where g.name = 'OCRVOTE'
order by g.group_number, d.os_mb;


-- 1)  Lun size check for ASM Disk size.. 
     ------------------------------------------------
select d.group_number, g.name, d.os_mb/1024 GB
from v$asm_disk d left outer join v$asm_diskgroup g
on (d.group_number = g.group_number)
order by g.group_number, d.os_mb;


-- 2) Asm Disk Group Size..

set linesize 1000
break on report on disk_group_name skip 1
compute sum label "Grand Total: " of total_MB used_MB on report
SELECT
  name                                GROUP_NAME
, round ( total_mb)                   TOTAL_MB
, round ( (total_mb - free_mb) )      USED_MB
, round ( free_mb)                    FREE_MB
, ROUND((1- (free_mb / total_mb))*100,2  )  USED
, (100 - ROUND((1- (free_mb / total_mb))*100,2))  FREE
FROM
  v$asm_diskgroup
ORDER BY
  name
/

select name,total_mb/1024 total_gb,free_mb/1024 free_gb, round(free_mb/total_mb*100) "FREE%" from v$asm_diskgroup where name ='DATACOPDAT';

alter tablespace  AUDIT_DATA add datafile '+BOQR_DG' size 2048M autoextend on Maxsize 30G;


-- 3) Flash recovery size..
   --------------------
col name for a32
col size_m for 999,999,999
col reclaimable_m for 999,999,999
col used_m for 999,999,999
col pct_used for 999

SELECT name
, ceil( space_limit / 1024 / 1024) SIZE_M
, ceil( space_used  / 1024 / 1024) USED_M
, ceil( space_reclaimable  / 1024 / 1024) RECLAIMABLE_M
, decode( nvl( space_used, 0),
0, 0
, ceil ( ( ( space_used - space_reclaimable ) / space_limit) * 100) ) PCT_USED
FROM v$recovery_file_dest
ORDER BY name
/



-- 4) Asm Disk Group Size..
   -------------------

SET LINESIZE  145
SET PAGESIZE  9999
SET VERIFY    off
COLUMN group_name             FORMAT a20           HEAD 'Disk Group|Name'
COLUMN sector_size            FORMAT 99,999        HEAD 'Sector|Size'
COLUMN block_size             FORMAT 99,999        HEAD 'Block|Size'
COLUMN allocation_unit_size   FORMAT 999,999,999   HEAD 'Allocation|Unit Size'
COLUMN state                  FORMAT a11           HEAD 'State'
COLUMN type                   FORMAT a6            HEAD 'Type'
COLUMN total_mb               FORMAT 999,999,999   HEAD 'Total Size (MB)'
COLUMN used_mb                FORMAT 999,999,999   HEAD 'Used Size (MB)'
COLUMN pct_used               FORMAT 999.99        HEAD 'Pct. Used'

break on report on disk_group_name skip 1
compute sum label "Grand Total: " of total_mb used_mb on report

SELECT
    name                                     group_name
  , sector_size                              sector_size
  , block_size                               block_size
  , allocation_unit_size                     allocation_unit_size
  , state                                    state
  , type                                     type
  , total_mb                                 total_mb
  , (total_mb - free_mb)                     used_mb
  , ROUND((1- (free_mb / total_mb))*100, 2)  pct_used
FROM
    v$asm_diskgroup
ORDER BY
    name
/


5)Oracle Database : Space used in the flash recovery area.

set lines 900 pages 900
col NAME for a15
col space_limit for a15
col SPACE_USED for a15


select name,space_limit/1024/1024,SPACE_USED/1024/1024 from v$recovery_file_dest;

select NAME,
floor(space_limit/1024/1024) "Size_MB",
ceil(space_used/1024/1024) "Used_MB",
floor(space_limit/1024/1024) - ceil(space_used/1024/1024) "Available_MB",
round(ceil(space_used/1024/1024) / floor(space_limit/1024/1024) * 100)  || '%' "Percent Used"
from v$recovery_file_dest
order by 1;


-- Check rolling patch mode and patch level

SELECT SYS_CONTEXT('SYS_CLUSTER_PROPERTIES', 'CLUSTER_STATE') FROM DUAL;
SELECT SYS_CONTEXT('SYS_CLUSTER_PROPERTIES', 'CURRENT_PATCHLVL') FROM DUAL;

-- Check the disk group attributes

SELECT SUBSTR(dg.name,1,12) AS diskgroup, SUBSTR(a.name,1,24) AS name,
SUBSTR(a.value,1,24) AS value, read_only FROM V$ASM_DISKGROUP dg,
V$ASM_ATTRIBUTE a WHERE dg.name = 'DATA' AND dg.group_number = a.group_number
AND a.name NOT LIKE '%template%';

-- Check size of disk group

SELECT name, type, total_mb, free_mb, required_mirror_free_mb, usable_file_mb FROM V$ASM_DISKGROUP;

-- Check candidate disk present for add disk

SELECT name, header_status, path, FAILGROUP FROM V$ASM_DISK WHERE path LIKE '%WAWPLOGDBP11A-B_DB_DATACOLL_DATA_PROD_0%';

-- Check the compatibility of a disk group

SELECT name AS diskgroup, substr(compatibility,1,12) AS asm_compat,
substr(database_compatibility,1,12) AS db_compat FROM V$ASM_DISKGROUP;

DISKGROUP ASM_COMPAT DB_COMPAT
--------- ---------- ----------
DATA      18.0.0.0.0 18.0.0.0.0
DATA1     18.0.0.0.0 18.0.0.0.0

-- Check disks present in disk groups

SELECT SUBSTR(dg.name,1,16) AS diskgroup, SUBSTR(d.name,1,16) AS asmdisk,
d.mount_status, d.state, SUBSTR(d.failgroup,1,16) AS failgroup
FROM V$ASM_DISKGROUP dg, V$ASM_DISK d WHERE dg.group_number = d.group_number;

DISKGROUP ASMDISK MOUNT_S STATE  FAILGROUP
--------- ------- ------- ------ ---------
DATA      DATA_01 CACHED  NORMAL DATA_0008
DATA      DATA_02 CACHED  NORMAL DATA_0000
DATA      DATA_03 CACHED  NORMAL DATA_0004

-- Check stats of disks in disk groups

SELECT SUBSTR(dgs.name,1,10) AS diskgroup, SUBSTR(ds.name,1,10) AS asmdisk,
ds.mount_status, ds.state, ds.reads, ds.writes, ds.read_time, ds.write_time,
bytes_read, bytes_written
FROM V$ASM_DISKGROUP_STAT dgs, V$ASM_DISK_STAT ds
WHERE dgs.group_number = ds.group_number AND dgs.name = 'DATA';

-- Check disk group clients with V$ASM_CLIENT

SELECT dg.name AS diskgroup, SUBSTR(c.instance_name,1,12) AS instance,
SUBSTR(c.db_name,1,12) AS dbname, SUBSTR(c.SOFTWARE_VERSION,1,12) AS software,
SUBSTR(c.COMPATIBLE_VERSION,1,12) AS compatible
FROM V$ASM_DISKGROUP dg, V$ASM_CLIENT c
WHERE dg.group_number = c.group_number;