querying sysmaster to find what dbspace a database
Posted in 2007
Topics: Storage & Space Management
I can use onmonitor to find this but would like to be able to query for this. Can anyone tell me what tables (if any) have this information? Thanks, Joe
Sorry, my title was truncated. I want to know how to query sysmaster to find what dbspace a database was created in. "Joseph_Jurcazak@aotx.uscourts.gov" <Joseph_Jurcazak@aotx.uscourts.gov> Sent by: ids-bounces@iiug.org 08/28/2007 04:09 PM Please respond to ids@iiug.org To ids@iiug.org cc Subject querying sysmaster to find what dbspace a data.... [9871] I can use onmonitor to find this but would like to be able to query for this. Can anyone tell me what tables (if any) have this information? Thanks, Joe ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
I use this script.... Adjust to your needs...
cat tables_by_dbspace.ksh
#!/usr/bin/ksh
DBSPACE=${1}
if [[ ! -z ${DBSPACE} ]]; then
DBSPACE=" and d.name = \\\\"${DBSPACE}\\\\""
fi
dbaccess ${DBNAME} <<!
select substr(d.name,1,20) as DBSpace
,substr(t.tabname,1,30) as TableName
from systables t, sysmaster:sysdbspaces d
where d.dbsnum = trunc(partnum / 1048576)
and t.partnum != 0 -- Unfragmented tables
and tabid > 99
and tabtype = "T"
${DBSPACE}
union
select substr(d.name,1,20)
,substr(t.tabname,1,30)
from systables t, sysfragments f, sysmaster:sysdbspaces d where
d.dbsnum = trunc(f.partn/1048576)
and f.tabid = t.tabid
and t.partnum = 0 -- Fragmented tables
and t.tabid > 99
and tabtype = "T"
${DBSPACE}
order by 1, 2
!
***************************************************************
-----Original Message-----
From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of
Joseph_Jurcazak@aotx.uscourts.gov
Sent: Tuesday, August 28, 2007 5:12 PM
To: ids@iiug.org
Subject: Re: querying sysmaster to find what dbspace a .... [9872]
Sorry, my title was truncated.
I want to know how to query sysmaster to find what dbspace a database
was created in.
"Joseph_Jurcazak@aotx.uscourts.gov" <Joseph_Jurcazak@aotx.uscourts.gov>
Sent by: ids-bounces@iiug.org
08/28/2007 04:09 PM
Please respond to
ids@iiug.org
To
ids@iiug.org
cc
Subject
querying sysmaster to find what dbspace a data.... [9871]
I can use onmonitor to find this but would like to be able to query for
this. Can anyone tell me what tables (if any) have this information?
Thanks,
Joe
************************************************************************
*******
Forum Note: Use "Reply" to post a response in the discussion forum.
************************************************************************
*******
Forum Note: Use "Reply" to post a response in the discussion forum.
Please do not transmit orders or instructions regarding a UBS account by
e-mail. The information provided in this e-mail or any attachments is not an
official transaction confirmation or account statement. For your protection,
do not include account numbers, Social Security numbers, credit card numbers,
passwords or other non-public information in your e-mail. Because the
information contained in this message may be privileged, confidential,
proprietary or otherwise protected from disclosure, please notify us
immediately by replying to this message and deleting it from your computer if
you have received this communication in error. Thank you.
UBS Financial Services Inc.
UBS International Inc.
UBS Financial Services Incorporated of Puerto Rico
SELECT DBINFO( 'dbspace', partnum ) FROM sysmaster:systabnames WHERE dbsname = <yourdatabasename> AND tabname = 'systables'; Art S. Kagel ----- Original Message ----- From: Joseph_Jurcazak@aotx.uscourts.gov <ids@iiug.org> At: 8/28 17:12:25 Sorry, my title was truncated. I want to know how to query sysmaster to find what dbspace a database was created in. "Joseph_Jurcazak@aotx.uscourts.gov" <Joseph_Jurcazak@aotx.uscourts.gov> Sent by: ids-bounces@iiug.org 08/28/2007 04:09 PM Please respond to ids@iiug.org To ids@iiug.org cc Subject querying sysmaster to find what dbspace a data.... [9871] I can use onmonitor to find this but would like to be able to query for this. Can anyone tell me what tables (if any) have this information? Thanks, Joe ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum. ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
That worked. Thanks, Art. "ART KAGEL, BLOOMBERG/ 731 LEXIN" <kagel@bloomberg.net> Sent by: ids-bounces@iiug.org 08/28/2007 04:24 PM Please respond to ids@iiug.org To ids@iiug.org cc Subject Re: querying sysmaster to find what dbspace a .... [9874] SELECT DBINFO( 'dbspace', partnum ) FROM sysmaster:systabnames WHERE dbsname = <yourdatabasename> AND tabname = 'systables'; Art S. Kagel ----- Original Message ----- From: Joseph_Jurcazak@aotx.uscourts.gov <ids@iiug.org> At: 8/28 17:12:25 Sorry, my title was truncated. I want to know how to query sysmaster to find what dbspace a database was created in. "Joseph_Jurcazak@aotx.uscourts.gov" <Joseph_Jurcazak@aotx.uscourts.gov> Sent by: ids-bounces@iiug.org 08/28/2007 04:09 PM Please respond to ids@iiug.org To ids@iiug.org cc Subject querying sysmaster to find what dbspace a data.... [9871] I can use onmonitor to find this but would like to be able to query for this. Can anyone tell me what tables (if any) have this information? Thanks, Joe ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum. ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum. ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.