Home » SQL & PL/SQL » SQL & PL/SQL » Values on NUM_ROWS of DBA_TABLE is appearing as null for 48 records (11g, 11.2.0.1, window7)
Values on NUM_ROWS of DBA_TABLE is appearing as null for 48 records [message #632586] Tue, 03 February 2015 06:42 Go to next message
ashishkumarmahanta80
Messages: 231
Registered: October 2006
Location: kolkatta
Senior Member
Dear All,

IN a new test env. import of schema is done. Which shows 48 rows are imported. Even in select stmt, output of tables show, 48 records.

When we fetch record from view DBA_TABLES, it shows null. Please find the below output.

SQL> SELECT  table_name, num_rows  FROM DBA_TABLES
  2  WHERE --owner ='INS' and
  3  table_name = 'GENMST_TAB_STATE';

TABLE_NAME                       NUM_ROWS
------------------------------ ----------
GENMST_TAB_STATE

SQL> select count(*) from ins.GENMST_TAB_STATE;

  COUNT(*)
----------
        48



Please suggest, what could be the reason of it?

Regards,
Ashish Kumar Mahanta
Re: Values on NUM_ROWS of DBA_TABLE is appearing as null for 48 records [message #632587 is a reply to message #632586] Tue, 03 February 2015 06:45 Go to previous messageGo to next message
Roachcoach
Messages: 1576
Registered: May 2010
Location: UK
Senior Member
Try gathering stats. That view is not maintained in real time.
Re: Values on NUM_ROWS of DBA_TABLE is appearing as null for 48 records [message #632589 is a reply to message #632587] Tue, 03 February 2015 06:53 Go to previous message
ashishkumarmahanta80
Messages: 231
Registered: October 2006
Location: kolkatta
Senior Member
Dear Roachcoach,

Thanks a lot !!!

After executing gather_stats, my problem got rectified.
SQL> SELECT  table_name, num_rows  FROM DBA_TABLES
  2  WHERE --owner ='INS' and
  3  table_name = 'GENMST_TAB_STATE';

TABLE_NAME                       NUM_ROWS
------------------------------ ----------
GENMST_TAB_STATE                       48


Regards,
Ashish Kumar Mahanta
Previous Topic: A hierarchical query problem
Next Topic: GET EXACT STRING MATCH
Goto Forum:
  


Current Time: Thu Apr 25 21:18:08 CDT 2024