Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

diskgroup calculations

2 views
Skip to first unread message

just_real

unread,
Jan 14, 2009, 7:56:01 PM1/14/09
to
Hi

I am using this query to display the size of the diskgroups in Oracle
and manually adding the figures up to get the total size of the
diskgroup.

select b.instance_name, a.LABEL,a.NAME,a.TOTAL_MB,a.GROUP_NUMBER from
v
$asm_disk a, v$asm_client b where a.group_number = b.group_number;

The question I have is:

1. Is there a better way to work out the calculations of total
diskgroup size?

2. The above query only works if the diskgroup is managed by ASM. What
would I be doing if there is no ASM? What would I have to change in
the query above?

Thank you.

Steve Howard

unread,
Jan 14, 2009, 8:05:01 PM1/14/09
to

Hi,

1) select total_mb,free_mb from v$asm_diskgroup;
2) I don't understand the question. What diskgroup is not is ASM?
Do you mean a disk that is a candidate device, but not part of a
diskgroup? I think there is a column for that (state or status, I
think), but I don't remember the name. You can filter the correct
column in v$asm_disk and sum the bytes to get the total size of
devices not allocated.

In linux, you can also do a...

blockdev --getsize /dev/raw/$RAW_DEVICE_NAME

HTH,

Steve

just_real

unread,
Jan 14, 2009, 8:21:23 PM1/14/09
to

Hi Steve

Thanks for the prompt reply. Sorry for my terminologies - still a newb
and just realised that diskgroups = ASM. I think what I was trying to
ask was how then would i calculate the size for a non-disk group.

I will try to paint a scenario - I've got A1, A2 are cluster databases
managed by ASM. Using the query that I had above would give me the
size of the A diskgroup. But on the same server is B on its own. So I
guess how would I calculate the size of the B filesystem? (i hope i am
making sense)

Thanks again

Steve Howard

unread,
Jan 14, 2009, 8:36:09 PM1/14/09
to

I'm still not following. Do you mean you have the following raw
devices, with their ownership (or lack of) by an ASM diskgroup.

/dev/raw/raw1 - GROUP1 (A in your example)
/dev/raw/raw2 - GROUP1 (A in your example)
/dev/raw/raw3 - Not part of ASM
/dev/raw/raw4 - Not part of ASM
/dev/raw/raw5 - GROUP2 (B in your example)
/dev/raw/raw6 - GROUP2 (B in your example)

Are GROUP1 and GROUP2 managed by the same ASM instance? The answer
should be yes :) If so, then both diskgroups are fully available to
any database instance that uses them for storage on that node.

>> But on the same server is B on its own. So I guess how would I calculate the size of the B filesystem?

If you wish to calculate the size of each diskgroup, I would use the v
$asm_diskgroup view I mentioned earlier. Also, since you mentioned a
filesystem, you can have datafiles in both ASM and on a filesystem.
ASM doesn't have to be used exclusively.

HTH,

Steve

just_real

unread,
Jan 14, 2009, 11:09:23 PM1/14/09
to

ahhaah thanks for your response steve

I think this is what i was trying to say:

/dev/raw/raw1 - GROUP1 (A1+ in your example)
/dev/raw/raw2 - GROUP1 (A2+ in your example)
/dev/raw/raw5 - B
/dev/raw/raw1 - GROUP2(C1+ in your example)
/dev/raw/raw2 - GROUP2 (C2+ in your example)

hmmmm...does the above make sense? and yeah group 1 and group 2 in
your description above are managed by the same ASM as you hinted :),

Mladen Gogala

unread,
Jan 15, 2009, 3:44:17 AM1/15/09
to
On Wed, 14 Jan 2009 17:21:23 -0800, just_real wrote:

> But on the same server is B on its own. So I guess how would I calculate
> the size of the B filesystem? (i hope i am making sense)

Not so long ago, the mighty Google should still have it, I posted
a Perl script that uses DBI and Filesys::DfPortable to compute the
size of file systems and store the results into an Oracle database.
The script is then scheduled via crontab or as an external job. I posted
it on this group and the script name was "dfree". Please, send me a
private email if you are unable to find it.

--
Mladen Gogala
http://mgogala.freehostia.com

0 new messages