[closed] Commands to find count of tables and number of rows through command prompt in ORACLE database
meghana kaddu (21●10)
| asked Jan 18, 4:14 a.m.
closed Jan 18, 4:28 a.m. by Ralph Schoon (63.7k●3●36●48) 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
|