Solved

Generate table stats on External tables

Posted on 2013-12-10
4
380 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.

Join & Write a Comment

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now