Re: Q: What did I miss in sys.dba_tables?

From: Loren Budd <Loren_Budd_at_nt.com>
Date: 1995/09/27
Message-ID: <44cfna$5nm_at_bcrkh13.bnr.ca>#1/1


>I want to see how many rows and other information related to the
>tables in our database by querying sys.dba_tables. The query is
>as simple as this:
>
>select owner, table_name, num_rows, blocks, ...
>from sys.dba_tables;
>
>For the results, I got values for owner and table_name. However, all the
>other columns, num_rows, blocks, ..., are null! I know that a lot of tables
>in the database are not empty. What did I miss here?

  You first need to ANALYZE the table in question and COMPUTE STATISTICS. This operation will populate DBA_TABLES with the desired information. Note that when statistics are calculated the optimizer will use a cost-based query path rather than a rule-based one. (Of course, you can DROP STATISTICS after getting the information you wanted, to eliminate this potential problem).   Hope this helps.

LB

Nortel Information Systems Received on Wed Sep 27 1995 - 00:00:00 CET

Original text of this message