Strategies for Minimising SQL Execution Plan Instability

Execution Plan Instability – What is the problem?

The Oracle Optimizer is a complex piece of software and with every release it becomes more complex.


In the beginning, the Optimizer was rule-based.

The Optimizer had a ranked list of heuristics used to optimize a query, picking the lowest ranked rule available.

This rule-based mode, whilst still in use with some internal Oracle dictionary queries, has been unsupported since version 10.1.

This means that (more...)

Viewing Models Details for Decision Trees using SQL

When you are working with and developing Decision Trees by far the easiest way to visualise these is by using the Oracle Data Miner (ODMr) tool that is part of SQL Developer.
Developing your Decision Tree models using the ODMr allows you to explore the decision tree produced, to drill in on each of the nodes of the tree and to see all the statistics etc that relate to each node and branch of the (more...)

Oracle Database 12c Interactive Quick Reference

You may remember days when you had huge Oracle posters on your cubicle wall that listed the various data dictionary views, or the underlying Oracle architecture.  Maybe you still have them.  For the 12c version of the database Oracle provides the Oracle Database 12c: Interactive Quick Reference.
The Quick Reference provides information on:

  • DBA Views
  • Performance Views
  • Architecture Views
  • Database Architecture
  • Multitenant Architecture
  • Background Processes

As part of the Quick Reference there are Architecture .pdfs (more...)

Changing REVERSE Transformations in Oracle Data Miner

In my previous blog post I showed you how you can have a look at the transformations that the Automatic Data Preparation (ADP) feature of Oracle Data Mining produces. I also gave some example of the different types of ADF that are performed for different algorithms.

One of the features of the transformations produced is that it will generate a REVERSE_EXPRESSION. This will take the scored results and apply the inverse of the transformation that (more...)

ODM : View Transformations generated by Automatic Data Prepreparation

A very powerful feature of Oracle Data Mining and one that I think does not get enough notice is called Automatic Data Preparation.

Data Preparation is one of the most time consuming, repetitive and boring parts of the work that a Data Miner or Data Scientist performs as part of their daily tasks. Apart from gathering the data, integrating the data, getting the data into the required formation the most interesting part of the work (more...)

Access Denied when logging in to OSB 12c console

The Oracle SOA Suite 12c quick start is an excellent way to get started with all the new features of 12c. I imagine it must be frustrating when you log in to http://localhost:7101/servicebus and are confronted with an 401 – Access Denied error message. Rest assured, there is nothing wrong with your credential configuration. The cause is likely much more simple; you use the wrong Java version.

Although the certification matrix for FMW 12.1. (more...)

Showing Interval Partitons Code in DBMS_METADATA.GET_DDL

-- If you want to display the system generated partitions as part of the CREATE TABLE DDL, then set the EXPORT parameter of the dbms_metadata to true.

-- The default behavior of "DBMS_METADATA.GET_DDL" is that it does not show Interval Partitions created by the system for interval partitioned tables and indexes.

-- In the case of Interval Partitioning, New Partitions are created automatically when corresponding row is inserted.  This newly created partition information (more...)

12c: Little test of “TABLE ACCESS INMEMORY FULL” with count stopkey

The table has 9M rows:

SQL> with function f return int is
  2       begin
  3          for r in (select value from v$mystat natural join v$statname where name like 'IM scan rows') loop
  4             dbms_output.put_line(r.value);
  5             return r.value;
  6          end loop;
  7       end;
  8  select f() from t_inmemory where rownum<=1
  9  ;
 10  /


1 row selected.

SQL> /


1 row selected.

SQL> /



Setting up Oracle Stream Explorer 12.1.3

Oracle Stream Explorer is available now for download. For those unfamiliar with the product, it is a new tool based on Oracle Event Processing (OEP, formerly known as Complex Event Processing). It’s a graphical interface on OEP, hiding the rather daunting CQL (Continuous Query Language) from the user.

Installation is pretty straightforward. You start with installation of OEP 12.1.3.

Mind you that OEP is installed in (more...)

Changes in JDeveloper 12c BPM simulations

While creating a BPM project simulation in the JDeveloper 12c IDE, I noticed some differences in behavior as opposed to 11g. Although the functionality is mostly unchanged, the UI is different. Most of them are more intuitive, but you might want to check them out and save some time.

  1. Simulations are not always listed by default in the BPM project navigator. You can add them by right-clicking on the project, select New … | From (more...)

Non-CDB Architecture Is Officially Deprecated….

Yeah, it’s indeed true and official. So if you still haven’t started reading and learning Multitenant architecture introduced in and enhanced in, it’s high time that you start doing it. Not because that it’s new but because the old architecture you are familiar with, it’s officially on the verge of extinction.

LGWR terminating instance due to error 338

Recently we came across a issue where our DB crashed with ORA-00338 error . Errors in file /oracle/diag/rdbms/orcl11g/orc11g/trace/orc11g_lgwr_24118.trc: ORA-00338: log 2 of thread 1 is more recent than control file ORA-00312: online log 2 thread 1: '/oracle/oradata/orcl11g/redo02.log' LGWR (ospid: 24118): terminating the instance due to error 338 DB couldn't be restarted as it gave same errors…

Oracle 12c Implicit Result Sets in SQL Developer 4.1

Ever want to run a Stored Procedure or a PL/SQL anonymous block and just want to "print out" the results of a query ?  Even as a little bit of debug information?

In Oracle 11g you have to create a SQL*Plus REFCURSOR variable and then bind it within the anonymous block  or  pass it as an argument to a procedure/function. Run the code and then print the refcursor.

This requires a bit of know how in (more...)

Is Oracle Database Time Correct? Something Is Not Quite Right.

Is Oracle Database Time Correct? Something Is Not Quite Right.

Oracle Database tuning and performance analysis is usually based on time. As I blogged HERE, the Oracle "database time" statistic is more interesting than simply "time spent in the database." It is the sum of CPU consumption and non-idle wait time. And Elapsed Time is the sum of all the database time related to perhaps a session or a SQL statement execution. However...

Oracle Bundle Patching

I’ve spent a few days playing with patching with the so called “Database Patch for Engineered Systems and Database In-Memory”. Lets skip over why these not necessarily related feature sets should be bundled together into effectively a Bundle Patch.

First I was testing going from to BP2 or Then as soon as I’d done that of course BP3 was released.

So (more...)

ECO 2014 Slides

Just a quick note that I posted slides for the 2 talks I did at ECO in Raleigh this week:

Keynote: Creative Problem Solving (for Oracle Systems)

In-Memory In Action (without Tanel Poder) :)

Great crowd. I really enjoyed myself.

Note: You can also find other presentations on my Whitepapers/Presentations page via the link at the top of the screen.

Interesting Oracle Syntax Error

As shared by a well known Oracle and Big Data performance geek!

SQL> ALTER SYSTEM SET inmemory_size = 5T SCOPE=spfile;
ALTER SYSTEM SET inmemory_size = 5T SCOPE=spfile
ERROR at line 1:
ORA-32005: error while parsing size specification [5T]

SQL> ALTER SYSTEM SET inmemory_size = 5120G SCOPE=spfile;

System altered.


12c Upgrade and Concurrent Stats Gathering

I was upgrading an Exadata test database from to and I came across a failure scenario I had not encountered before. I’ve upgraded a few databases to both and for test purposes, but this was the first one I’d done on Exadata. And the first time I’d encountered such a failure.

I started the upgrade after checking with the (more...)

12c In-Memory on RAC

I started looking into In-Memory on RAC this week. Data can be distributed across RAC nodes in a couple of different ways. The default is to spread it across the available nodes in the cluster. So if you had a 2 node cluster, roughly 50% of the data in your table or partition would be loaded into the column store in each of the 2 instances.

SYS@dw1> alter table kso.skew inmemory;

12c In-Memory in PDB

In preparation for our upcoming 12c In-Memory Webcast @CaryMillsap, @TanelPoder, and I solicited questions from members of the universe at large on the interweb. We got a question about how In-Memory works with the 12c multi-tentant option and it got me thinking so I gave a quick try. As it turns out, it works about as you would expect. The basic idea is to turn it on for the container DB (which is where the (more...)