Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to find storage group related to dataset name

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
ahmad

New User


Joined: 18 Oct 2008
Posts: 13
Location: Iran

PostPosted: Sun Nov 11, 2012 6:00 pm    Post subject: How to find storage group related to dataset name
Reply with quote

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
View user's profile Send private message

Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1228
Location: Israel

PostPosted: Sun Nov 11, 2012 9:09 pm    Post subject: Reply to: How to find storage group related to dataset name
Reply with quote

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
View user's profile Send private message
ahmad

New User


Joined: 18 Oct 2008
Posts: 13
Location: Iran

PostPosted: Mon Nov 12, 2012 9:33 am    Post subject:
Reply with quote

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
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Mon Nov 12, 2012 10:34 am    Post subject:
Reply with quote

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
View user's profile Send private message
ahmad

New User


Joined: 18 Oct 2008
Posts: 13
Location: Iran

PostPosted: Mon Nov 12, 2012 10:54 am    Post subject:
Reply with quote

thanks a lot sushanth bobby

that query will do the trick ;)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts Need Help with : IFTHEN(WHEN=GROUP) Sumanta_89 DFSORT/ICETOOL 1 Wed Apr 19, 2017 5:23 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us