RE: asmcmd du command

From: Herring Dave - dherri <Dave.Herring_at_acxiom.com>
Date: Tue, 8 Jan 2013 18:16:30 +0000
Message-ID: <BD475CE0B3EE894DA0CAB36CE2F7DEB401045790BD_at_LITIGMBCRP02.Corp.Acxiom.net>



Although not using "asmcmd", you can use views while pointing to an ASM instance:

SET ECHO on
DEFINE DIRNAME='&1';
DEFINE DISKGROUP_NBR='&2';
SET ECHO off

COL pathname FORMAT A50
COL total_mb FORMAT 99,999,999 HEADING 'Total MB|In Dir' COL total_files FORMAT 999,999 HEADING 'Total Files|In Dir'

SELECT SUBSTR(full_filename, 1, INSTR(full_filename, '/', -1)) pathname

     , ROUND(SUM(bytes) / 1048576) total_mb
     , COUNT(*) total_files
  FROM (SELECT group_number, file_number, pindex
             , concat('+' || gname, sys_connect_by_path(aname, '/')) full_filename
          FROM (SELECT g.name gname, a.parent_index pindex, a.name aname, a.reference_index rindex
                     , a.group_number, a.file_number, a.alias_directory
                  FROM v$asm_alias a,v$asm_diskgroup g
                 WHERE a.group_number = g.group_number
                   AND a.group_number = NVL('&DISKGROUP_NBR', 2))
         START WITH (mod(pindex, power(2, 24))) = 0
       CONNECT BY PRIOR rindex = pindex) a
     , v$asm_file f
 WHERE a.full_filename LIKE '%&DIRNAME%'
   AND a.group_number = f.group_number
   AND a.file_number = f.file_number
 GROUP BY SUBSTR(full_filename, 1, INSTR(full_filename, '/', -1));
                                                      Total MB Total Files
PATHNAME                                                In Dir      In Dir
-------------------------------------------------- ----------- -----------

+DBDATA/ORCL/ 0 2
+DBDATA/ORCL/CONTROLFILE/ 37 2
+DBDATA/ORCL/DATAFILE/ 24,915,562 675
+DBDATA/ORCL/PARAMETERFILE/ 0 1
+DBDATA/ORCL/TEMPFILE/ 1,638,390 25
+DBDATA/ORCL/DATAFILE/ 510,977 55
+DBDATA/ORCL/ONLINELOG/ 48,000 24
+DBDATA/ORCL/PARAMETERFILE/ 0 2

DAVID HERRING
DBA
Acxiom Corporation

EML   dave.herring_at_acxiom.com
TEL    630.944.4762
MBL   630.430.5988 

1501 Opus Pl, Downers Grove, IL 60515, USA WWW.ACXIOM.COM                  -----Original Message-----
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Nagaraj S Sent: Tuesday, January 08, 2013 4:33 AM
To: oracle-l
Subject: asmcmd du command

ASMCMD> ls

KAMAANTC2/
KAMACNTC2/
KAMBAETC2/
KAMEYETC2/
KAMSVETC2/
KAMUANTC2/
KAMUSNTC2/
KAMVSETC1/
KAMAANTC3/
KAMAANTC4/
KAMACNTC2/
KAMBAETC3/
KAMEYETC2/
KAMKLETC2/
KAMSVETC2/
KAMUANTC3/
KAMUSNTC2/
KAMVSETC1/
snapcf_kamacntc2.ora
snapcf_kambaetc3.ora
snapcf_kameyetc2.ora
snapcf_kamkletc2.ora
snapcf_kamsvetc2.ora
snapcf_kamuantc3.ora
snapcf_kamusntc2.ora
snapcf_kamvsetc1.ora
snapcf_kamifc1.ora

snapcf_kamifc1_1.f
snapcf_cracntc2.ora
ASMCMD> du KAMUANTC3
Used_MB      Mirror_used_MB
   4752                4752

How to display size of above all folders in ASMCMD?

--
http://www.freelists.org/webpage/oracle-l


***************************************************************************
The information contained in this communication is confidential, is
intended only for the use of the recipient named above, and may be legally
privileged.

If the reader of this message is not the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited.

If you have received this communication in error, please resend this
communication to the sender and delete the original message or any copy
of it from your computer system.

Thank You.
****************************************************************************

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Jan 08 2013 - 19:16:30 CET

Original text of this message