THE WORLD DISCUSSES #PYTHIAN ON TWITTER. HAVE A QUESTION? USE OUR HASHTAG AND ASK AWAY.

Deferrable constraints in Oracle 11gR2 may lead to logically corrupted data

I’ve hit a bug in Oracle 11.2.0.1 when working with deferrable constraints which I think is worth sharing as it may have profound consequences under certain scenarios.

Let’s start by creating a simple table with a deferrable primary key:

SQL> create table def_bug(n number primary key deferrable initially deferred);

Table created

SQL> insert into def_bug values (1);

1 row inserted

SQL> insert into def_bug values (2);

1 row inserted

SQL> commit;

Commit complete

You can confirm that the primary key constraint is working fine by trying to insert a duplicate value:

SQL> insert into def_bug values (1);

1 row inserted

SQL> commit;

commit

ORA-02091: transaction rolled back
ORA-00001: unique constraint (SRC.SYS_C004070) violated

So far so good. Open a second session and execute the following update:

SQL> update def_bug set n=3 where n=2;

1 row updated

Do not commit yet and execute in your first session:

SQL> update def_bug set n=3 where n<=2;

The above update will block due to our second session holding a lock on the row where n=2. Now commit your second session…

SQL> update def_bug set n=3 where n=2;

1 row updated

SQL> commit;

Commit complete

…and then commit your first session:

SQL> update def_bug set n=3 where n<=2;

1 row updated

SQL> commit;

Commit complete

Take a look at the data now:

SQL> select * from def_bug;

         N
----------
         3
         3

Ouch! This was certainly unexpected. You can confirm that the primary key is still working by trying to insert a duplicate value again:

SQL> insert into def_bug values (3);

1 row inserted

SQL> commit;

commit

ORA-02091: transaction rolled back
ORA-00001: unique constraint (SRC.SYS_C004070) violated

It certainly looks like the update statement did not take into account deferrable constraint declared on the table during restart caused by the write consistency mechanism.

Live RAC SIG Web-cast Today: Oracle ASM 11g — The Evolution

Just a quick announcements…

If you didn’t manage to attend my presentation, Oracle 11g ASM — The Evolution, during RMOUG or other conferences, you have a chance to see it online today. I’m doing it a web-cast at RAC SIG. It’s today, 4-Mar-10 at 12:00pm EST (9:00am PST).

Oracle ASM 11g — The Evolution (slides from RMOUG10)

Oracle ASM 11g Release 2 – The Evolution

Oracle Automatic Storage Management has proven to be one of the most widely adopted new features in Oracle Database 10g and it has been dramatically improved in the later 11g releases. This presentation will explain what changes are solved by ASM, how these challenges are solved, what barriers there are to ASM adoptions, and how 11g Release 2 addresses these barriers.

I shall say that the slides alone are not that helpful without my commentary but if you didn’t manage to attend it on one of the previous conferences, we will be releasing it as a webinar soon so stay tuned.

Oracle Streams Apply Process changes in 11GR2

A couple of weeks ago Christo Kutrovsky mentioned to me about Oracle Streams presentation he saw on this year’s UKOUG. The presentation was from CERN’s Eva Dafonte Pérez and, among over things, Eva mentions about substantial performance enhancements observed in 11GR2.

It is somewhat timely that we’ve been doing some Oracle Golden Gate testing which in turn made me curious to take a closer look at Oracle Streams in 11GR2 and see where all the performance is coming from.

I’ve setup a simple replication for table t1 from schema src to schema dst, changed Apply Server parallelism to 1 and did a simple test with inserting 100 rows while performing a sql trace:
Read the rest of this entry . . .

UKOUG Conference Tech & EBS 2009 — The Place to Be!

Yes, it’s almost that time of the year when one of the best Oracle conferences in the world opens its doors to attendees in Birmingham — UKOUG Conference 2009: Technology & E-Business Suite. The lineup of speakers will be fantastic as usual and agenda is full of juicy bits — You will have usual troubles scheduling sessions to attend and hate to make compromises between presentations you want to see badly but that’s kind of problems you’d rather have at a good conference.

The past year was very eventful so I feel like I haven’t been at the UKOUG Conferences for years even though I did come to the UKOUG Conference 2008. This conference is something special for me — it’s the first conference I attended and presented on so it’s set the tone for the whole conferencing experience of my life and I’m very grateful for that! So far, I haven’t missed a single year since my first UKOUG conference and I hope I keep it this way for years to come.
Read the rest of this entry . . .

Setting up Network ACLs in Oracle 11g… For Dummies

Having recently performed a test upgrade for a client from Oracle RDBMS 10g to 11g, I can tell you that one of the big changes that will likely require action on your part as DBA is the new fine-grained access control for the packages UTL_SMTP, UTL_TCP, UTL_MAIL, UTL_HTTP and UTL_INADDR. Part of the Oracle 11g pre-upgrade tool will notify you of users that will require new privileges.

Of course, Oracle’s post-upgrade network ACL setup documentation is much more confusing than it needs to be, at least for simple minds like me. A colleague stepped forward with a simple set of commands for a basic setup that even the tired and stressed can understand.

I’ll share that here, with some basic explanation:

Read the rest of this entry . . .

Alex Gorbachev at ACTOUG Developer and DBA Seminar Day, 23 July 2009

I’ll be in Canberra next week presenting at the ACT Oracle User Group Developer and DBA Seminar Day on Thursday, 23 July 2009. If you are in Australian capital city, I’d be very much looking forward to see you there!

The topic I will be presenting is 11g New Features Out of the Box. I presented it few times already but originally, it’s based on Christo Kutrovsky’s presentation from Oracle Open World 2007. Unlike many presentations on 11g new features, this session will be focused on the enhancements that often go unnoticed and not marketed widely but boost DBA productivity and are available out of the box without much implementations efforts.

I’m most likely coming in Canberra the day before and will do some sightseeing with my family so all suggestions are welcome. That reminds me… Need to book the hotel!

Pythian Video: Oracle RAC — VIP Configuration Mistakes

The first videocast was quite popular — it has more than 300 views in couple weeks and considering no Hollywood stars were starring in that video and there were no nude scenes, I think it’s fair to say that this format was very much welcomed by the audience.

Today, I’m posting the follow up session on VIP’s (Virtual IP’s) with Oracle RAC. What I demonstrate today is a typical configuration mistake for a RAC databases created with Database Configuration Assistant (DBCA) and what’s the result of such omission.

It’s actually logged as a bug 4338578 on Metalink (thanks to Marcin Przepiorowski for reference). However, I believe it’s not a database issue but (1) misunderstanding how remote listener registration works, (2) documentation bug and (3) DBCA bug.

The init.ora parameter remote_listener defines the list of remote listeners that an instance should register with. The parameter local_listener sets the address for the local listener registration and if not specified, by default it’s hostname and the default port 1521. However, it turns out that the local_listener parameter is used not only for local registration but for something else as well…
Read the rest of this entry . . .

Sydney Oracle Meetup #5 Report: Oracle 11g New Features Out-of-the-Box

Sydney Oracle Meetup LogoI think it was the smallest group so far which is not surprising considering that Monday has been the least popular day in our internal poll. We had a tad less than 20 people but very good size for the informal discussion of Oracle 11g adoption that took place at the second half of the meetup.

Turned out that there are very few people running 11g in production. Besides us at Pythian with number of clients on 11g, we’ve had only couple people I think including Carl Young from Metcash. Carl shared their experience of running a multi-terabyte data-warehouse on Oracle 11g and how the migration happened. Thanks a lot Carl for your insights!

If you haven’t seen the case study from Oracle about this migration — see what benefits Metcash had with 11g migration. I myself took note of few areas — Query Cache helped a lot on dimension tables lookups and some popular reports, Materialized Views invalidation problems reduced, CBO becomes smarter.

Some of the things to pay attention to in 11g — Oracle Warehouse Builder 11g (11.1.0.6) has actually less features than the latest OWB 10g release. If you look at 11.1.0.7’s list of bugs fixed (Metalink Note 601739.1), you would see a few dozen bugs on “Wrong Results” Read the rest of this entry . . .

Pythian Video: Oracle RAC — Why VIPs?

“Seeing it once is better than hearing about it a thousand times” — I think this is the closest translation from one Russian proverb. I may add that hearing and seeing might be often better then reading so let me try to start a series of small videocasts about Oracle database technology.

One of the topics that beginners RAC DBA’s (along with network engineers supporting Oracle database infrastructure) are confused about is the Virtual IP usage in Oracle RAC starting from Oracle Clusterware 10g.

With this videocast, I will try to clarify those concerns once and for all. I have embedded the video here in a smaller window so you might want to go directly to YouTube for the full-size version of “Pythian Video: Oracle RAC – Why VIPs“.

This is an experiment for now so let’s see how it goes. Let me know if you find this format useful and don’t forger to rate it on YouTube. Note that if you don’t leave any comments here, I’d never know whether you liked it or not so don’t be shy and comment away…

Start NowWith Pythian - database design, management and emergency handling capabilities...

Live Updates

pythian: RT @sheeri: #confoo talk "Bending Queries to your Will with EXPLAIN" slides http://bit.ly/explainslides & handout
more



Testimonials

  • Serge Racine

    DBA, Brookfield Energy

    We are very satisfied by the service given to us by Andre and Shakir in support of our recent data quality and reorganization initiative.... more