View previous topic :: View next topic
|
Author |
Message |
ahmad
New User
Joined: 18 Oct 2008 Posts: 13 Location: Iran
|
|
|
|
hi guys
consider that I have name of the dataset like 'DB9CAT.DSNDBD.BANK.TSPAGE.I0001.A009'
and i want to find it's related storage group in db2. i've already serached SYSxxxxxxs on DSNDB06 CATALOG TABLES but found nothing useful.
also my final goal is finding all volumes assigned to that desired storage group.
I'll appreciate your help. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Check these Catalog Tables for partial answer:
Table SYSSTOGROUP contains one row for each DB2 storage group.
Table SYSVOLUMES contains one row for each volume of each storage group.
Edit:
Table SYSDATABASE has a column 'STGROUP' which contains the default storage group of the database. |
|
Back to top |
|
|
ahmad
New User
Joined: 18 Oct 2008 Posts: 13 Location: Iran
|
|
|
|
thanks marso
but I'v already searched those tables and didn't find any relation between SYSTABLESPACE and SYSSTOGROUP which help me to find for example 'storage group of table space named TSPAGE' .
as you know in db2 panels if you put S command beside table name it'll show you it's table space name and if you put G beside that table space name it'll return it's Storage group name. I want to extract that kind of information.
well,I'm waiting for more...
and you mentioned SYSDATABASE, in my environment database designs some TSs are in default storage group of that data base but some of them have their own SG, so SYSDATABAE couldn't be so helpful in my case. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Hi Ahmad,
Quote: |
DB9CAT.DSNDBD.BANK.TSPAGE.I0001.A009 |
So your,
database = BANK
Tablespace= TSPAGE
Partition = 9
to find storage group name, run the below query
Code: |
select dbname, tsname, STORNAME
from sysibm.systablepart
where dbname = 'BANK'
and TSNAME = 'TSPAGE'
--and PARTITION = 9
;
|
Use the above storagegroup name result in the below queries,
Code: |
select sgname ,volid from sysibm.sysvolumes
where sgname = ' ' --<-- Type in Storage Group name
;
select name, vcatname, space, dataclas, mgmtclas, storclas
from sysibm.sysstogroup
where name = ' ' --<-- Type in Storage Group name
;
|
thanks,
Sushanth |
|
Back to top |
|
|
ahmad
New User
Joined: 18 Oct 2008 Posts: 13 Location: Iran
|
|
|
|
thanks a lot sushanth bobby
that query will do the trick ;) |
|
Back to top |
|
|
|