Continuing from the previous post, here is one more case when adjusting optimizer_index_cost_adj may hurt you.
drop table t1 cascade constraints purge; create table t1 (id, x, pad, constraint t1_pk primary key(id, x)) as select trunc(rownum/10) , mod(rownum, 10) , s1.text from all_source s1, all_source s2 where (more...)
Recent thread in the OakTable mailing list prompted me to create a poll and ask about the ways DBAs use system statistics in real systems. If you struggle to understand what system statistics is and what are the available options, here is the suggested reading:
Documentation – System Statistics
A hint is an instruction to the optimizer
a code that tells a computer to perform a particular operation
Which means Oracle CBO must obey the hints and must perform particular operation. The latter is hard to define correctly (more...)
Issues with OICA/OIC (OPTIMIZER_INDEX_COST_ADJ/OPTIMIZER_INDEX_CACHING) parameters have already been mentioned many times. Recently I’ve noticed one more and I think I didn’t see this case somewhere else on the Internet so I’ll share it.
Here’s a simple table T1 holding 1M rows with the indexed column X (more...)
Some time ago I had two questions about fixed objects statistics for which I couldn’t quickly find the answers. Questions are:
- how to gather fixed object stats for a given X$
- should I gather fixed objects stats on both RAC nodes
- why I can’t gather stats on some X$-tables
At the time of asking these question I’ve read CBO development team blog post on the topic, but still I was unable to answer them distinctly. Well, it appears the questions are simple and could probably be deduced after careful reading (first two questions for sure). The core phrase is:
On December 11th Tom Kyte performed “AskTom in Moscow” for the second time (first time was almost three years ago in February 2010). I was there and enjoyed presentations, tweeted a lot about the content and in the end I’ve won a signed copy of the Expert Oracle Database Architecture (2nd edition, in Russian)!
A glass for questions. It was full in the end of the day
Tom started with a bit of history of how Oracle developed its database. Old stuff, C compilers, 37kg disk drives followed by the modern, upcoming features in 12c. Pluggable Databases mostly (more...)
Lately I’ve been using SQL runtime execution statistics combined with SQL monitor for performance diagnostics and, honestly, almost forgot about SQL trace. So this note is not very useful to me but it might be to someone: along with ALL_EXECUTIONS option appeared in (I believe) 11gR2, there’s a new option starting with 126.96.36.199 which can significantly decrease amount of data in the trace files for STAT lines compared to ALL_EXECUTIONS, still providing some of them from time to time.
Here is a case to demonstrate:
declare n number := 0; begin dbms_session.session_trace_enable(true, true, 'all_executions'); for x (more...)
I have a permanent job at the NetCracker‘s System Performance group. Recently I was offered to do one day job outside, on-site in another company, which coincidentally has an office close to NetCracker’s Moscow office. It was an opportunity to apply my skills in a completely different situation which I couldn’t miss; plus I’ve never done public presentations before and this was a good occasion to practice that. Here I’d like to write down some notes how the event went.
2 or 3 weeks before the event I’ve got the list of topics to work on. It included several (more...)
Basically OP has a query with disjuncted (OR-ed) predicate which started to fail after 188.8.131.52 upgrade with ORA-01790: expression must have same datatype as corresponding expression. Here is a test case (I’ve renamed column and table names cause I’ve used to such naming):
drop table t1 cascade constraints purge; drop table t2 cascade constraints purge; create table t1 ( x int not null, y varchar2(13) (more...)
Flashback query allows to get data as of required point in time. It’s a nice feature. It’s strange in the implementation though. If you try to use AS OF SCN query with bind variables, it won’t help you to keep number of child cursors low: each execution (independently of the incoming SCN value) will cause a new child cursor to appear with FLASHBACK_CURSOR as the cause. I don’t understand why Oracle is doing it this way.
In the OakTable mailing list there was an idea that it could be due to some additional data stored alongside with the child cursor (more...)
I’ve just noticed that the new HTML MOS introduced a nice addition to the old ORA-600/ORA-7445 Error Look-up Tool: now there is a new ORA-600 Troubleshooting Tool (if the link is not opened automatically for you try refreshing the page with F5 – works for me in Chrome).
Within a few minutes it allows you to upload a generated trace file and then automatically redirects you to the search results based on the error reported in the trace. The tool should be useful to those who don’t know what to do with the trace. It also allows you to (more...)
Thanks to everyone for spreading the link and participating in the poll on statistics. As it was pointed out in the comments, the poll isn’t very specific, I know. My point was to get an idea how many people use the defaults (I considered Oracle version 11g) for stats collection, how many do a very simple and reasonable tweak to get more stable execution plans, and how many people prefer custom statistics management. Well, I think the results will not change much and here are as following (326 votes at the time of writing):
- 42% use the defaults (if (more...)
This is a short note on the topic of information exchange. I use OraNA.info to get up-to-date technology news. This is a blog aggregator I’ve tried first and have been using it since then, which is 3-4 years I guess. It’s great and I’d like to use this opportunity to say Thank You to Eddie Awad for a great blogs collection!
If you still don’t use blog aggregators and rely on your own blog collection in Google Reader or something else, then consider using one entry point instead of multiple, it’s much easier. Also I’d like to suggest using (more...)
Here is a poll prompted by today twitter talks on the default METHOD_OPT value (which is ‘for all columns size auto’ since 10g) and automatic statistics gathering job (auto-task since 11g). CBO development team suggests to use the default job to gather statistics with default options. Do you use the job exactly this way with real production databases? I’m very interested to see some numbers. Please share the poll link http://poll.fm/3n7pn so that more people vote. Thanks.
Filed under: Oracle Tagged: defaults, statistics
The post reminded me of my own fail happened several months ago.
I was in a performance testing project on a customer’s environment. It was RAC and included two DBs plus two standbys. In the process of testing it was necessary to rollback changes made to the databases during one test run. Flashback database was chosen as a way to do that. The approach was tested by DBAs and we’ve started working according to our plan. Unfortunately Flashback didn’t work out very well. Minor issues with available space in fast recovery area were solved, but more importantly the procedure took (more...)
I’ve a level 5 Statspack report from a real production 184.108.40.206 database with the following Top 5 Timed events section:
Top 5 Timed Events Avg %Total ~~~~~~~~~~~~~~~~~~ wait Call Event Waits Time (s) (ms) Time ----------------------------------------- ------------ ----------- ------ ------ log buffer space 28 1,396 49870 41.0 buffer busy waits 51 1,049 20567 30.8 CPU time 320 9.4 log file parallel write 4,011 159 40 4.7 log file sync 3,275 153 47 4.5
The complete report (without SQL and several other sections) is here. Can you explain what & why is wrong (more...)
If you you want to get an idea how some feature may be implemented by Oracle, then you ought to have a look for patents. Here are several examples I find quite interesting and containing valuable information:
- Method and apparatus for reapplying changes to a database – gives you an algorithm how Oracle optimizes recovery process
- Method and mechanism for efficient implementation of ordered records – another redo-related patent with the title hiding concept of multiple redo log buffers
- Method and mechanism for relational access of recovery logs in a database system – basically it’s describing LogMiner
- METHOD AND SYSTEM (more...)