Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Count number of tables in Oracle

Like MySQL has "SHOW TABLES" , how do you count tables in Oracle DB. Little bit of research gave me this query:

select owner, count(*) from dba_tables

So like MySQL has a standard command, does Oracle have one?

like image 565
SuperMan Avatar asked Sep 09 '25 15:09

SuperMan


2 Answers

try:

SELECT COUNT(*) FROM USER_TABLES;

Well i dont have oracle on my machine, i run mysql (OP comment)

at the time of writing, this site was great for testing on a variety of database types.

like image 152
akf Avatar answered Sep 13 '25 15:09

akf


Yeah sure your query will work just modify it a little. Look here for refrence : http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_2105.htm#i1592091

Run this:

SELECT TABLE_NAME FROM DBA_TABLES;

to get list of tables.

and Run this:

SELECT Count(*) FROM DBA_TABLES;

to get the count of tables.

like image 23
Shekhar_Pro Avatar answered Sep 13 '25 17:09

Shekhar_Pro