The village idiot

If you are not familiar with the term Village Idiot, then Wikipedia provides a sufficient definition from which I can base this blog post.

https://en.wikipedia.org/wiki/Village_idiot

“The village idiot … is a person known for ignorance or stupidity”

Over the past couple of weeks I’ve been flying a bit.  First was OpenWorld and OracleCode in New Delhi in India, and from there, I was heading straight from there to Cleveland, Ohio for the GLOC users conference for the first time.  Being a fairly seasoned traveller, this should have been a relatively straightforward affair.

Well… things didn’t turn out that way. 

To get to Cleveland, first I had to get to the United States, so I had two flights, as you can see from the picture  – one from New Delhi to a transfer in Shanghai, and then from Shanghai to San Francisco. 

village_idiot_map

 

 

The problems started due to the simplest of issues.  The night before I was due to fly, I picked up my itinerary, saw “11:40pm” and thought “Cool…I can sleep in tomorrow, do some AskTOM, get some work done, and stroll out to the airport after the evening traffic has subsided”.  And I did precisely that.  I got to the airport at about 9pm, paid my driver, collected my suitcase and headed over to the airport entrance.

For those of you that have not been the India, the airports work a little differently.  You cannot actually enter the airport unless you have a valid ticket.  I assume this is both for security reasons and due simply to the volume of people that pass through the doors.  At the entrance, security personnel check your passport and ticket and let you in.  I produced my details and after a short pause, the officer looked at me and said:

“You cannot come in”

I asked why ?  I had given him my passport and all my flight details. 

He said “Your ticket is no longer valid”

And that’s when it hit me….The boarding time for both of my flights was 11:40… But for the first flight, it was 11:40am, and for the second flight was 11:40pm.  The night before, I had checked the wrong itinerary – I was mentally cued in to the time being “11:40” so when I saw “11:40pm” I assumed I was looking at the right document.

So this was the start of problems.  Here I was, on the sidewalk, not even being able to enter the airport, having missed a flight that left some 8 hours before I even got to the airport.  This first leg was with Air India, and the second leg was with United, so I was already thinking – how am I going to re-arrange these flights and get everything coordinated across two carriers. 

But first things first…I wandered down to the one part of the airport where you are allowed to enter – the ticketing section.  And, now nearly 10pm, no-one was manning the Air India desk.  So I tried calling them, and even whilst on hold, I realised the futility of this, because if you’ve ever stood outside in Indian traffic, you cannot hear a single thing.

I knew I would not be flying anywhere tonight so the next job was to get to an airport hotel….and of course, there are no onsite airport hotels at New Delhi airport Smile  So then it was a case of walking from taxi to taxi outside the airport trying to see if any of them take a credit card (which is rare for taxis in India) because, like most people, I had carefully spent all of my Indian currency because I thought I was about to leave the country !  Finally a car that looked less like a taxi and more like a hotel car was driving past, so I flagged him down, and asked him which hotel he was from and how far away it was.  5km later I was at a hotel, now nearing midnight, and the job of sorting out flights commenced.

Sorting out 2 flights with different vendors is not pleasant.  To try avoid the hassles, I phoned my travel agency because they’d have access across carriers.  After 20 mins (on mobile phone international roaming rates!) of “Please hold, your call is important to us” I gave up.  So first it was a call to Air India to see if I could get on the same flight tomorrow, but I could book nothing because then it was a call to United to see if I could get the next day flight from Shanghai. Then back to Air India to actually book, and then back to United and book with them.  Rest assured, on a mobile phone with brittle coverage, nothing is more annoying that voice-controlled automation ! 

Bot: “In a few words, tell us how we can direct your call”…
Me:  “Flight Reservation”
Bot: “I think you said ‘Cargo’. Is that right?”

I dont know why…but it does indeed make you feel better to swear at a bot Smile
So after a couple of hours of sweat and tears (and expense) I have more or less the same flights booked for 24 hours later.  I get some much needed sleep to let the adrenalin seep out…

Next morning, I’m back where I started – at the airport entrance, but this time, I’m straight through the entrance with no difficulties…phew.  After the standard 30min queue to check in, when I get to the counter, the Air India agent says to me:

“I’m sorry…We cannot check you in”

I go pale…. “WHY ?!?!?!”

“You do not have a visa for China.”

I tell him I do not need one, because I’m not staying there – it is just transit.  But apparently with the re-booking of the flights, they are no longer “connected”.  So now I have to prove that I indeed have a connecting flight out of China, and my existing hard copy printouts are useless, because they refer to a flight that already left yesterday !  And thus, here I am, at the checkin desk, trying to once again navigate the stupid voice bot as I try to contact United over shoddy cell service with international roam, so they can tell my Air India checkin agent about my flight.  I’ve discovered this is not a good way to be popular in an indian airport, with 500 people queued up behind you because you have become a bottleneck.

After 10mins on the phone, passing it back and forth to the agent and myself, I am finally allowed to check in.  My Air India agent is very apologetic and offers to check my bags all the way through to San Francisco to make transit more convenient.  I am thankful for small mercies at this point.

8 hours later and touchdown…I have made it to Shanghai.  Unsurprisingly, all of the signage is in Chinese, so navigating my way around is not easy.  For the life of me, after much wandering, I cannot find the International Transfer. Eventually I give up and figure, even if I go out through Customs, I can just come back through security in the normal way.  After another long queue, I get to the front of the line at Customs, and the two officials, resplendent in their semi-automatic machine guns, look at my passport, and my ticket, pause, and just shake their head.

That’s all.  Just a shake of the head, and I’m not allowed to pass.

Now I’m panicking.  I’m starting to think of that movie where the guy could not get out of the airport for months. 

I ask why, but their English is just as good my Chinese, ie, non-existent.  I can feel the sweat on forehead, so I’m sure they are starting to think I’m a terrorist or threat to the nation in some way.  And they are mighty big machine guns.

Some feeble gesturing and “sign language” from me doesn’t seem to be helping but at least I’m not being locked up yet.  Eventually one of the officials gets my onward boarding pass to San Francisco, and points at the sign on the wall, which is mainly Chinese but I can make out that it is referring to “24 hours” being the limit you can stay in the country without having a visa.

Now I’m very stressed and very confused.  I’ve given them my onward boarding pass, which shows I’m (hopefully) out of the country in 5 hours…so what could possibly be the issue. More desperate hand waving from me.  The official gets my boarding pass and circles two items:

Departure Date: May 12
Boarding Time: 23:40

and then points to the “24 hour” sign again.  And then … the penny drops.  My flight leaves at 00:30 on May 12, but the boarding pass says “Boarding at 23:40” (which is actually boarding on May 11 for a May 12 flight!), but the Customs person is interpreting this to be late at night on the 12th, which is more than 24 hours…hence violating their entry rules.

So now it’s me drawing pictures of clock hands, and calendars, and departure boards …. and after 10 terrifying minutes, we finally are in agreement – I can indeed pass through and pass back to leave the country !  At this point, I’m still not even sure if I was meant to come through Customs but at least I’m seem to be making some progress. 

It’s at this moment I realise that Friday night is peak hour at Shanghai airport.  Often as travellers, we’re critical of security checks when the queues are long and only a handful of staff are working.  I cannot say this about Shanghai.  They had every single departure check open, and equally as many X-ray machines all going concurrently – perhaps as many as 15.  But it counts for nought when a bazillion people are trying to fly somewhere.  I spent 2 hours in the familiar snake lines going through the standard departure checks and x-ray screening before finally getting to the United departure gate with about 40mins to spare.

The stress finally seems to be over…I sit and relax.  And then…

“Paging Mr Connor McDonald…can you come to the gate desk urgently”

By this point, I’m convinced that I will never be seen again by family and friends.  I trudge up to the desk. 

“We’re sorry sir, but the Air India checkin agent should not have checked your bags through to San Francisco.  As you’ve seen, there is no international transfer in Shanghai – all passengers must retrieve their bags when transferring”.

Well…this explains why I could not find the international transfer….there isn’t one !  And then comes the kicker..

“…So we’ll need to go back through Customs and collect your suitcase and come through security again”

There was long pause at this moment… a long pause where I considered the well being of the person telling me this, and what the implications would be if I were to remove their spleen with the plastic fork I had been eating my salad with Smile

“NNNNNNOOOOOOOOOOOO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!”  I bellowed at them, knowing that I could no way make it back in time, and moreover, there was no way I was going through the explanations of 24hour clocks again.

The result ?  I did get on my plane and I did land in San Francisco…albeit a day later than originally planned.

The suit case ?  Well… it didn’t.  So the next day, I was back in a taxi, heading out to San Francisco airport to pick up the suitcase that made its own way on its own schedule to San Francisco.

So there you have it.  All of this grief…and why ?  Because I could not read a piece of paper correctly.  I’m not just the village idiot.  I think if you took the village idiot from the all villages, and then made a village of those idiots…then I’d be the village idiot in that village !

So I’m writing this post somewhat as part of my “penance”.  After all, if you can do something as silly as I did, then it only seems an appropriate punishment to share it with one’s peers 🙂

The real question is … why are you NOT blogging

Colleague Jeff Smith published an interesting post the other day about his “rules and regulations” for blogging, but the overriding theme (Ed: – this is my opinion, I’m not speaking for Jeff)  was that the “what” he blogs about was – anything he’s passionate about, and the “when” was – whenever felt inspired to do so.

That got me thinking about blogging in general.  I think it is safe to say

  • there are things in your working life that feel passionate about

(Because not to do so means you’re in the wrong career)

  • they are not all negative Smile

(same reason)

  • there’s a good chance that someone in your field of the IT industry has the same passions

(I got news for you…you’re not the only guy/girl running Oracle, or Microsoft, or SAP, or Java, or …)

  • most people in the IT industry know about this thing called the “internet” Smile

(Don’t blame me…blame Netscape , Facebook and cat videos)

So with those things in mind, to not  be blogging about the things in your career that you are passionate about … is … well…. sortta just plain rude.  The script you wrote, the problem you solved, the frustration you had with the way something worked – all of these are items of potential benefit for someone out there in the community.  Moreover, the act of putting it to “paper” might assist you if the topic at hand is one of a seemingly unsolvable problem.  And of course, the more people that are blogging, the greater the chance that you will receive a reciprocating benefit, namely, someone else’s blog post will assist you with some element of your working day.

You might be thinking – “Oh..I dont have necessary software to blog”  That doesn’t really cut it anymore since all of the blogging platforms have reasonable editors just sitting there right in the browser.  I know this because I’m typing this entry into such an editor right now.

Or you might be thinking – “Oh..I dont have the time to write one”  Yeah, that doesn’t really cut it either Smile If you haven’t got the time to write it down, just do it video instead.  And before you tell me that “Oh..I dont have necessary equipment”  let me share with you what I use for a lot of my “away from home” filming:

20170216_171434

In terms of a parts list, we have

  • standard compact camera (because they all do Full HD nowadays)
  • wind suppression device – yes, that’s the kitchen sponge sitting over the camera microphone slots
  • anti-vibration kit – that would be the paint roller swivelling on the piece of wood
  • zoom extension – that’s the broom handle to which the paint roller is attached
  • horizontal stabilisation lock – or “rubber bands” by their other name Smile

Rest assured, Steven Spielberg I’m definitely not, but I’m not trying to be.  And what’s more, I don’t think the viewing audience is interested tremendously in cinematic wonder – they’re interested in content that might help them have an easier and more productive time at work.  I’m just sharing what interests me, on the off chance that it will benefit you.

So whether it is blogging or video or any other medium, don’t be shy.  Jump on board and try your hand.  You might surprise yourself at how easy it is to reach out to the greater community in your IT world.

Give it a go !

Hack-a-Mongo

I was reading an article today about how 10,000+ Mongo installations that are/were openly accessible on the internet have now been captured by ransomware, with nearly 100,000 other instances potentially vulnerable to the same issue.

Now, since I’m an Oracle blogger, you may be inclined to think the post is going to jump on the “bash MongoDB” bandwagon, but it’s not.  I am going to bash  something…but it’s not MongoDB Smile

I’m going to steal a quote from … of all things… Jurassic Park Smile

“Your scientists were so preoccupied with whether or not they could, they didn’t stop to think if they should”

In this age of DevOps, Agility, reactive-this, and responsive-that, there is an understandable desire to have a goal of “deliver fast and often”.  But I’m not attacking the various methodologies and processes out there that espouse the new age of fast and furious delivery.  Because, to my knowledge, none of them ever had a goal of “fast delivery no matter what“…they had a goal of fast and flexible delivery whilst adhering to the unchanging fundamental principle of delivering high quality, secure and robust software.  It may be functionally incomplete, or have compromises in (for example) the user experience, but we never meant to compromise on the core principles.

So when I see stories about MongoDB (or any software technology) being exposed for reasons of poor security, my lament is not for the technology but the part when a developer, or administrator, or manager, or anyone in the chain of processes that skipped an appropriate assessment of security, in effect, playing a game of Russian Roulette with their customer’s personal details.  I don’t think there is even a defence of “ignorance” here, because the moment anything is deployed in an organisation, surely the first question that must be asked either before the deployment, or even in that awkward moment afterwards when you discover something was deployed without your knowledge is … Is it secured?  And if no-one can answer that question, then surely that’s the immediate death knell on that application right there ?

If “hand on heart” a team can claim that security measures are in place, and then these are circumvented, then that’s defensible – perfection in security is such a moving target nowadays.  But it seems a stretch to think that 100,000 Mongo teams out there all did a diligent crack at securing their system before getting all excited about having their application live Sad smile

So if you’re building applications with the latest Micro-agile-internet-of-things-reactive-responsive-Java-scripted-open-source-media-rich-blahblah approach…that’s super cool.  But that’s not a Leave Pass from being responsible when it comes to security.

What you "liked" last year…

Well…when I say “liked”, what I mean is “the stuff you all clicked on a lot” last year. Whether you liked it or not will remain one of those great mysteries Smile

The top 6 posts from 2016 were:

https://connormcdonald.wordpress.com/2015/11/25/ora-14758-last-partition-cannot-be-dropped/

https://connormcdonald.wordpress.com/2013/01/20/exchange-partition-those-pesky-columns/

https://connormcdonald.wordpress.com/2013/08/26/compressed-partitions-are-not-compressed-tables/

https://connormcdonald.wordpress.com/2014/04/12/pluggable-database-and-restricted-sessions/

https://connormcdonald.wordpress.com/2016/06/09/parsing-no-big-deal-eh/

https://connormcdonald.wordpress.com/2016/03/26/are-your-sql-plus-scripts-going-to-ell/

Nice to see a 12c post in there – 2017 is the year I think most people will be moving to 12c if they have not done so already.

And of course, nice to see a SQL*Plus post in there….I love it when the old simple tools still add value for people.

Thanks for supporting the blog in 2016 … I’ll have stacks more content again for you this year.

A old story from the past

My own personal hell story was back in the late 1990’s, when moving database from one server to another.  We were recycling some of the hardware (disks and memory), so it was a unload-to-tape, reload-from-tape job. The servers were in Port Hedland (a rat-infested dusty 110-degrees-plus 98% humidity hell hole… Hi to anyone in Port Hedland … ). I was not physically present – don’t you love it when IT companies think “remote login” is always the best way…

Anyway, because of the dust issues, I unloaded three copies of the database to three tapes, and then did a verification read of all them. An on-site non-techie took care of unloading/reloading tapes for me.  He chucks the disk drives and memory from the old server plus the three tapes into a truck and drive 20 km’s across town (where the new server is). Then I spend an hour on the phone trying to explain blind to him how to plug all this stuff in to the new server.

He turns it on… smoke starts billowing out of the box. Emergency shutdown (ie, rip out power cord). He’s plugged some of the memory in wrong so its munched one of the boards. So (over the phone again) we talk through removing all the memory from just that board but leaving the other memory in. Finally, the machine does in fact boot nicely. I log in as root and mount the new disks and start restoring from tape.

30mins in… first tape dies with a read error. About half the database restored. “No problem” I think, because we expected that due to the environment … and we load the second tape.

Another 30 mins, second tapes dies with a read error. Everything restored except SYSTEM tablespace. “Luckily we’ve got that third tape…” I think.

Third tape goes in… ‘ufsrestore’ command just hangs… Phone rings. On-site techie says “I can see tape spewing out of the Exabyte drive….”

So all tapes used, and no SYSTEM tablespace… As they say in the classics,

“Thats when you discover that adrenalin is brown and sticky”.

I’m thinking about career moves etc, when the phone rings again. Its my partner.

“How’s thing going at work?” she asks.

“Don’t ask!…” I say and give her the run-down on what’s happened…“Anyway, how’s things at home?”

There’s a long pause… followed by her bursting into tears….

“My pet budgerigar got out of the cage and has flown away….(sob) (sob)… he’s in the tree in the back yard…(sob) (sob) can you please come home and try catch him…”

Not really what I needed at that point in time…

So I tell the techie I’m off to get a coffee… I jump in the car and scoot home to console the partner…“Where is the little bird?”

“That tree there…” says my partner as she points to our 100 year old Citradora, around 150ft high! With the binoculars I can just see the little yellow budgie about 149.5ft up…

partner- “Can you climb up and get him?”

me (mentally) – “Are you out of your frickin mind ?!?!?!”
me (verbally) – “Of course dear, fetch me the ladder…”

So I start climbing this stupid tree, knowing full well that I’ll never get this stupid bird, and that even if I did, I would wring its stupid little neck….30 mins later, I’m teetering at about 80ft and the branches won’t support my weight anymore. So I climb back down, covered in sweat and scratches, but the effort seems to have appeased my partner…

So I spend another 10 mins crapping on about how “its better now that the the little bird is free” etc etc, knowing full well the neighbour’s cat will have him for dinner within a matter of hours Smile

I scoot back to work…its amazing how teetering on the brink at 80ft gives you some clarity. I have a sneaking suspicion that the SYSTEM tablespace was on one of the disks that was NOT recycled from the old server. I get the techie to drive back to the old server, and collect all the remaining disks.

Another hour to get them all plugged in correctly (remember the good old days of SCSI terminators….) and voila! I find the SYSTEM tablespace on the old disks.

So at the end of all this drama, I naturally send my status email to management:

“Server moved, no errors encountered” Smile

Resolutions for 2016

I remember at one of the first Mathematics lectures I attended at University, the lecturer demonstrated some principle (which I don’t recall, and certainly wouldn’t even comprehend now Smile ), and then turned and said to the class: “Now THAT is a pretty exciting result”.

Being fresh out of high school, and like most teenagers, thinking we were all so cool and hip, most of the class laughed. After all, how nerdy do you have to be to get excited about math !?

Our lecturer paused, put down his chalk (yes, in those days it was chalk), and spoke to us:

“You all CHOSE to do a mathematics degree.  And you are in a mathematics class.  And yet, you think it’s embarrassing to be excited by mathematics.  I feel so sorry for you.  A great life is one where you pursue the things that excite and inspire you.  You’ve chosen this mathematics degree, and yet you are not excited by the subject – what a waste.  Such a shame.”

That lesson stuck with me far more than any mathematics theory we subsequently studied.  And so my resolution for 2016 is simple.  I want all of us to be excited by SQL, to be excited by database technology, and to be excited to discuss it, to debate it, and to build wonderful systems with it.  That’s why our Developer Advocate team exists – to show that passion and excitement about database technology isn’t an “uncool” thing – its a wonderful thing.

New Years Resolution–test cases

If the following email came across your desk

“I have two tables EMP(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) and DEPT(DEPTNO,DNAME,LOCATION).  When I join them I’m getting multiple rows for the same employee”

my question would be – how would you proceed ? What is the first thing you need to do to even begin to assist ?

You need data.  And before you can have data, you need to have tables in which to store that data.

But there’s a problem:


SQL> EMP(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO)
SP2-0734: unknown command beginning "EMP(EMPNO,..." - rest of line ignored.

Nope…that doesn’t work. Let’s try CREATE TABLE in front of it


SQL> create table EMP(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO)
  2  /
create table EMP(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO)
                 *
ERROR at line 1:
ORA-02263: need to specify the datatype for this column

Nope…that doesn’t work either. In fact, its pretty obvious that there isn’t anything useful that we can use here.

So someone needs to convert the information above, into something that is actually usable, ie,


CREATE TABLE DEPT
 (    DEPTNO NUMBER(2,0),
      DNAME VARCHAR2(14),
      LOC VARCHAR2(13),
       CONSTRAINT DEPT_PK PRIMARY KEY (DEPTNO)
) 
  
CREATE TABLE EMP
 (    EMPNO NUMBER(4,0) NOT NULL ENABLE,
      ENAME VARCHAR2(10),
      JOB VARCHAR2(9),
      MGR NUMBER(4,0),
      HIREDATE DATE,
      SAL NUMBER(7,2),
      COMM NUMBER(7,2),
      DEPTNO NUMBER(2,0),
       CONSTRAINT EMP_PK PRIMARY KEY (EMPNO),
       CONSTRAINT EMP_FK FOREIGN KEY (DEPTNO) REFERENCES DEPT (DEPTNO)
 ) 

Now then – who do you think is best equipped to do that ? The person who asked the question, ie, the person who actually HAS the tables at their disposal, or someone who has never seen the tables, has no idea of what the datatypes  might be, and no idea of the data inside them ?  I think to answer to that is self-evident.

So please… if you’re asking anyone for assistance, whether it be via email, or blog, or forum or even verbally, please keep in mind that a casual mention of table names and column names is pretty much worthless.  Runnable DDL matters, and meaningful test data matters.   It takes only a few seconds to run DBMS_METADATA.GET_DDL or any modern GUI to get the DDL and/or test data insertion statements.