About Me · Send mail to the author(s) E-mail · Twitter

At GROSSWEBER we practice what we preach. We offer trainings for modern software technologies like Behavior Driven Development, Clean Code and Git. Our staff is fluent in a variety of languages, including English.

Feed Icon


Open Source Projects


Blogs of friends

Now playing [?]

Error retrieving information from external service.

The Case Of The Giant SQL Server Log Files

Posted in SQL Server at Wednesday, 30 January 2008 19:10 W. Europe Standard Time

The day before yesterday I had to look into a SQL Server 2005 (Service Pack 2) instance where the daily backups of a certain database amounted to several Gigabytes over the last 14 days. The database in question is only about 10 MB in size and the recovery model is set to "Simple" so that should not be the case. The problem was a giant log file, around 6 GB in size by the time I started the remote session.

First I tried shrinking the database and the logs via the Context Menu, Tasks, Shrink Database options, but shrinking the log file failed miserably: it would not decrease below a magic threshold of 5,5 GB. Shrinking even should not free that much disk space because SQL Server shrinks the logs automatically after a transaction is committed when the recovery model is set to "Simple".

After a while of trial and error I realized that there must be some open transaction that has not been committed or otherwise been marked as done. But how to finally get rid of it?

First I tried to change the recover model to "Full" and "Bulk-logged", backing up the database and the logs separately.

BACKUP DATABASE database TO DISK='C:\Temp\file_data.bak' WITH NO_LOG
BACKUP LOG database TO DISK='C:\Temp\file_log.bak'

Processed 1000 pages for database 'database', file 'database_Data' on file 2.
BACKUP DATABASE...FILE= successfully processed 1000 pages in 0.434 seconds (18.875 MB/sec).

Processed 807822 pages for database 'database', file 'database_Log' on file 3.
The log was not truncated because records at the beginning of the log are pending replication. Ensure the Log Reader Agent is running or use sp_repldone to mark transactions as distributed.
BACKUP LOG successfully processed 807822 pages in 15.077 seconds (48.119 MB/sec).

As you can see from the messages above the shrink operation could not shrink the whole log file. The hint to use sp_repldone is a bit misguiding because the database isn't replicated. In fact, the replication components aren't even installed on the server. As expected, executing sp_repldone fails:

EXEC sp_repldone @xactid = NULL, @xact_segno = NULL, @numtrans = 0, @time = 0, @reset = 1

Msg 18757, Level 16, State 1, Procedure sp_repldone, Line 1
Unable to execute procedure. The database is not published. Execute the procedure in a database that is published for replication.

I digged the SQL Server Books Online for more information. First of all there's a command to find out about open transactions: DBCC OPENTRAN. As you can see there's at least one transaction that hasn't been replicated.


Replicated Transaction Information:
   Oldest distributed LSN     : (0:0:0)
   Oldest non-distributed LSN : (3822:331:1)
   DBCC execution completed. If DBCC printed error messages, contact your system administrator.

At least, it was the hint that finally solved the issue: There's a transaction that SQL Server thinks should be distributed to a replicated server, although there is none configured.

Fortunately, there's a stored procedure that can be used to disable replication, even if it wasn't enabled in the first place. I suspect sp_removedbreplication cleans up some bogus settings, at least it was able to remove the transaction that kept the log file steady at 5,5 GB.

Two hours later: Problem solved!

Now Playing [?]: Ocker – Public Transport – Last night the secret service saved my life

Siemens Gigaset QuickSync on Vista x64

Posted in Hardware | Tools and Software | x64 at Saturday, 19 January 2008 16:12 W. Europe Standard Time

Siemens Gigaset SL 370I recently purchased the Siemens Gigaset SL 370 phone for home telecommunications. The SL 370 is Siemens' premier DECT phone with a form factor comparable to mobile phones. It has plenty of advanced features, the most appealing one being Bluetooth support for headsets and, more importantly, syncing abilities with Outlook contacts. That is, you can sync your Windows Vista Contacts folder or Outlook contacts wirelessly over a Bluetooth connection.

On the SL 370 product support site there's a download option for the Gigaset QuickSync software needed for synchronizing the contact stores on your computer and the handset device. The software version I'm using is the current version 2.0 which needs the .NET Framework 2.0 to run (which is a good thing, see below).

The SL 370 is a great piece of hardware, good sound quality, very light, well thought out and with outstanding battery life.

However, there are some issues with the QuickSync software with Outlook 2007:

Gigaset QuickSync refuses to run on x64 versions of Windows Vista

After launching QuickSync on Vista x64, Windows instantly shows the generic "Program stopped working" dialog.

Gigaset QuickSync stopped working

After clicking the "Debug" button Visual Studio starts up revealing that an assembly of the Gigaset QuickSync package refused to load. When the application's main executable (GigasetQuickSync.exe) tries loading PCABManager.dll a BadImageFormatException is thrown.


As one can glimpse from the screenshot above the PCABManager.dll assembly is not strong named (PublicKeyToken=null), so I could leverage some of the .NET Framework SDK tools to make QuickSync behave on Vista x64.

Open up a Visual Studio Command Prompt and run corflags.exe on the GigasetQuickSync.exe and PCABManager.dll assemblies.

corflags /32bit+ GigasetQuickSync.exe
corflags /32bit+ PCABManager.dll

The 32-bitness flags should be set afterwards

>corflags GigasetQuickSync.exe
Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version  3.5.21022.8
Copyright (c) Microsoft Corporation.  All rights reserved.

Version   : v2.0.50727
CLR Header: 2.5
PE        : PE32
CorFlags  : 1
ILONLY    : 1
32BIT     : 1
Signed    : 0

This resolves the load errors on Vista x64 as we now force the 32-bit .NET Framework runtime to load. More technical details can be found on Scott Hanselman's blog (about 50% into the post).

Deleted Outlook contacts sync back

Because the phone has only a limited number of contacts (250) there's a filter dialog that can be used to tell the Gigaset QuickSync software which contacts should not be transmitted to the handset. Note that QuickSync will only load contacts that have a telephone number, so the contact count might differ from what Outlook reports.

QuickSync Contact Filter Reports 198 Contacts

Outlook Reports 219 Contacts

Nice, but today flash memory is cheaper than ever before. Why did the SL 370 product designers choose to have only 250 contacts on a 120 € phone?

One (unresolved) problem I experience with the "syncing" ability is that if you delete an Outlook contact and re-sync the previously deleted contact will be recreated in Outlook. I suppose this is a known bug. One work-around is to delete all contacts on the phone before syncing.


The SL 370 is a great phone: I adore its flyweight, the clean UI, the great battery power and the rich set of options like turning down the ringtone volume at nighttime. The weaknesses on the Windows software side should be fixed in the next release of the QuickSync.

Now Playing [?]: Sie – Ruban D'AlphaCiru catena

Neulich im Späti

Posted in Fun Stuff | NonTech at Friday, 04 January 2008 18:23 W. Europe Standard Time

Vielleicht hat's auch deswegen nicht mit dem Geschäft geklappt?


Rezept: Hähnchenschenkel mit getrockneten Feigen

Posted in Recipes (German) at Friday, 04 January 2008 18:07 W. Europe Standard Time
  • 4 Hähnchenschenkel
  • 2 rote Zwiebeln
  • 3 Knoblauchzehen
  • 3 getrocknete Feigen
  • 1 süßer Apfel
  • etwas Apfelsaft
  • Olivenöl
  • 1 TL Honig
  • Salz, Pfeffer

Zwiebeln und Knoblauch schälen und in Spalten schneiden. Den Apfel ebenfalls in Spalten zerlegen. Die getrockneten Feigen würfeln. Einen Bräter mit Olivenöl bestreichen; Zwiebeln, Knoblauch und Feigen gleichmäßig darin verteilen. Die Hähnchenschenkel salzen, pfeffern und obenauf legen, Zwischenräume mit Apfelstückchen auffüllen. 50 ml Apfelsaft aufgießen.

Den Bräter mit geschlossenem Deckel 45 min. bei mittlerer Hitze in den Ofen stellen. Anschließend den Deckel abnehmen und die Hähnchenschenkel mit Honig besteichen. Bei Oberhitze überkrusten.

Dazu passt Baguette oder Couscous mit Rosinen (hierfür die Rosinen vorher in etwas Apfelsaft aufkochen und weichen lassen).