I got a new ( and possibly new-fangled) phone recently.
Having spent a suitably geeky amount of time exploring the new features of this slab of Android lovliness I did come across something which left me quite stumped… somebody rang me up on it.
Increasingly frantic tapping of the little green phone icon failed to result in me answering the call.
It was at this point that Deb took pity and explained in that ever-so-patient way people use to the hard of thinking, that I simply needed to swipe.
Needless to say, she’s not ever mentioned the incident again and would never dream of taking any opportunity to bring it up to elicit a laugh at my expense. Ahem.
It’s unfortunate that I also got a work phone recently and spent five minutes tapping the screen before I worked out that the Blackberry I was holding was not, in fact, a touch-screen device.
As the fast-paced world of consumer electronics passes by in an ever-increasing blur, I’m comforted by the fact that I can still learn something new.
For example, I was recently faced with a situation requiring me to load data from one table into two further tables, depending on certain criteria.
With the aid of my trusty netbook ( a form-factor that is apparently as outdated as it’s owner), I shall now demonstrate the wonder of the age that is the multi-table insert statement.
Continue reading
Category Archives: SQL
ORA-02030 and invisible objects. The database bites back !
Being Luis Suarez’s agent must be an interesting job right now.
Maybe the man was a bit peckish.
Alternatively, maybe he’s resigned to the FA’s reluctance to introduce a mid-season break and was simply making his own arrangements for time off during the season.
Either way, this particular agent may well be trying to sign Luis up for an ad campaign for a popular brand of toothpaste.
Oracle DBA’s may sometimes have some sympathy with Suarez, although they’re more likely to end up chewing the desk in frustration, rather than their fellow DBA’s (unless the Christmas Party has really gotten out of hand).
Every so often, Oracle throws out an error that, on the face of it, makes absolutely no sense…
Continue reading
How long is a (piece of) String. Cricketing Greats and the length function
My Dad gave me a book recently – the 100 Greatest Cricketers. As well as selecting what – in his opinion at least – were the 100 finest exponents of the game, the author also decided to rank them in order from 1 to 100.
At this point, for those who don’t know, I should perhaps explain that Cricket is one of those games given by the English to the rest of the world….to prove what sporting losers the English could be.
For any Australians reading, to whom this statement may ring hollow given their teams current travails, fret not. Historically, England’s brief ascendancy the battle for the Ashes tends to come to a juddering halt when least expected, usually in the form of a 4-0 thrashing ( think 1958-59, 1989).
Anyway, back to the book. Comparing players across different eras is hard enough – just how would you evaluate the relative merits of Sachin Tendulkar and Sir Jack Hobbs, for example ?
But comparing the relative merits of a batsmen and bowler who were contemporaries in the same team is equally problematic. Who is the greater cricketer out of Dennis Lillee and Greg Chappell, or Malcolm Marshall and Viv Richards ?
All of this brings to mind the saying, “how long is a piece of string”.
In SQL, at least, we do have an answer to this question…or do we ? Continue reading
Disabling the Oracle Diagnostic and Tuning Pack APIs – If you want something done, do it yourself
At last, we have reached the final episode of the Star Wars themed odyssey through the tangled web that is Oracle’s Diagnostic and Tuning Pack licensing.
Just as well really, Deb has flatly refused to give over any more evenings to my “research” – i.e. re-watching all of the films. Even the appeal of Ewan MacGregor’s Alec Guiness impression has now waned.
Just to recap then, so far I’ve looked at :
- Oracle Licensing for the various Database Editions
- How Oracle audits features used on the database
- The components that comprise the Diagnostic and Tuning Pack APIs
- How SQLDeveloper can be quite expensive
Now, finally we’re going to have a look at how we can minimize the chances of an errant select statement causing a whole heap of trouble.
Yes, we’re going to have a go at disabling access to the Diagnostic and Tuning Pack APIs without (hopefully), breaking anything.
Continue reading
SQLDeveloper and a very expensive query
UPDATE
I’ve recently been reliably informed that this issue will be fixed in SQLDeveloper 4.0.
It should be landing here somtime very soon.
The magic of the FA Cup. It’s one of those cliches that you are brought up to believe as an article of faith if you’re English.
It is supposed to refer to the glorious unpredictability in a knockout cup competition where there is no seeding.
In recent years, it’s become a lazy journalist’s phrase. An attempt to sensationalise a result that, usually, isn’t that surprising.
In this year’s fourth round, however, Non-league Luton Town went to Premier League Norwich and won, 1-0.
The first time in 24 years that a top-flight club has been knocked out by one outside of the Football League has taken it’s toll.
Simon, life-long Luton fan, now has some very achy face muscles as a result of walking around with a huge grin on his face for the last week.
At this point, I could try to relate this sporting miracle back to the Star Wars theme that’s been running through this series of posts on Oracle Licensing, but it’s a bit difficult.
Luton, plucky underdog rebels. Norwich City the Evil Empire…I just can’t really see it.
Delia Smith as Palpatine with Chris Hughton as Darth Vader ? Somehow it just doesn’t seem to work.
Anyway, back to the license stuff. So far, we’ve looked at :
- Oracle Licensing for the various Database Editions
- How Oracle audits features used on the database
- The components that comprise the Diagnostic and Tuning Pack APIs
This time, we’re going to turn our attention to SQLDeveloper and of the ways in which it attempts to allow users to avoid using the Diagnostic and Tuning Packs. Continue reading
Oracle Database Diagnostic and Tuning Packs – exactly what are you not licensed for ?
It’s that time of year. The expense of Christmas is becoming apparent and January payday has seemed to be forever in arriving.
“…and I need a crown !”, said Deb.
This caused me to pause for a moment. Was my better half getting delusions of granduer ?
Further, delicate enquiries revealed that it was merely a dental crown to which she was referring.
Not that it seems to make much difference financially. You could probably buy a fairly substantial piece of regal headgear for what the dentist was asking.
On the plus side, Queen Deb’s costume for the next instalment of the Licensing Epic doesn’t require such accoutriments…although a big pair of headphones and lots of hairspray may be in order. Yes, I’m still on my Star Wars themed odyssey through Oracle Database Licensing.
In the previous posts, I’ve already covered :
Now, it’s time to get to grips with the licensing minefield that are the Diagnostic and Tuning Packs.
Queue the orchestra….
Episode 2 – Attack of the Diagnostic and Tuning Packs
Confusion is rife in the Data Centre. The Geeki have found that the incredibly useful AWR and ASH utilities are in fact secret members of The Diagnostic Pack.
Fearing the presence of the Dark Side, they must now re-enter the realms of the mysterious Oracle Database License to
- Determine which features are part of these packs
- Work out exactly what constitutes usage of these packs
- find out which database objects that are part of these packs
With this information, at least they will know which objects they must avoid if they are not to have to pay substanital additonal licenses…
Disclaimer
This code has been written and tested on Oracle Database 11gR2 Express Edition.
The licensing information I’ve referenced is for Oracle Database 11gR2.
I’m fairly sure it all works as expected. However, as you undoubtedly know, you shouldn’t take my word for it.
Before you go playing around with this on any production environment, please make sure it does what I think it does.
Of course, if you do find any issues, I’d be great if you could put a comment on here so that I can correct any issues…and also to give a pointer to anyone else looking at this post.
Yes, I know the standard disclaimer about “similarity to events or persons living or dead” always goes at the end of the film, but I thought it best to put it at the start.
Incidentally, have you ever wondered exactly what real-life events Star Wars could have a similarity to ?
DBMS_FEATURE_USAGE_REPORT and The Phantom AFTER SELECT Trigger
Splat !
Darth Debbie has just launched a surprise attack using her current favourite weapon. Never get into a snowball fight with that woman.
Milton Keynes, like much of the UK at the moment, looks less like it’s leafy, quiet self and more like the Arctic Tundra at present.
Being in a part of the country where normally, you can tell the changing of the seasons by the changing temperature of the rain, a little bit of snow always causes chaos.
On the plus side, the national weather forecasters – The Met Office – issue colour-coded weather warnings which, at times like this include the always hilarious Yellow Snow Warning.
Anyway, the reason for the Star Wars references in this post is that I was planning to cover the whole question of license monitoring with particular reference to the Diagnostic and Tuning packs. However, it was getting to be more of a novel than a blog post so I’ve decided to split it down into more manageable chunks…or Episodes.
So, in the style of the Epic Space Opera, please imagine the following paragraph scrolling through space with John Williams and his Orchestra blaring out of your speakers…
Episode 1 – The Phantom AFTER SELECT Trigger
It is a time of license audits.
The sinister Oracle Corporation have besieged the peaceful Database with some arcane licensing restrictions.
The Geeki, keepers of peace and tranquility in the Data Centre are on the case.
Using their mystical powers, they begin to investigate DBMS_FEATURE_USAGE_REPORT to discover
- Where Oracle stores information on Database Features being used
- How this information is collected
- What unnatural force powers are at work to enable the recording of SELECT statements against some tables and views
Queen Debbie ( she’s changed sides in this paragraph) is wondering just how geeky this is all going to get ….
ORACLE Transactions and Fishing on the Underground
It’s that time of year again. Yes, it is the season to be snotty.
“Man-flu”, was Nurse Debbie’s considered medical opinion. Admittedly, she’s feeling a bit under the weather herself and, as we all know, “Bird-flu” is a far more serious condition.
I think I must have picked up this particular bug during my daily commute, which currently involves quite a lot of time on the Tube.
In order to pass the time in the morning crush that is the Northern Line, I’ve taken on a challenge from Simon.
He claims that, apart from St. John’s Wood, there is no other tube station that does not contain at least one letter from the word “Mackrel”.
Whilst this may seem a somewhat esoteric fact, it’s probably quite appropriate to look for bits of fish whilst wedged into a Tube train like a sardine.
The tube map itself includes station on the Overground Network as well as the DLR so, ironically, this does provide a bit of “wiggle-room” for my Mackrel search.
All of which serves to act as an example in the following exploration of how Oracle transactions work…
Continue reading
Oracle Schema Differences – keeping up with the Prefix Pixie
Saturday 11th September 1976. That was the day that my Dad first took me to see the (occasionally) mighty West Ham United.
The opponents, the rather more often mighty Arsenal.
I still have vivid memories of that game. The noise from the crowd. The fact that the grass looked so green, brighter than on the TV.
West Ham not playing very well. Frank Stapleton putting a bit of a downer on the day by having the temerity to score twice in a 2-0 win for the Gunners.
My Dad recently celebrated his 70th birthday.
His present from his first-born son ? A trip to see the (previously) mighty Luton Town take on the ( probably must have been from time to time) mighty Nuneaton Borough.
Now, this may seem poor reward for my dear old Dad – he takes me to see two of the top teams in the country and he gets the Blue Square Premier League in return.
Additionally, these days it’s less the colour of the grass that assaults the senses than the colour of the boots.
These are various flourescent colours, virtually none of them black.
Mind you, as Deb pointed out, if you play for Luton and spend most of your working life dressed in bright orange, then accessorising must be a bit of a challenge.
The game itself however, is another matter.
Typical English Football – very quick, lots of commitment. You can tell it’s not the Premiership by the absence of millionaires rolling around the floor in apparent agony because they’ve broken a finger-nail.
Two late goals sends the Hatters home happy.
All of which has nothing to do with the subject of this post, apart from my choice of examples.
Comparing the table structure between different schemas is standard functionality for any self-respecting IDE. However, things get a bit more tricky if you’ve had a visit from the Prefix Pixie. He, she (or it if you’re table relationship diagram dropped out of a design tool) thought it’d be a good idea to give the same prefix to every table in the schema.
The result of this is that the tools in the IDE can’t recognize that tables with different names are meant to have identical structures.
So much for the “Premiership” of Database Development, it looks like we’ll just have to do a bit of D.I.Y. to see through the poxie pixie dust.
Dad would approve. Continue reading
Born Before Computers – fogey foibles and forsight for the humble insert
Apparently, I am considered by some to be stuck in my ways.
For example, Deb now refuses to stand with me in the supermarket queue because of my tendency to argue with the automated checkout.
This even extends into my working life where I have a colleague who is a bit more hip and with it when it comes to writing code.
The rest of us in the Oracle team – slightly older than this person it must be said – are apparently “BBC”.
This isn’t some reference to the venerable British Broadcasting Corporation, nor even to the BBC micro which was popular back in the 80′s.
Evidently, it is something of a disadvantage to have been “Born Before Computers”.
I’ll confess, I do write most of my database code in a text editior and run it via SQL*PLUS. Whilst I use an IDE for looking at stored database code, I’m not that keen on using it as a code environment.
As is usually the case, sometimes things are done in a certain way for years because that’s the best way to do it…and sometimes it’s simply because “that’s how we’ve always done it”.
The trick is, knowing which is which.
All of which brings us to the INSERT statement. Continue reading