Re: finding a databases dbspace
Posted in 1997
Art S. Kagel wrote: > > Dragi Raos wrote: > > > > s_cawley@litle.net wrote: > > > > > > 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. > > > > > 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 Or, slightly easier: SELECT dbinfo("dbspace", partnum), name FROM sysdatabases ;-) Cheers, -- Mark. +----------------------------------------------------------+-----------+ |Mark D. Stock - Informix SA http://www.informix.com |//////// /| |mailto:mdstock@informix.com FAQ http://www.iiug.org |///// / //| | +-----------------------------------+//// / ///| | Tel: +27 11 807 0313 |If it's slow, the users complain. |/// / ////| | Fax: +27 11 807 2594 |If it's fast, the users keep quiet.|// / /////| |Cell: +27 83 250 2325 |Therefore, "No news: travels fast"!|/ ////////| +----------------------+-----------------------------------+-----------+