re: tables in a dbspace (Online 5.x)
Posted in 1994
brian,
to find out which dbspace a tables lives in:
select tabname,hex(partnum)
from systables
where tabname = 'systables' -- or whatever table
this will output the following:
tabname (expression)
systables 0x010000AB
you take the 3-4 characters of the hex(partnum) and this is the dbspace
the table is in.
as far as finding out which tables are in a dbspace:
# list all database name here
DBNAME_LIST="stores system"
# clear the output file
/bin/rm /tmp/dbspace_report
touch /tmp/dbspace_report
# build the output file
for dbname in `echo $DBNAME_LIST`
do
echo $dbname
echo "unload to /tmp/tmp.123 select hex(partnum),\\"$dbname\\",tabname from systables" \\
| isql $dbname
cat /tmp/tmp.123 >> /tmp/dbspace_report
done
# sort the output file
sort /tmp/dbspace_report -o /tmp/dbspace_report
more /tmp/dbspace_report
>
> Is there a simple way to find which tables are in a dbspace?
> (Or, what dbspace a table is in?)
>
> -Brian
> ------
> brena@hcia.com
>
--
regards,
+----------------------------------------------------------------------------+
| . . | |
| ... ... | Bob Baskett |
| ..... ..... | Software Engineer, DBA |
| .. ... .. | Business Systems Integration Group |
| . . . | Semiconductor Products Sector |
| | Mesa, AZ |
| Motorola, Inc. | |
|----------------------------------------------------------------------------|
| 'connectionLESS IS MORE' -- Data Broker |
|----------------------------------------------------------------------------|
| Duct tape is like the force. It has a light side, and a dark side, and |
| it holds the universe together ... |
| -- Carl Zwanzig |
+----------------------------------------------------------------------------+