Solved

Generate table stats on External tables

Posted on 2013-12-10
4
392 Views
Last Modified: 2013-12-11
Can we generate table statistics on Oracle external table, please suggest.
0
Comment
Question by:d27m11y
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
JJSmith earned 250 total points
ID: 39710325
Following statement should work on external table SCOTT.EXT_TABLE :

DBMS_STATS.GATHER_TABLE_STATS (
Ownname           => 'SCOTT',
Tabname           => ‘EXT_TABLE’,
estimate_percent  => NULL,
degree      => 4);
0
 

Author Comment

by:d27m11y
ID: 39710356
Looking above, I understand that the syntax looks same as regular tables. May I know what exactly degree above means and why is it set to 4 ?

Thank you !
0
 
LVL 76

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 250 total points
ID: 39710406
To confirm the above generic syntax, the docs seem to imply it can be performed on an external table:
http://docs.oracle.com/cd/E11882_01/server.112/e25494/tables.htm#ADMIN12897

From the docs:
The ANALYZE statement is not supported for gathering statistics for external tables. Use the DBMS_STATS package instead.

>>May I know what exactly degree above means and why is it set to 4 ?
Again the online docs:
docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_stats.htm#ARPLS68583

degree  Degree of parallelism
0
 
LVL 6

Expert Comment

by:JJSmith
ID: 39712687
Simply put degree (of Parallelism) - will break down the stats queries into multiple processes which can be run concurrently depending, of course, on the fact that you have multiple CPUs/cores. You get your results quicker!

The import bit in the procedure call that I put up is that the estimate_percent is set to NULL if you have version 10.2; it's OK to use values if you have 9 or 11.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video shows how to recover a database from a user managed backup

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question