Tips for Optimizing Rails on Oracle
Just found a very nice article, Tips for Optimizing Rails on Oracle, on OTN (Oracle Technology Network). Definitely worth reading if you are working with Rails and Oracle:
In this article you dug a bit into how connections to an Oracle database are configured in a Rails application, and you have seen how the framework has been updated in the 1.2 release to have better performances thorough the use of the cursor_sharing and prefetch_rows parameters (while waiting for a real bind variable implementation).
You have also examined the Rails migration commands that are relevant to tuning the database (specially creating/removing indexes).
Finally, as you’ve learned, a good understanding of both how Rails builds the SQL from the code and how the database executes them is needed to get the best performance. The provided plugins should help here.
Single Sign-On virker… (in Danish)
Jeg ville egentligt selv have skrevet lidt om det “Proof-of-Concept” projekt jeg har arbejdet med her i starten af 2007, men Lars Roark fra Rødovre Kommune har allerede beskrevet det ganske glimrende på Version2: Single sign on virker! Nu skal det bare rulles ud…
I regi af borgerportalprojektet, har man derfor gennemført en “realistisk” afprøvning af SSO. Det vil sige at ITST har skåret ind til benet – og præcist formuleret hvilke dele af det store SAML 2.0 kompleks man vil anvende, og hvordan. ITST har også – til testen – stillet en service til rådighed på Internettet, en Identity Provider (IdP).
...
Det virker, men er ikke produktionsmodent. Store leverandører har “verdensklasse enterprise løsninger” – men har brug for “verdensklasse teknikerhjælp” til at sætte det op.
Som en del af projektet har vi testet integrationen mellem borger.dk (som Service Provider) og IT- og Telestyrelsens Identity Provider, og mine erfaringer er nogenlunde de samme som Lars’. Softwaren fremstår ikke helt produktionsmoden, men kan overtales til at virke – hvis man ellers kan komme igennem til de rette folk hos sin leverandør.
Nu ved jeg så en masse om Federated Identity, SAML og især Oracle Identify Federation – spørgsmålet er så hvornår jeg får brug for det igen, men spændende har det været og jeg håber at vi snart ser den rigtige IdP fra ITST.
Notes from RailsConf 2007
I’m tumbling my notes from RailsConf at railsconf07.productive.dk.
See you at RailsConf 2007!
Yay! Just bought my ticket for RailsConf 2007 today. Apparently tickets are going fast, so hurry up if you want to go.
I signed up for the conference and tutorials, so I’ll be in Portland from Wednesday evening through Sunday afternoon—probably missing the last keynotes since there doesn’t seem to be any flights back home later than 4 pm.
For a while I was planning on going to RailsConf Europe in Berlin instead, but after adding up the cost of going to Portland (conference fee, flights, hotel) I was surprised to find that it looks like it’ll be cheaper than last year trip to JAOO—which is just a 3 hour drive from where I live! But then JAOO prices are pretty steep.
Leave a comment or give me a call if you want to meet up in Portland.
Flyvende start for borger.dk (in Danish)
Danmarks nye borgerportal, borger.dk, har haft meget travlt i de to første uger:
borger.dk i luften (in Danish)
Det er altid rart at se resultatet af ens arbejde og især som freelancer, da man ofte er ude af døren og videre til en ny kunde, inden projektet går i produktion. Det var derfor med stor glæde (og en smule spændt) at jeg så borger.dk gå i luften d. 3. januar. Der var ikke det store postyr omkring premieren, men den blev da alligevel nævnt af bl.a. Computerworld, ComON, Ekstra Bladet, Berlingske og B.T.. Læs pressemeddelelsen hos IT- og Telestyrelsen.
Fra i dag har danskerne fået en ny portal som samler offentlige digitale tjenester og informationer på tværs af stat, region og kommune. Den nye internet-tjeneste Borger.dk erstatter de gamle portaler netborger.dk og danmark.dk, der samtidig lukkes. Borger.dk kan blandt andet bruges til at melde flytning, beregne sin efterløn eller finde oplysninger om sin nye kommune.
Computerworld sad (ikke overraskende) med fingeren på reload-knappen inden premieren, og nåede da også at fange en enkelt fejl eller to dagen før den officielle premiere. Taget i betragtning at borger.dk integrerer til bl.a. KMD, Krak og FOA, der alle havde travlt med at blive klar til kommunalreformen og arbejdede helt frem til 2/1, så synes jeg at premieren på borger.dk forløb smertefrit. Computerworld skrev (efter den rigtige premiere):
3.000 brugere første dag og 180.000 sidevisninger. Og frem for alt en problemfri premieredag. Det er status efter borger.dk i går officielt gik i luften.
Jeg har brugt en del af min tid på projektet med udvikling af integrationen til FOA, bl.a. visning af oplysninger om de 98 nye kommuner, der også integrerer med Krak og KMDs kommunefakta.
Update: 3.000 brugere og 180.000 sidevisninger lød ikke helt rigtigt – 60 sider pr. bruger er nok lige i overkanten. De rigtige tal er knap 30.000 brugere og 180.000 sidevisninger. Desuden hørte jeg at kunden er glad for løsningen – rigtigt glad endda.
In sqlplus heaven with gqlplus
I just found gqlplus today when looking for a way to enable command-line history in the SQL*Plus command that comes with Oracle’s Instant Client:
gqlplus is a drop-in replacement for sqlplus, an Oracle SQL client, for UNIX and UNIX-like platforms. The difference between gqlplus and sqlplus is command-line editing and history, plus table-name and column-name completion. As you know if you have used sqlplus, it is notoriously difficult to correct typing errors and other mistakes in your SQL statements. sqlplus does give you ability to use external editor to edit a statement, but only the last statement you typed. gqlplus solves this problem by providing the familiar command-line editing and history as in tcsh or bash shells, and table/column-name completion, while otherwise retaining compatibility with sqlplus.
To install on OS X, simply download, untar and do the usual configure/make ritual, with --disable-shared
passed to configure (see this page for details but note that it’s no longer necessary to patch gqlplus):
$ ./configure --disable-shared
$ make
and then move the binary to /usr/local/bin. You may want to pass -d
to gqlplus, to disable column-name completion, as it can take quite a while to load the meta data required, but otherwise gqlplus is truly a joy to use.
Update 2009-03-10:
If you want to substitute all calls to sqlplus with gqlplus, add an alias to your .profile (or .bash_profile):
alias sqlplus='gqlplus' # with auto-completion
alias sqlplus='gqlplus -d' # without auto-completion
On Macs and Viruses
Reading In Praise of the Zune? over at MacUser, the last paragraph really cracked me up:
That’s right, the Cult of Mac is advocating a product that Mac users can’t even use. I hear next week they’re doing a special on anti-virus apps. I hear that OS X version of Norton AntiVirus is really the pits. It never finds anything.
Oracle Bundle for TextMate, Preview
After reading The Pragmatic Programmer this summer, I’ve been trying to follow some of their tips, one of them being
Tip 22: Use a Single Editor Well
Choose an editor, know it thoroughly, and use it for all editing tasks.
My editor of choice is TextMate, one of the very first applications I bought for my Mac. I’ve been using it more and more lately, but unfortunately there’s no support for working with Oracle databases. The supplied SQL bundle works only with MySQL and Postgres, and Google wasn’t any help in finding a bundle specifically for Oracle.
After spending a few hours looking into what these TextMate bundles are, it turns out they’re very, very nifty and it’s not all that difficult to create your own. So, without tiring you with more chatter, I present my first TextMate bundle, the Oracle Bundle.
I could possibly have added Oracle functionality to the existing SQL bundle, but there didn’t seem to be a lot of overlap between MySQL/Postgres and Oracle in terms of the code implementing the bundles, so I decided to create a standalone bundle. So far, it’s only got a few basic features, but I’m hoping to add more as time allows for it. The syntax just piggybacks on the SQL syntax from the SQL bundle, and I haven’t added any support for PL/SQL.
This “preview” has the following commands:
Go ahead and grab your copy here.
Now Hosted at TextDrive
I finally got around to signing up for a Mixed Grill account at TextDrive, so I’ve begun moving my sites and mail-services over. Apart from a small hiccup in the account creation, everything has been working great at TextDrive so far.
This means that I can finally start posting here without worrying about incoming traffic making my residential DSL connection the electronic version of the dreaded M3 freeway here in Copenhagen.
First thing coming up within the next couple of days is a TextMate bundle for Oracle that I’ve been working on—but more on that later.