Home » RDBMS Server » Performance Tuning » table and its count
table and its count [message #229179] Thu, 05 April 2007 14:10 Go to next message
ozzy80
Messages: 55
Registered: June 2005
Member
Hello,

Is there a table or view that can give me the list of all the tables in a schema and their counts, respectivily.

It wouldn't be possible to write a SQL on USER_TABLES or something and pass the table name as the variable, would it?

Thanks
Re: table and its count [message #229180 is a reply to message #229179] Thu, 05 April 2007 14:15 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Check user_tables.num_rows.
Be advised that, these values are not always correct and
* will be populated only after collecting stats
* may be outdated.
* anyone with proper access can set explicit values using SET_TABLE_STATS.

Search the forum for more information

[Updated on: Thu, 05 April 2007 14:17]

Report message to a moderator

Re: table and its count [message #229181 is a reply to message #229179] Thu, 05 April 2007 14:17 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Is this what you want?
SQL> var tab varchar2(100);
SQL> exec :tab := 'TEST';

PL/SQL procedure successfully completed.

SQL> select table_name, num_rows from user_tables where table_name = :tab;
TABLE_NAME                       NUM_ROWS
------------------------------ ----------
TEST                                   11

1 row selected.

Regards
Michel
Re: table and its count [message #229183 is a reply to message #229180] Thu, 05 April 2007 14:23 Go to previous message
ozzy80
Messages: 55
Registered: June 2005
Member
Thanks. That helps!
Previous Topic: Partitioning a table- "newbie" help
Next Topic: All v$session_event numbers don't add to total time
Goto Forum:
  


Current Time: Wed Nov 27 01:31:41 CST 2024