Statistics Collection Enhancements on Oracle Database 12c

I’ve been having a play around with the enhancements to the statistics collection in 12c. I’ve put together this top-level post with links to all my other articles on this subject.

Here are the new articles it links to.

It also links to some of the stuff I put out previously for the Adaptive Query Optimization functionality, as that is statistics related.

In a totally unrelated incident, I wrote this thing about the new READ object privilege, but forgot to mention it on the blog.

The journey continues…

Cheers

Tim…

Riga Dev Day 2015 : The Journey Home

The morning didn’t start well. I woke up several times in the night feeling pretty bad. The combination of a cold, general lack of sleep and too much beer was not great. I don’t drink very often, so it doesn’t take much to make me feel bad. 🙂

I went down for breakfast with a few of the folks, then went back to bed and spent the next few hours switching between sleep and being sick. Luckily, everything seemed to calm down just before I had to get the taxi to the airport.

Check-in and security was quick and efficient. I found my departure gate, then got some food and a drink (non-alcoholic), which made me feel a lot better. The plane was pretty full, but was able to do a little work, which makes the journey much more bearable.

It was another fairly quick connection in Frankfurt, before getting on the plane home. I arrived at Birmingham airport in time for rush hour, which was not the best, but them’s the breaks…

The Riga Dev Day event was good fun. Riga is a really nice looking city and the people were friendly. As an English speaker, I had no problem at all from a communication perspective, which makes the whole process so much simpler and less stressful. 🙂

I mentioned in a previous post, the conference is a mixed discipline event, so you get to chat with a range of people from different backgrounds. I think it’s really important to break out of the bubble from time to time, so that you can get a feel for what the rest of the world is up to. For any of the other speakers reading this, you should give this Riga event a try. I think you’ll like it.

Thanks to the folks from LVOUG for inviting me to the event and making me feel welcome. Thanks to the attendees and speakers who I spoke to during the event. I hope to meet you all again! Big thanks for the Oracle ACE Program for getting me across to the event and allowing me to fly the flag.

Cheers

Tim…

Riga Dev Day 2015 : The Main Event

The event was held at a cinema in a shopping mall. We even got a free popcorn ticket. Awesome! I missed the starting keynote, which was a pity because everyone said it was really cool. So my day went as follows.

Krasimir Tsonev : Using Node.js for everything or what it is to write a book about it

I went to this session because I wanted to be with the “cool kids”. 🙂 I ended up chatting to Kasimir during lunch and in the evening. He’s from Bulgaria, so I was able to use my extensive Bulgarian vocabulary on him. 🙂 I’m never going to be one of the cool kids, but it’s good to get some context about different technologies. What is it? What does it do? What is it good at? What is it bad at? Where should I avoid it? It was good to get a feel for this from someone who is really using it, not just writing about it like it’s the Emperors new clothes.

Heli “Hell-Squirrel” Helskyaho : 9 use cases for Oracle SQL Developer Data Modeller

Back in the day we used to spend a lot of time on database design. I remember spending hours in Oracle Designer. Nowadays database design seems to have fallen by the wayside, which is a pity because good design is important if you want good performance and you want your application to stand the test of time. Adding in new functionality on top of a badly designed database is a nightmare. Extending a good design is usually much simpler.

In this session my daughter gave an overview of Oracle SQL Developer Data Modeller. For those familiar with Oracle Designer, there is enough similarity to give you a warm and fuzzy feeling. The session included 9 ways to use the tool, including importing from previous tools like Erwin and Oracle Developer.

Me : PL/SQL : Stop making the same performance mistakes

Next up was my PL/SQL performance session. I had some problems with the screen at the start, so I was just about to launch into a no-slides, no-demos version of the talk, then they realised my adapter was faulty and everything was working again. My bad! The talk went well and I managed to finish on time. A number of people had questions, which took me through the break and right up to the next session. Happy days. 🙂

Roel Hartman : The best of both worlds : Going hybrid with your mobile APEX Oracle Application

This session showed how to use Apache Cordova to create an APEX application that acts like a native app, allowing it to interact with information from the phone, such as contacts or compass etc. It’s a really neat solution to allow you to bridge the gap between mobile web apps and native apps, allowing you to stick with your preferred development tool, in this case APEX… I feel like a native developer now. 🙂

Robin Moffatt : No Silver Bullets – OBIEE Performance in the Real World

I’m not an OBIEE guy, but I wanted to see Robin present and I loved it. If Cary Millsap did a presentation on OBIEE performance, it would be pretty much like this session. Robin referenced Cary’s “Thinking Clearly About Performance” paper at the start of the session and that really set the scene. He’s a confident, no-nonsense presenter, which I really like. Well worth going to watch, even if OBIEE is not your thing, because the approach he speaks about it pretty much universal for identifying and fixing the actual problem, rather than relying on Voodoo.

Me : A Oracle DBA’s guide to WebLogic server

I was then up again for the last session of the track. This time it was my introductory WebLogic session. It really was the end of the day and I think everyone, including me felt like it. 🙂

The Evening

After the last session, we took a taxi back to the hotel to drop off our stuff, then headed out to the closing party at a bar in the old town. I had a couple of pints and watched the band, which I believe was made up of some of the techies from one of the local companies. I really enjoyed it! After the band came some comedians, which I didn’t really hear as I was standing at the other side of the room talking geek with Robin Moffatt. When the festivities were over we headed back to the hotel and sat in the bar chatting for a couple of hours, then it was off to bed.

It was a long day, but a really enjoyable one. The conference was great fun and all the people I interacted with were really enthusiastic! I’ll write some more about the event in my closing post.

Cheers

Tim…

Riga Dev Day 2015 : The Journey Begins

My first flight was 06:20, so I had to leave the house at 04:00, which meant getting up at about 03:00. Yuck!

The first flight was about 90 minutes from Birmingham to Frankfurt, with the smoothest landing I can ever remember in a plane the size of an A320. I was meant to have a 65 minute changeover before the flight from Frankfurt to Riga. A one hour changeover at Frankfurt is too short, but the alternative was to wait for about 6 hours. As soon as I got off the plane I did a quick march to the departure gate and arrived just as boarding was meant to start. The following plane was late getting in, so I got a 10 minute break before getting on the plane. The flight to Riga was pretty straight forward, taking a bit under 2 hours. Both planes had lots of empty seats, so I was able to get my laptop out and have a play.

At 16:00 we had a tour of the old town. It started with a quick bus tour and then we walked through some of the old town, with a tour guide telling us about a few of the key places. I really like the look of Riga. I took a few photos, which will be available here when I get to upload them.

From the tour, we went out to dinner, where we met up with some of the people who arrived too late to make the tour. This is a multi-discipline conference, so it was really cool speaking to people from different backgrounds, which helps you see how your pieces fit into the bigger picture…

From dinner it was back to the hotel and bed. It was a really long day, so I was desperate to get to bed. The conference starts tomorrow…

Cheers

Tim…

Riga Dev Day and Oracle Midlands Event #7

There are a couple of things on the radar for the coming week and unfortunately for me they are both on the same day.

In Birmingham, UK it is Oracle Midlands Event #7 (OM7) on Thursday 22nd of January. This will be the first Oracle Midlands event I’ve missed since it started. I’m a big fan of what Mike is doing with Oracle Midlands and I appreciate the sponsorship from Redgate that means it is a free event. Please remember to get off your post-Christmas asses and attend the event. It will only keep happening if you make the effort to turn up! So far the attendance and been good, but it only takes a couple of events with small numbers to let it fizzle out an die. Please keep showing your support!

On the same day it is Riga Dev Day 2015 in Latvia. It will be my first time in Latvia, so that will be fun. I think the daughter (Hell-Squirrel) has been before, so she’ll be able to look after me. 🙂

Cheers

Tim…

Cloud Control : 12.1.0.7 Plugin Patch

I applied some of the 12.1.0.7 plugin patches to our Cloud Control installation today. We already have Cloud Control 12.1.0.4 installed, so this was just a case of updating the plugins.

Here’s a quick overview of what I did.

  • Backup up everything! Database and file system.
  • Setup > Extensibility > Self Update
  • Download the latest versions of the plugins. The minimum you can really get away with is “Oracle Database 12.1.0.7”,  “Oracle Cloud Framework 12.1.0.2” and “Oracle Fusion Middleware 12.1.0.7”. The Cloud Framework plugin is a dependency for the FWM plugin. Obviously, grab the extra plugins if you need them…
  • Setup > Extensibility > Plugins
  • Do a “Deploy On > Management Server” for the plugins you’ve downloaded. These require OMS downtime, so you will be monitoring progress using “./emctl status oms -details” from the “$OMS_HOME/bin” directory.
  • Wait until it is all running again.
  • Do a “Deploy On > Management Agent” for the DB and FMW plugins on just the cloud control server. I wanted to know it was all fine on this server before pushing out the updates to the agents on the monitored hosts.
  • Convince yourself nothing weird is happening.
  • Do a “Deploy On > Management Agent” for the DB plugin on any monitored database severs. Where possible I did Dev environments in one pass. Test environments in a second pass, then Prod environments.
  • Do a “Deploy On > Management Agent” for the FMW plugin on any monitored WebLogic severs. Once again, Dev, Test, Prod.

The plugin deploys to the OMS are a bit slow, but the deploys to the agents are pretty quick. Numbers will vary depending on your kit.

I much prefer the plugin patches to the main Cloud Control OMS and Agent patches as we (the DBAs) don’t have root or sudo access on the servers, so when we do the full-on patches we end up swamping the sysadmins with requests to run “root.sh” scripts. We don’t have to do that for the plugin patches.

Cheers

Tim…

Flashback Data Archive Enhancements in Oracle Database 12c

Having played around with Flashback Data Archive in 11g, I figured I would get through the 12c enhancements pretty quickly. I didn’t account for the fact I’m a donkey and can’t see the wood for the trees. Luckily, I know some people who aren’t stupid and they gave me a nudge in the right direction, allowing me to spot my silly mistake. Thanks Bjoern and Connor! 🙂

So after lots of wasted time, here is the article.

For the most part, it’s an evolution, but the new bits are pretty darn cool. I guess a lot of people will focus on two main things:

  • It is now a free feature, provided you don’t use compression, available in all versions. The change to use no compression by default has been back-ported to 11.2.0.4, so it’s free there too, which is nice!
  • The contents of contexts can now be stored in the flashback archive, so you can have access to the USERENV and custom context values that were set in the session when the DML was processed. This makes it possible to replace all those crappy old audit triggers with FDA!

There’s some other stuff in there that’s kind-of nice too. I think it’s worth checking it out, especially at its new price. 🙂

Cheers

Tim…

 

Adaptive Query Optimization in Oracle Database 12c

Over the holiday period I finally decided to tackle the Adaptive Query Optimization stuff in Oracle 12c, which resulted in these articles.

Adaptive Query Optimization is really a collection of different features, hence the links page to bring them all together. Some of the features are just renamed and slightly modified versions of stuff from previous releases. Other bits are totally new. I’ve sat through a number of talks about this stuff over the last few years and the sound-bites make it seem quite obvious and straight forward. That’s because the individual pieces, for the most part, are quite straight forward. The trouble comes when they all start to interact, at which point things can get quite confusing. While I was doing the demos for the features, I had to chop and change quite a bit. Sometimes things didn’t happen when I thought they should. Other times things did happen when I thought they shouldn’t. I think much of it was down to my misunderstanding, but that just goes to show how tricky some of this can be… That’s without adaptive cursor sharing and SQL plan management thrown into the mix…

As I keep saying, these articles will probably get revised over time as I get a better understanding of this stuff. I have a feeling I won’t really get to grips with it until we are live on 12c for a number of projects and people start throwing real situations at me to investigate.

Cheers

Tim…

 

“a SQL” or “an SQL”?

This is an age old question and of course the answer depends on how you say “SQL”.

  • … a Structured Query Language statement…
  • … a Sequel statement…
  • … an Es Queue El statement… (I say it this way)

Different people say it different ways. Most of the time I don’t notice, but I just read something by another writer and kept seeing “a SQL …” and it was freaking me out. Then I realised I always write “an SQL …”, which reads “an sequel …” to some people, which sounds really stupid. 🙂

According to the Oracle docs it is sequel, so “a SQL …” is the correct way.

“SQL (pronounced sequel) is the set-based, high-level declarative computer language…”

The MySQL docs go the other route.

“The official way to pronounce MySQL is My Ess Que Ell (not my sequel), but we do not mind if you pronounce it as my sequel or in some other localized way.”

According to Wikipedia, it doesn’t matter either way.

“The original standard declared that the official pronunciation for “SQL” was an initialism: /ˈɛs kjuː ˈɛl/ (“es queue el”).[11] Regardless, many English-speaking database professionals (including Donald Chamberlin himself[37]) use the acronym-like pronunciation of /ˈskwəl/ (“sequel”),[38] mirroring the language’s pre-release development name of “SEQUEL”

If one of the designers can’t make his mind up, what hope to we have? 🙂

Anyway, when you are reading my stuff and you see “an SQL …” everywhere, it’s correct for the way I say SQL. 🙂

Cheers

Tim…

PS. All the other typos are just plain typos because I’m practically illiterate. 🙂

PPS. PL/SQL is a lot simpler as it is “a PL/SQL …” regardless of how you say it. 🙂

Update: The general consensus from comments, twitter and emails seems to be:

  • When you write it, it should be “a SQL …”, regardless of how you say it. Taking me back to school, Paul Steffensen said, “if it starts with a vowel it’s an, otherwise it’s a”. In my reply, I mentioned that “an Es Queue El …” does start with a vowel. 🙂 That being said, “a SQL …” goes with the basic written language, the sequel version and the full wording of the acronym, so it fits more of the cases.
  • If, like me, you say “Es Queue Ell”, you should probably say “an Es Queue Ell” when speaking, but still write it “a SQL …”
  • Andrew Taylor said, “just to be on the safe side I say *some* SQL.” Pure genius!
  • In many cases, you can probably reword the statement so the “a” is not necessary. This feels like a cop out, but it might be what I end up doing. 🙂