Wednesday, December 06, 2006

Secondary name

Some company had a database corruption - based on InterBase 5.6 system, oversized >4gb database. That company was not able to send database over internet, and their office also was one metro station from me, so I came to them to take broken database.
Since this was a security office, I tried not to touch anything, and just looked at screen and told local administrator what to do.
He showed me directory with database, and I told him to copy database, let's say named 'A.GDB'. I need to say that there were also some things that took my attention away.
When I brought database to repair people, they said - Hey, this file is OK, but there must be another database file (secondary), named employee.gd1.
Hell! Yes, I saw some file named like that, but at the security room I couldn't imagine that someone will name secondary database file with another name!
When at last we had all database files, we found that the cause of corruption was incorrect parameters for secondary file length (also 'starting at' was specified, unnecessary).
So, why secondary file of database was named EMPLOYEE.GD1 instead of A.GD1 ?

The answer is simple - someone who did that just looked directly into documentation, and nearly copied 'alter database' command word by word. And he not tried to think much. Documentation says employee.gd1? Let it be.
And the corruption happened because secondary file length was set to 5000000 pages - 5 gigabytes- not 4.

p.s. Secondary database files are not needed anymore in latest Firebird and InterBase versions (at least in 1.5 and 7.1). If you use these versions, you must check free space on database drive, and may not care about database file size.

No comments: