Skip to Main Content
  • Questions
  • How to retrieve the record count of all the Views in Oracle ?

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, RUTHENDAR.

Asked: July 25, 2017 - 4:54 pm UTC

Last updated: July 26, 2017 - 12:37 am UTC

Version: 11.2.0.4

Viewed 10K+ times! This question is

You Asked

How to retrieve the record count of all the Views in Oracle ?

and Connor said...

Only by visiting each view. You could build something dynamically like:

SQL> select 'select count(*) from '||owner||'.'||view_name||';'
  2  from all_views;

'SELECTCOUNT(*)FROM'||OWNER||'.'||VIEW_NAME||';'
----------------------------------------------------------------------------
select count(*) from SYS.ALL_XML_SCHEMAS;
select count(*) from SYS.ALL_XML_SCHEMAS2;
select count(*) from SYS.V_$MAP_LIBRARY;
select count(*) from SYS.V_$MAP_FILE;
select count(*) from SYS.V_$MAP_FILE_EXTENT;
select count(*) from SYS.V_$MAP_ELEMENT;
...
...


with appropriate predicates to limit it to what you are after

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

APEX

Keep your APEX skills fresh by attending their regular Office Hours sessions.