|
|
dbms_stats hint?
While tracking down an ora-1652 error today I noticed two very similar
statements that were running just prior to the error. They contained a
dbms_stats hint and looked something like the one below. What is the
dbms_stats hint and can I safely assume it was the stats job that
generated these statements? BTW these statements have blown up a 4g temp
tablespace a couple of times now. Why would dbms_stats need so much temp
space for an insert into what's probably a GTT? Any way to prevent this
seeing this is probably coming from an internal stats job?
insert /*+ append */ into sys.ora_temp_1_ds_1662 select /*+
no_parallel(t) no_parallel_index(t) dbms_stats cursor_sharing_exact
use_weak_name_resl dynamic_sampling(0) no_monitoring
*/"MESSAGELOBID","MESSAGEID","NETWORKORIGINALMESSAGE","KEYALIAS" from
"PROTECT"."MESSAGELOB" sample ( 18.6510224151) t
|
|
0
|
|
|
|
Reply
|
Chuck
|
1/25/2010 10:24:24 PM |
|
On Jan 25, 5:24=A0pm, Chuck <chuckh1958_nos...@gmail.com> wrote:
> While tracking down an ora-1652 error today I noticed two very similar
> statements that were running just prior to the error. They contained a
> dbms_stats hint and looked something like the one below. What is the
> dbms_stats hint and can I safely assume it was the stats job that
> generated these statements? BTW these statements have blown up a 4g temp
> tablespace a couple of times now. Why would dbms_stats need so much temp
> space for an insert into what's probably a GTT? Any way to prevent this
> seeing this is probably coming from an internal stats job?
>
> insert /*+ append */ into sys.ora_temp_1_ds_1662 select /*+
> no_parallel(t) no_parallel_index(t) dbms_stats cursor_sharing_exact
> use_weak_name_resl dynamic_sampling(0) no_monitoring
> */"MESSAGELOBID","MESSAGEID","NETWORKORIGINALMESSAGE","KEYALIAS" from
> "PROTECT"."MESSAGELOB" sample ( 18.6510224151) t
Back a few releases Oracle support had said that the analyze command
could take 4 times the table size to generate a full compute. What
dbms_stats options were in effect and how large was the table that
statistics were being generated for?
What other tasks that require temp tablespace were also running? This
specific SQL may not be responsible or at least not responsible by
itself.
You may wish to compare the allocated size of your temp tablespace to
the larger indexes and result set sizes you know your applications
will pull to be sure you do in fact have enough temp space allocated.
HTH -- Mark D Powell --
|
|
0
|
|
|
|
Reply
|
Mark
|
1/26/2010 7:31:35 PM
|
|
"Chuck" <chuckh1958_nospam@gmail.com> wrote in message
news:hjl5mq$qd9$1@news.eternal-september.org...
> While tracking down an ora-1652 error today I noticed two very similar
> statements that were running just prior to the error. They contained a
> dbms_stats hint and looked something like the one below. What is the
> dbms_stats hint and can I safely assume it was the stats job that
> generated these statements? BTW these statements have blown up a 4g temp
> tablespace a couple of times now. Why would dbms_stats need so much temp
> space for an insert into what's probably a GTT? Any way to prevent this
> seeing this is probably coming from an internal stats job?
>
> insert /*+ append */ into sys.ora_temp_1_ds_1662 select /*+
> no_parallel(t) no_parallel_index(t) dbms_stats cursor_sharing_exact
> use_weak_name_resl dynamic_sampling(0) no_monitoring
> */"MESSAGELOBID","MESSAGEID","NETWORKORIGINALMESSAGE","KEYALIAS" from
> "PROTECT"."MESSAGELOB" sample ( 18.6510224151) t
This statement does come from dbms_stats; it's part of the job
of gathering histograms on a table. Since each histogram requires
Oracle to run a complex analytic query, Oracle creates a copy of
the sample data - i.e.restricted to a subset of the rows and columns -
rather than running the analytic query against the full table for each
column.
In your case Oracle is using an 18.6% sample of the table, and plans
to collect histograms only on the four columns listed. So you could
work out (roughly) the size of the temporary table needed. (average
column length x num_rows + 12 x sample size for each column) plus
about 10%.
Once the temporary table is created, it's possible that the query with
the analytic function (with all its sorting) has a further large-scale
impact
on the temporary tablespace.
The dbms_stats hint isn't really a hint - it's just a label that the
developers
have put into the code to make it easier to identify the fact that the
statement was generated by dbms_stats.
--
Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
|
|
0
|
|
|
|
Reply
|
Jonathan
|
1/26/2010 7:59:48 PM
|
|
|
2 Replies
776 Views
(page loaded in 0.046 seconds)
Similiar Articles: INSERT /*+ append */ hint - comp.databases.oracle.server ...Hi, Oracle 10.2.0.4, Solaris We migrated to the database a code change where we decided to modify most inserts with an /*+ APPEND */ hint. We fou... comp.databases.oracle.server - page 12This is page 12 of the comp.databases.oracle.server group which contains 637 ... They contained a dbms_stats hint and looked something like the one below. FM7 Server cannot be administered any longer - comp.databases ...This would be fun to try in fm7 (think custom ... dbms_stats hint? - comp.databases.oracle.server use ... Uhm, user interaction in SW is no more complex than any ... Trouble-shooting performance issue in Solaris 10 ***Beginner ...If you don't know how to start EM (hint: "emctl start dbconsole") or use it (hint "http://oracle-host:5500/em") then you need the assistance of a DBA (someone who doesn't ... How to select 1 record from 1M records fast ? - comp.databases ...Hi all DB:Oracle 11g R2 Standard One x64 on Linux I created a table with ... from page 1 b) Look into the index and go to the page cited there Hint: If ... JDK 1.6.0_23 released - comp.lang.java.programmerFor hints on how to download it, see http://mindprod.com/jgloss/jdk.html ... into this problem, you can find a separate java DB installer at <http://www.oracle ... Problems with a Trigger - comp.databases.oracle.serverEnvironment: Oracle 10g2 Windows 32-bit, Standard Edition I have created a Trigger ... you chose is not appropriate here and even if it was, it's not used properly (hint ... Please help: Latest Sunfire v20Z bios, etc. - comp.unix.solaris ...SP, and drivers from sun/oracle because I need a service contract. I ... is free or open or beneficial to the world (that last one is a hint to stop using the Oracle DB ... resize LUN no file system yet - comp.unix.solarisI have resized it in SATABoy, but format still shows it as a 500MB disk device. I've tried devfsadm, but to no avail.. Any hints? Thanks! ..... We run Oracle 9iR2 ... SELECT... FOR UPDATE - comp.databases.mysqlINSERT /*+ append */ hint - comp.databases.oracle.server ..... where very large number of records is being inserted by INSERT AS SELECT ... hint locks table in exclusive ... Optimizer Hints5 Optimizer Hints. Optimizer hints can be used with SQL statements to alter execution plans. This chapter explains how to use hints to force various approaches. Oracle SQL hints - René Nyffenegger on OracleAll hints except /*+ rule */ cause the CBO to be used. Therefore, it is good practise to analyze the underlying tables if hints are used (or the query is ... 7/12/2012 4:48:19 PM
|
|
|
|
|
|
|
|
|