Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

[closed] Commands to find count of tables and number of rows through command prompt in ORACLE database

Hello,


Please help me out in understanding the below commands.

1. To compare the count of tables in the databases, I used the below command

SELECT COUNT(table_name) FROM DBA_TABLES WHERE OWNER IN ('CONFIG','RICALM','RIDW','RIODS');

I got 0 results as I do not have any schemas created in the names of 'CONFIG','RICALM','RIDW','RIODS'.

Is these schemas present by default?

2. Replacing the command with the DB tablespace USER such as 'RM_DB_USER' 'QM_DB_USER','CCM_DB_USER,'JTS_DB_USER I was able to fetch the total table count.

SELECT COUNT(table_name) FROM DBA_TABLES WHERE OWNER IN ('JTS_DB_USER','RM_DB_USER','QM_DB_USER','CCM_DB_USER');

Is it a right way to fetch the table_name count?

3. The result is consistently 0 for both schema and user, regardless of the specific commands employed.

SELECT OWNER || '.' || TABLE_NAME AS TableNameOracle, NUM_ROWS AS RowCountOracle FROM DBA_TABLES WHERE OWNER IN ('CONFIG','RICALM','RIDW','RIODS') ORDER BY RowCountOracle DESC;

SELECT OWNER || '.' || TABLE_NAME AS TableNameOracle, NUM_ROWS AS RowCountOracle FROM DBA_TABLES WHERE OWNER IN ('JTS_DB_USER','RM_DB_USER','QM_DB_USER','CCM_DB_USER') ORDER BY RowCountOracle DESC;


Regards,
Meghana


0 votes


The question has been closed for the following reason: "Question is off-topic or not relevant" by rschoon Jan 18 '24, 4:31 a.m.


One answer

Permanent link

 This is a forum about these products https://jazz.net/products it is only open to questions about oracle, if it is in the context of questions with respect to these products. Please find yourself an appropriate Oracle or SQL forum..

0 votes

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 7,505
× 1,335

Question asked: Jan 18 '24, 4:14 a.m.

Question was seen: 589 times

Last updated: Jan 18 '24, 4:31 a.m.

Confirmation Cancel Confirm