Archive for the 'IT' Category

Oracle: How to create a good execution plan

Sometimes you simple need to know whether a statement is fast or not, or why it is slow. (Sadly, it seems like virtually nobody wants to know why a statement is fast, but that’s another story…)

Do not use EXPLAIN PLAN in such cases, it does not (can not) deal bind variables right. I’ve got  a simple script in my toolbox to create a real execution plan using bind variables, but avoid displaying all the lines the SQL returns. Just have a look, and use it if it’s suitable for your needs. Please keep in mind, that you need to set the binds the way I do, because the cost based optimizer handles bind statements entirely different (bind peeking, (adaptive) cursor sharing …)

This script was designed to run in Oracle SQL Developer very well, but it seems that version 2.1 has trouble with the LAST cursor, due to some changed output.
Read more…



Oracle 11g Adaptive Cursor Sharing does not work with PL/SQL?

Recently, there was trouble in the air. I migrated a database into 11g to enjoy adaptive cursor sharing, but it did not adapt cursors. In the trouble shooting process, I discovered the following:

Bug 8357294: ADAPTIVE CURSOR SHARING DOESN’T WORK FOR SQL FROM PL/SQL

Nice one. A short quotation from the bug text:

PL/SQL has famously enjoyed the so-called “soft-parse avoidance” optimization
for embedded SQL ever since its inception. Then, in 10.1, the benefit was
brough to native dynamic SQL, but only for “execute immediate”. Notice that
queries executed using a ref cursor (whether this is opened statically or
dynamically) do not enjoy the “soft-parse avoidance” optimization.

It seems that this was overlooked when adaptive cursor sharing was
introduced.

Summary: 11g PL/SQL does adaptive cursor sharing when we are using EXECUTE IMMEDIATE, but does not if you are using embedded SQL (for example in a(n implicit) cursor, like a for loop).
The bug says, that setting SESSION_CACHED_CURSORS=0 fixes this problem, but I will have to test it by myself to classify this information.

Regards
Usn



Talk about Database Technology Basics at Berufsschule Wiesau

Once again, I will talk about an IT topic at Vocational School (Berufsschule) Wiesau. This year, it’s Basics of Database Technology (Grundlagen der Datenbanktechnik) for 11th and 12th-graders, who will become certified IT specialists for software development soon. Their certification is called “Fachinformatiker der Fachrichtung Anwendungsentwicklung” in German.

The paper for the talk is available now: DB-Grundlagen.pdf

EDIT:
See the kind report about the day as well.

Best regards
Martin Klier



Oracle Technology Day Storage Optimisation – Impressions

In January, I’ve bee rather busy, so the blog was left alone. No sense in blogging just to blog.

Now some content. I attended the Oracle Technology Day – Storage Optimisation in Bonn, Germany. It was a nice event, lots of information, a bit commercials, excellent catering. But this is a technical blog, let’s talk abut Oracle technology.

One interesting information was the averages the first speaker, Mr. Gerd Schoen of Oracle, explained. They are mostly valid for OLAP systems, and I don’t claim they are absolutely true, but it was interesting to hear. I neither will comment them, nor discuss them. Just read what I heard.

Read more…



The usual end-of-the-year stuff, but honestly!

Before everyone diappears from The Net(tm) for Christmas:
Have a nice yule-tide, don’t eat too much of the feast, don’t drink and drive, and talk the RDBMS of your choice into operating itself for at least two or three days: You won’t miss the usual 6-in-the-morning phone calls on Christmas!

If you are lucky enough to have real holidays over the next days: A happy new year and let’s work on big red letters in January again! ;)

Yours
Martin Klier

PS: I hope you recognized: The usual omnipresent word starting with an X – it’s missing here. And, it hasn’t been too difficult. :)



Oracle 11g: Password expired, account locked – unwanted!

Hi,

it’s old news, but oracle 11g expires passwords after 180 days, and locks you out if you mistype your password 10 times, and most DBAs don’t like that. It’s unsecure, but for client-server-applications a locked account is no single-user-annoyance, it’s a downtime killing SLAs, nerves and – hopefully not – DBA jobs. So just make your DEFAULT user profile less secure:

select * from dba_profiles where resource_type='PASSWORD' \
  order by resource_name;
alter profile DEFAULT limit FAILED_LOGIN_ATTEMPTS UNLIMITED;
alter profile DEFAULT limit PASSWORD_LIFE_TIME UNLIMITED;
select * from dba_profiles where resource_type='PASSWORD' \
  order by resource_name;

Be careful
Usn



DOAG Konferenz 2009: Impressions Day 3 (final)

Thursday 19th was the last day of DOAG Confernce 2009. Compared with the second day, the program was much more dense: For my (DBA) profile there have been several hours, where more that one talk would have been appropriate.

This list is, what I collected during the day.

Read more…



DOAG Konferenz 2009: Impressions Day 2

As promised, today my impressions of yesterday (confusing, I know). Clarification: This is about Wednesday, November 18th. I’m still at DOAG Conference 2009 in Nuremberg. Wednesday was a silent day for my interests, especially at noon there have been less talks being of interest, but maybe they have done something for my general knowledge…

So once again, this are impressions, a digital copy of my scratchpad, unordered and without warranty. :)

For SQL Trace analysis:

  • let’s look at HOTSOS Profiler by Mr. Milsap, TRCANLZR (Oracle), TV$XTAT, ORASRP and MERTITS Profiler. For the latter, a limited free edition is available (without realtime V$ associations)
  • Review the Index usage when date/timestamp datatypes are used
  • 11g cursor close type (in a trace file) might enlighten something

Oracle on VM:

  • Oracle VM 2.2 uses XEN 3.4 core now
  • nice feature of Oracl VM: IO Priority (time slicing)
  • Oracle DB in an Oracle VM will have about 10% losses on CPU power
  • Oracle VM is limited to 60.000 IOPS :)
  • PVM with Direct Driver option is fastest
  • Activate Direct IO
  • Windows will be faster than on bare metal when running on Oracle VM, due to better IO scheduling

Read more…



DOAG Konferenz 2009: Impressions Day 1

These days, the DOAG Conference 2009 happens in Nuremberg, Germany. First day was yesterday, Tuesday November 11th 2009. This is a machine-readable copy of my scratchpad, coming from the different talks I attended.

  • Sun Oracle Database Machine Exadata 2: The “Quarter Rack” (consisting of 2 Servers and 3 storage nodes) sounds interesting.
  • 11gR2 has some features only available with Exadata: For example, a special “Storage Index”, grouping several lines with theit MIN and MAX values in order to minimize scan ranges (called Smart Scan)
  • Exadata provides inter-instance IO ressource management possibilities, it might be useful to look at the IO ressource management capabilities of 11g without Exadata as well!
  • Really interesting stuff was “Righttime Data Warehousing – reducing latency” of Sven Bosinger; his presentation and the paper will be great material to explain some stuff for conceptional discussions. Thanks, Sven!
  • Look at issues for your DB release version! Metalink Note 161818.1 is great for that!!
  • Flashback Data Archive may be a good tool for an archiving concept (Oracle sales tells us about Basel II and stuff), but have care!Firstly, DDL on tables prepared for FDA is slow, and secondly and worse, if you have tablespace quotas on your schema, the archiving might stop if it’s full. And that without error messages due to asynchronous archiving. Only way to monitor that is to scan for new trace files all the time. :(
  • The new Oracle Grid Infrastructure and its Instance Caging sounds interesting as well. Especially the CPU assignment with CPU_COUNT parameter sound nice, as well as CPU overcommitment (assigning more CPUs than you have).
  • Oracle OMotion and RAC One Node are other nice ones: But at the moment, RAC One Node is not available with Standard Edition!

At a glance: The first day was great, and absolutely interesting. Let’s see what Wednesday brings, the program looks promising so far.

Best regards from Nuremberg
Martin Klier



New My Oracle Support (ex. Metalink): Use without flash: HTML Option

In the last days, My Oracle Support was redesigned. But since flash is a performance eater and not always available, people like to have an option to use My Oracle Support (formerly Metalink) with HTML only.

The link to it is well-hidden, but nevertheless useful!

Give it a try: https://supporthtml.oracle.com

Best regards
Usn




You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.