Friday, June 17, 2011

Fixing a complex corruption in PostgreSQL

Since many years, we have been using PostgreSQL as the backend to our DNA Analysis solution. And very successfully so; we now have approximately 10TB of statistics in almost 500 schema's.

In order to backup a particular schema or table, we use pg_dump. However, this week it started to produce a nasty error, see below:


THE PROBLEM:
C:\Program Files\PostgreSQL\8.3\bin
>pg_dump -f c:\tmp\out.back -i -F p -v -a -h d2host -t ibmmat0001_sta.sta_db d2dna
pg_dump: reading schemas
pg_dump: reading user-defined functions
pg_dump: reading user-defined types
pg_dump: schema with OID 2613175388 does not exist
pg_dump: *** aborted because of error

With the help of google, I soon discovered we may have a corruption in one of the vital tables: pg_class.
Analyzing the problem, I first identified which tableor schema we have an issue with:
executing "select oid, * from pg_class where oid = 2613175388" shows we're dealing with a table named ls_tmp1. I know we have some of these tables in several schema's.

Next, I executed "select * from pg_tables where tablename = 'ls_tmp1'". The result is shown in the screendump below:
Notice how the troubled table does not belong to a schema (it should!). Hence the trouble reported in the pg_dump.

THE SOLUTION:
In order to repair this corruption, I created a new schema named "for_corrupt_table."
I then looked up the OID for this newly created schema.
create schema for_corrupt_table;  -- its oid became: 2613195672
Next I updated the relnamespace column to make this troubled table point to the new schema:
update pg_class set relnamespace = 2613195672 where relnamespace = 2613175388

Refreshing my pgadmin window revealed the new schema and the existing table.

Monday, March 28, 2011

Tableau with Exact Compact 2000

Today, I managed to connect Tableau with our Exact Compact 2000 application (accounting software).
Again proof of Tableau's superior capabilities to visualize virtually any source of data.

Must admit that I could have made the dasboard a bit more appealing. But my main point is that it works, without any hassle!


My next mission is to reverse engineer the data model within Exact a bit deeper, so I can start to make really appealing dashboards! (this example -of course- is giving me a life view on the entire book keeping).

Drop me a message if you;re interested in more of this stuff.

Tuesday, March 15, 2011

Pros and Cons of the new T-Loc Systainer from Festool

While working on my new kitchen cupboard (see this post) I decided to buy a DTS 400 at my favorite store in The Hague: Van der Toorn en Stolp. This is when I learned that Festool had introduced a new T-Loc model for their systainers.

About the New Systainer:
The new model has a cool new feature that makes life a lot easier: systainers can now be stapled with just one convenient turn of the single green handle on the front of the systainer; the T-Loc.

What's not so cool is the fact that I own a big tower consisting of traditional boxes only. This new systainer is not 100% compatible with these traditional models. What it means is that you can only use the new model with your 'old' tower, when you place the new one all the way at the top. Not somewhere in the middle. For me this is a disadvantage, because I want my most frequently used tools on top.
What's the problem? The picture here shows my existing configuration, with my Protool Quadrive and Centrotec on top. The systainer of the Quadrive has a powerful feature that allows me to store many attributes in the lit of the systainer. Notice on the left how efficient it is that all bits can be accessed from the top of the systainer.
There is no way you can place the new systainer in the middle of your tower. It will connect from the bottom, but there's no way you can connect it to the one above. And unlike traditional systainers -that stand relatively stable even if you do not connect them with the handles, this new container does not offer that same level of stability. See below:

My opinion:
I understand why Festool came with this new innovative T-Loc Systainer, it's great and much more efficient than the traditional ones.

What I'm a bit disappointed about is the fact that these new systainers are not backwards compatible. I would have preferred to have my new DTS shipped with the old systainer. Why doesn't Festool offer this option?

Oh, and bytheway: my new DTS is fantastic!

Wednesday, March 9, 2011

Lotusscript Classes within an Application Landscape

Analyzing the source code in all applications for a customer, I was wondering how we could visualize our analysis results in such a manner that it would actually make sense. For LotusScript classes, here's what I came up with:


The radar plot above shows separate colors for each type of design element, and how standard LotusScript classes have been used in the source code of all applications within this IBM Lotus Domino environment. Custom, self-developed classes can of course be displayed in a similar fashion.

Most lines of code were found to exist in notes agents, script libraries in second place, etc.

Notice how script libraries in Lotus Notes tend to use more back end classes, especially NotesName, NotesDatabase, NotesDocument, NotesItem and NotesLog. Agents and forms are the most frequent users of the front end classes NotesUIWorkspace, NotesUIView and NotesUIDocument.

How useful is this? I'm not sure, just think it looks pretty ;-) What do you think?.

Monday, March 7, 2011

Fun with Festool

Enjoyed working on our kitchen during the last couple of weekends, for several reasons.
First of all it is quite a challenge to create something that looks as if it is part of the 'real' kitchen we bought several years ago. Secondly because I had to squeeze this into a non-kitchen-standard space of our 90+ year old apartment.

And I am really happy with the end result.
    This used to be the ugliest area with an old radiator, washing machine and garbage can. All three -including our Miele- are still there, but completely hidden underneath the cupboard.
      Because my wife was so happy with the fact that I was finally finishing our kitchen, she didn't mind me expanding my Festool collection with a new toy: Festool DTS 400 Q
        (more below ...)







        I am particularly proud of my garbage can. Using the material from the drawer of the desk I used to work at while employed at PDVSA 20(!) years ago, I was able to make an extremely elegant solution. The result is this garbage can that smoothly slides in and out its place underneath the cupboard.

        Some detail: panels for the door are made from MDF, so material cost was close to nothing. Using my router cms module I was able to create panels that are identical to the rest of my kitchen. The frame in this picture is 15mm. and the panel 12mm. Can't tell you how much fun it is to create all these parts with such precision that it feels your actually making Lego yourself ;-)
         Oh, and not to forget: the beautiful paint job was done by my wife. She too enjoys my Festool gear...