Monday, October 24, 2011

UTF8 vs AL32UTF8

To be fair, I am one of reasonably few people who like Oracle documentation - you indeed can find there everything needed. But... Sometimes it will be either in the unexpected place, or not explicit enough, or not very clear at all. Here is an illustration of such case. 

The beginning of this story is pretty simple - Friday, around 4 p.m. People are already day-dreaming about their weekend plans. And suddenly our main development database starts to behave really funky. Our senior web-architect eventually called me to show that in one of the newly created modules the whole session just crushes with ORA-600 after the call to XML Parser (we've been building XML document manually as a CLOB and than converting it into XMLDocument). Alternative via XMLType.CreateXML completely froze the whole database... 

After about an hour of pretty painful debugging the problem was found - and not where we've been expecting. The exact match was found in Oracle's Database Companion CD installation Guide:
-----------------------------------------------
AL32UTF8 is the Oracle Database character set that is appropriate for XMLType data. It is equivalent to the IANA registered standard UTF-8 encoding, which supports all valid XML characters.

Do not confuse the Oracle Database database character set UTF8 (no hyphen) with the database character set AL32UTF8 or with character encoding UTF-8. Database character set UTF8 has been superseded by AL32UTF8. Do not use UTF8 for XML data. UTF8 supports only Unicode version 3.1 and earlier; it does not support all valid XML characters. AL32UTF8 has no such limitation.

Using database character set UTF8 for XML data could potentially cause a fatal error or affect security negatively.
-----------------------------------------------

"Fatal errors" indeed! We immediately switched from:
 <?xml version="1.0" encoding="UTF-8"?>
to
 <?xml version="1.0" encoding="AL32UTF8"?>

And our problem was solved! Friday, 5 pm... Perfect timing!

Sunday, October 9, 2011

Oracle OpenWorld 2011. Day 5

The closing day of the event started slowly. No wonder... Not that many people returned back to the hotel just after Sting concert (like I did) - the show went lo-o-o-o-ng way past midnight. Also, a lot of attendants had flights already on Thursday, so it was pretty common to see some of my old friends trying to reach a jet speed already in the hotel (running with their bags towards the cab stand :-) ).

My schedule was pretty simple:
- went to the talk about Edition-Based Redefinition from a couple of BankOfAmerica guys. We in Dulcian look at that feature for some years, so it was interesting to see what other people are doing in this area. Summary - it is a VERY powerful concept if you are starting a new project. But transforming existing one to be EBR-compliant is much more fun. Overall, I am planning to watch it closely, but still not sure whether I am ready to jump in the pool with unknown number of crocodiles.
- mine and Paul's last presentation "Achieving great performance for web-application by using only SQL and PL/SQL" got significantly more people than we ever hoped considering the last day of the conference. It seems like that the state of confusion, especially among small-to-medium size IT shops is huge. They do not have budgets/people to jump to the most recent bandwagons, but they still need to somehow support their end-users. After the presentation I've spent at least an hour more talking about the details of our FormSpider implementation - there was a lot of interest about this completely nontrivial way of building contemporary web applications.
- "It's the wrap" party at Yerba Buena - perfect sunny afternoon with "Blue Angels" flying above our heads. I didn't have any energy left even to talk to everybody. Picked up the book, and read for an hour or so.

That's all, folks... Now I need to digest everything I learned. It was a really great conference, so check this blog from time to time - I will be posting more focused stories! Stay in touch!

Thursday, October 6, 2011

Oracle OpenWorld 2011. Day 4

Sad day for the IT industry. There is not a lot of people who could think of something - and make the whole world change because of their ideas. So hard to lose such people so early...
Day 4. Oct 5 2011.
Finally, there was at least one day when I could just relax and wonder around between different presentations, demos etc. I think, I've spent it reasonably efficient:
- went to a couple of talks from Oracle tech leads (XMLDB and Database Vault). The first topic requires additional post, but here I will just mention briefly that Oracle finally started to change default behaviour of XMLType that I've been complaining for years:
    * in 11.2.0.3 XMLType will be created as Binary SecureFile storage mechanism with CACHE option automatically ON. That parameter was a performance issue for too many people - and not a lot of people know how to internally change it (if interested - read our article about LOB data types in the 3rd quarter of ODTUG  Tech Journal)
- spent couple hours at Oracle DemoGrounds(this time with SecureFile team, Java-in-the-database team, Oracle-on-Windows team). Got some useful information - sorry, also not for publishing :-)
- came to Larry's talk where he announced Oracle Cloud and Oracle Social Network... No comments on either of those topics, not my area of expertise.

Last part of the day - sure, you've guessed, PARTY! This time everybody was very worried about the possibility of storms, but we lucked out (storms are today...) The reason was pretty simple - STING! The guy just turned 60 years old, but I envied his level of energy on stage. It was unforgettable to be 20 meters from musicians (I came early enough) in the crowd of 10+ thousand people singing "Englishman in New York" with all accents existing on the planet Earth!

Wednesday, October 5, 2011

Oracle OpenWorld 2011. Days 2 and 3

This year my schedule here in SanFran is surprisingly busy. And not just because of social events :-) It is my 5th OpenWorld in a row - and for now it holds #1 spot for the technical content. Overall, from Oracle's side there is much less marketing people presenting their products / much more technical leads explaining what is going on under the hood. So, I apologize for a small gap in my story-telling and will try to catch up!

Day 2. Monday, Oct 3
For the first time in all of my conference years I decided to come to hands-on training. The topic was one of my favorites, Cost-Based-Optimizer, but still, I had some doubts about how well it could be illustrated as "hands-on". Big surprise - it worked out pretty seamlessly. Each problem case had a step-by-step analysis option and "do-it-yourself" option. Considering my limited experience with Oracle 11g (we only recently switched our main environment to 11.2.0.2 - so my performance tuning skills in that version are sub-optimal), I picked up a guided approach. Good for me - there was a lot of 11g-only concepts in the process (even so I correctly got one out of four tasks without any hints). Summary - learned a lot, need to spend more time with 11g.

Next presentation I came was done by people whom I know already for years - Bryn Llewellyn and Martin Buchi talked about modularization of PL/SQL code in large projects. That was definitely interesting for me, because looks like Martin's design patterns are very close to my "thick database approach".

After that talk I came to Paul Dorsey's "Building Systems in the Developing World" to provide DBA's support (if needed) for his primarily architectural talk. It was very educating to see how people coming from different backgrounds were reacting on our stories about building government systems in Ethiopia. A lot of confusion to be fair, and not a lot of understanding on real local problems...

As usual, final part of the day was much more optimistic! ODTUG had setup a cocktail party in a very nice French bistro.The combination of old friends+good vine+very creative snacks was well appreciated after so many hours wondering around the conference

Day 3. Tuesday, Oct 4
Yesterday was as busy as Monday. For the first time (thanks to Apress) I've been invited to Oracle Publisher's Seminar. An environment where you get a chance to communicate with such people as, for example, Andy Mendelsohn, was a completely new experience for me... It was a bit scary at the beginning, took me some time to relax a bit! Anyways, a lot of useful info (sorry, internal-usage-only :-) ).

After the seminar (around 2pm) I finally decided to wonder around the vendor hall. And as usual I got stuck at DemoGrounds... I just cannot miss the chance to harass developers/managers from Oracle with the problem I've found. And considering that usually I dig pretty deep, sometimes I surprise even Oracle specialists. This year my poor victims were two great guys developing DataPump engine - the game finished with 1:1 draw: they showed me a fix to one of my problems that I just missed in the documentation (next week I will have a post about it) / I showed them an issue with function-based indexes to be logged as an enhancement request. Jokes aside, such discussions for me is the most critical part of the OpenWorld at all. Thanks for the great job, people...

In the evening...Of course, yet another party! :-) This time one of the publishers was organizing a small meeting between authors/potential authors and their acquisition editors. A lot of insightful discussions about technical books. Definitely a well-spent time!

That's it folks, time to get back to the conference center! Hopefully, the weather today will be at least a bit better than forecast...

Monday, October 3, 2011

Oracle OpenWorld 2011. Day 1

As usual, for all government projects September is a pretty busy month (end of fiscal year), but nice thing about September - it always ends (plus/minus a week) with Oracle OpenWorld.

Even a lot of people complain that this conference became more and more marketing-oriented, for me it is a place to meet a lot of my old friends by Oracle community, get the "temperature" of the industry, talk to new people (there is always a ton of new faces from all over the world!). I even try not to submit abstracts for the next cycle of conferences (Collab, KScope) until I return from the OpenWorld - some of topics could just come up as a part of late-night discussion somewhere in the bar after N-th glass of beer. The key point - such topics will be 100% hit! Because if you remember something at that point - it usually means that it is really high in your priority queue :-) Anyways, for the next couple days I will try to post about my experiences here (sorry, not in the minute-by-minute structure!).

Day 1. Sunday, Oct 2.
Sunday is always a conference-in-the-conference, because this is the day when different user groups have a chance to organize its own symposiums. This year I participated in ODTUG Web Architecture Forum, playing a role of the person from the "other side of the wall" - my story was told from the point of view of a good DBA/Senior Database Developer that actively participates in the development of Web applications.

Of course, it was all about "thick database" approach, my favorite concept of pushing as much business logic into the database - and of course, a lot of people in the audience were not 100% comfortable with such extremes. But at least it made them thinking - which is always a good thing for you as a speaker. After my talk I've had about an hour-long conversation with a couple of developers from my native Ukraine - and I was really glad that their way of system development is reasonably close to my understanding, which means that my ideas are valid "in general", not only for the North America. :-) I would hate to sound "provincial" :-)

Another big part of the Forum was a talk of my guru Paul Dorsey about ways of building new Web-based system. The talk was very entertaining - but the summary was very grim... There is no coherency in the industry whatsoever! Take 10 system - get 12 architectures (not even 10!, sometimes architectures start to mutate inside of the life-cycle!). H-m-m... I more and more like my "thick database" approach!

But the evening ended up on the good note - a lot of thanks to Lilian Buziak for setting up an Oracle Ace Dinner (for me it was the very first one, since I got my Ace status only this summer). That was a perfect spot to talk with the "old-timers" (including my esteemed co-authors of "Expert PL/SQL Practices"). And food was great too :-)