Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1243
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 sharing PLI storage Pedro PL/I & Assembler 2 Mon Oct 16, 2017 10:11 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us