Mailing List
Home
Forum Home
Oracle List - by freelists.org
Oracle on SUSE Linux - Runing Oracle on SUSE Linux
Oracle database error code ...
www.freelists.org
Subjects
ORA 12540: TNS:internal limit restriction exceeded
ORA 12838 please : Is possible to append two times to the same table befo
ORA 12838 please : Is possible to append two times to the same table before
ora 04031
ora 12500 on windows
ORA 32004: obsolete and/or deprecated parameter(s) specified
ORA 01925: maximum of 30 enabled roles exceeded
ORA 01925: maximum of 30 enabled roles exceeded
ora 12500 on windows
ORA 01650, one idea
ORA 01650
ORA 4030
ORA 12838 please : Is possible to append two times to thesametable before do
ORA 12838 please : Is possible to append two times to thesame table before d
ORA 01536
ORA 03113 end of file on communication channel
ORA 32004: obsolete and/or deprecated parameter(s) specified
ORA 00600:
ORA 00020: maximum number of processes (%s) exceeded
ORA 01925: maximum of 30 enabled roles exceeded
ORA 3113 while creating a cluster database 9201 RAC on Linux with OCFS
ora 12500 on windows
ora 12500 on windows
ora 12500 on windows
ORA 01650, one idea
ora 12500 on windows
ora 12500 on windows
ora 12500 on windows
ORA 2000 Error Using DBMS STATS GATHER SCHEMA STATS
ORA 01650, one idea
ORA 01650, one idea
ORA 01650, one idea
ORA 01650
ORA 01650
Subject: ora 01031
ORA 4030
ORA 4030
ORA 06502: PL/SQL: numeric or value error: Bulk Bind: Truncated Bind
Subject: Re: ORA 01722 invalid number
 
Subject: RE: Very Strange Query Access Plan

Subject: RE: Very Strange Query Access Plan

2007-10-04       - By -not available-

 Back
John,

We were gathering stats with no "METHOD_OPT" option.  And according to
an Oracle SR, the calculation for density is *not* 1/NDV, but:
DENSITY = SUM(1..NDV)(nocc^2)/(T^2)
where T is the number of elements sampled, adjusted like nocc
(i.e. values that span histogram buckets are removed).
basically, for each distinct value (i.e. NDV) we count the number of
occurences of that value (the nocc value) tossing any value that spans
a histogram bucket."

The SR Tech said that the simpler calculation "is a rough approximation
of the formula above."

Funny thing - I tested several scenarios and the first calculation seems
to hold.

He suggested trying histograms with a various number of buckets and
testing the result, taking a 10046 trace to see what is happening.  If I
am not satisfied with my results, to submit a (possible) bug report.

The skew of the data in this table is the real problem.

18,000,000 rows.
Ssn column:

1,289,561 rows with a value of "undefined"
3,656,617 rows with a value of null
625,018 distinct values.

So 4.8 million rows of bad data.

Now, try and find a time to test this without killing my users!

Tom


-- --Original Message-- --
From: John Kanagaraj [mailto:john.kanagaraj@(protected)]
Sent: Thursday, October 04, 2007 12:42 AM
To: Mercadante, Thomas F (LABOR)
Cc: oracle-l@(protected)
Subject: Re: Very Strange Query Access Plan

Tom,

> Thanks to Alvaro Jose Fernandez & Ric Van Dyke, this is solved.  The
DENSITY
> and CLUSTER FACTOR values in the user_tab_columns for my database
table had
> bad values.  These values are calculated by the DBMS_STATS package.  I
> manually set these to a much lower figure and my problem went away.

Keep in mind that collecting histograms on a column can affect the
DENSITY. i.e. when a histogram exists, DENSITY != 1/NDV and that can
cause lots of issues. I think the whole thing is explained in a paper
by Wolfgang (or Alberto or Jonathan - I forgot who!)

In this case, I am guessing that this occurred because you collected
stats using DBMS_STATS with the METHOD_OPT=>'FOR ALL INDEXED COLUMNS
SIZE SKEWONLY' option, and the sample suddenly showed that there was a
skew? (Guessing with apologies to the BAAG party!)

> I'm still trying to determine what my next steps are.  One definite
step is
> to stop gathering stats for awhile!

As per Dave Ensor as quoted by Wolfgang, "It is only safe to gather
statistics when to do so will make no difference". It is however,
difficult to NOT gather stats. The safest is to backup existing stats
before gathering them, and that is something 10g does automatically.

--
John Kanagaraj <><
DB Soft Inc
http://www.linkedin.com/in/johnkanagaraj
http://jkanagaraj.wordpress.com (Sorry - not an Oracle blog!)
** The opinions and facts contained in this message are entirely mine
and do not reflect those of my employer or customers **


--
http://www.freelists.org/webpage/oracle-l