Re: finding a databases dbspace
Posted in 1997
Dragi Raos wrote: > > s_cawley@litle.net wrote: > > > > Hi, > > > > If I know a database name, how can I find the name of the dbspace it > > lives in? I have been looking through the sysmaster tables looking for an > > answer and cannot find one. > > > > I can find this information using onmonitor, but would like an SQL > > based solution to this problem. > > > > Thanks, > > > > Steve > > > > -------------------==== Posted via Deja News ====----------------------- > > http://www.dejanews.com/ Search, Read, Post to Usenet > > Steve, > > try something like > > select hex(partnum) from yourdatabase:systables where tabname = > "systables" > > It will return something similar to: > > 0xNNN0008E > > where NNN is dbspace number. Try this: SELECT d.name DATABASE, s.name DBSPACE FROM sysdatabases d, sysdbspaces s WHERE s.dbnum = ROUND( d.partnum / 1048576); -- 1048576 == 0x100000 Art S. Kagel