Solution to get count(*) from Big tables quickly
Oracle Version: Either 10g OR 11gR2
Objective: Finding total count(number of records) in each table under any schema.
Avoiding: trying to avoid count(*) OR referring num_rows in dba_tables (even if stats in on)
Tools: Either exp OR expdp
(1) Is there any way I could generate an Oracle export log file with number of records per table (exactly like our normal export log) WITHOUT actually exporting data?
(2) Or is there any suggestion to retrieve total number of records [ count(*)] from big tables quickly?
Please Note: BTW, I am aware of ESTIMATE_ONLY, but that is not what I am looking for.
Other than having a PK or index on a "not null" column plus doing the count(*) in parallel... nothing I can think about.
Pablo (Paul) Berzukov
Author of Understanding Database Administration
available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
If you gather stats with full compute option, you can get number of records from the statistics view.
If you only want an estimate, and you keep stats on your schema,
i would look at num_rows in the dba_tables view.
Or you could try a ouija board...
this space intentionally left blank
Click Here to Expand Forum to Full Width