Search

Top 60 Oracle Blogs

Recent comments

Oracle

Start/Stop your Autonomous Databases

The ATLAS experiment in LEGO®

Here are two blog posts on the Databases at CERN blog:

How to gather Oracle optimizer statistics with minimal risks of regression

The ATLAS experiment control room

Here is, on the Databases at CERN blog, an example to lower to risks when you need to gather statistics in production:

  • use pending stats to be able to test them before publishing
  • be ready to restore old ones if a critical regression comes after publishing

The whole demo (I encourage you to follow the Databases at CERN blog):

https://db-blog.web.cern.ch/blog/franck-pachot/2018-09-optimizer-statistics-gathering-pending-and-history

Here is a summary of commands used, for an easy copy/paste:

Column Stats

A little while ago I added a postscript about gathering stats on a virtual column to a note I’d written five years ago and then updated with a reference to a problem on the Oracle database forum that complained that stats collection had taken much longer after the addition of a function-based index. The problem related to the fact that the function-based index was supported by a virtual column that used an instr() function on a CLOB (XML) column – and gathering stats on the virtual column meant applying the function to every CLOB in the table.

So my post-script, added about a month ago, suggested adding a preference (dbms_stats.set_table_prefs) to avoid gathering stats on that column. There’s a problem with this suggestion – it doesn’t work

POUG 2018

I just returned from a great Technical Oracle Conference hosted in Poland by my friends Kamil (@ora600pl) and Luiza (@LuizafromPoland)! They were kind enough to allow me to speak on the topics of SQL Translation Framework and Advanced Query Rewrite. It was my second year in a row to attend this conference and I must say I was extremely impressed by the content and the speakers and the venue and the professional handling of the logistics. Great job all around! I’d highly recommend this conference, so stay tuned for announcements on POUG 2019. Here’s a shot of the Enkitec guys that spoke at the conference: @phurley @JulianDontcheff @fritshoogland

Stats time

I wrote a note a couple of years ago explaining how I used to get a rough idea (with some errors) of how much time was spent in the overnight stats collection by each object. One of the nice little enhancements that appeared in 12c was the appearance of a couple of functions that can report information about this type of thing, and more. These are the dbms_stats function report_stats_operations() and report_single_stats_operation() with the following definitions:

Recursive queries on IM_DOMAIN$ at each cursor execution

At POUG 2018 conference I explained join methods by putting gdb breakpoints on the qer (Query Execution Rowsource) functions that are behind the execution plan operations. I was a bit annoyed by several calls when running a Hash Join because of recursive, internal queries on the dictionary. There are a lot of queries on the dictionary during hard parse, but this was at execution time on a query that had already been parsed before. This is new in 12.2 and seems to be related to In-Memory Global Dictionary Join Groups feature, the execution checking and setting up the Join Group aware Hash Join.

However, I must mention that even if this seems to be related with In-Memory I don’t have it enabled here:

Subquery Order

From time to time I’ve wanted to optimize a query by forcing Oracle to execute existence (or non-existence) subqueries in the correct order because I know which subquery will eliminate most data most efficiently, and it’s always a good idea to look for ways to eliminate early. I’ve only just discovered (which doing some tests on 18c) that Oracle 12.2.0.1 introduced the /*+ order_subq() */ hint that seems to be engineered to do exactly that.

Here’s a very simple (and completely artificial) demonstration of use.

ASM Filter Driver — simple test on filtering

Here is a simple test on ASM Filter Driver showing that when filtering is enabled the disks presented to ASM are protected from external writes.

On a 12.2 Grid Infrastructure installation I have my disks labeled with ASM Filter Driver (AFD):

Download your SR content from MOS

You may want to keep track of your Oracle Service Requests offline. Or simply be able to read them as simple text. Here is a simple way to download all of them to a simple text file.

First, it is easy to get a list of the Service Requests as an Excel file. Just list them on the GUI. You may choose:

  • The Support Identifiers (CSI) on the right
  • Only SR where you are primary contact or all of them, with the ‘person’ icon
  • Include closed SRs with the red check icon
  • The columns: View -> Columns -> Show all

And then View -> Export to XLS

The service_requests.xls is actually in XML format which is easy to parse, but you can also convert it to CSV. Here I have saved it to service_requests.csv

Then with AWK and LYNX installed here is how to get each SR into text:

COMMIT

By Franck Pachot

.
COMMIT is the SQL statement that ends a transaction, with two goals: persistence (changes are durable) and sharing (changes are visible to others). That’s a weird title and introduction for the 499th blog post I write on the dbi-services blog. 499 posts in nearly 5 years- roughly two blog posts per week. This activity was mainly motivated by the will to persist and share what I learn every day.