Home » SQL & PL/SQL » SQL & PL/SQL » About Oracle data dictionary view (Oracle Database 10g Enterprise Edition Release 10.1.0.2.0,windows environment)
About Oracle data dictionary view [message #293159] Fri, 11 January 2008 00:58 Go to next message
subhadip.chanda
Messages: 64
Registered: May 2007
Member
Hii,

I am using Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 version.
When I am quering for the number rows in a table using the simple statement :-

select count(*) from table_name;

It return the number of rows in that particular table.

But when I am going to query the same thing using the oracle data dictionary view user_tables I am getting some different results.For that purpose i used the query :-

select t.num_rows from user_tables t where t.table_name=upper('table_name');

Can one tell me why those two results are different?
Re: About Oracle data dictionary view [message #293162 is a reply to message #293159] Fri, 11 January 2008 01:01 Go to previous messageGo to next message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
num_rows column is filled when you gather statistics on the table. It is not a live number.

Regards
Michel
Re: About Oracle data dictionary view [message #293163 is a reply to message #293162] Fri, 11 January 2008 01:03 Go to previous messageGo to next message
subhadip.chanda
Messages: 64
Registered: May 2007
Member
How to gather statistics on a table,so that I can get the same result for those different queries?
Re: About Oracle data dictionary view [message #293167 is a reply to message #293163] Fri, 11 January 2008 01:17 Go to previous message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
By using the DBMS_STATS package.
Previous Topic: Data Logon trigger
Next Topic: to_num
Goto Forum:
  


Current Time: Fri Dec 09 04:14:03 CST 2016

Total time taken to generate the page: 0.08187 seconds