Monthly Archives: April 2013

Database Mail issues on SQL Server 2008

On a SQL Server 2008 (SP3) Express Edition I tried sending an E-Mail using the Database Mail feature. I kept getting an error message in the Server Logs (use Management Studio and browse to Management\Server Logs in the Object Explorer on the left side) when trying to send an E-Mail:

Exception Type: Microsoft.SqlServer.Management.SqlIMail.Server.Common.BaseException
Message: The read on the database failed. Reason: Fehler beim Laden von 'Msxmlsql.dll'.
Data: System.Collections.ListDictionaryInternal
TargetSite: Microsoft.SqlServer.Management.SqlIMail.Server.Objects.QueueItem GetQueueItemFromCommand(System.Data.SqlClient.SqlCommand)
HelpLink: NULL
Source: DatabaseMailEngine

I could resolve this issue by coping the files …\Microsoft SQL Server\msxmlsql.dll and Microsoft SQL Server\Resources\1033\msxmlsql.rll to the SQL Server instance folder Microsoft SQL Server\MSQL10.[INSTANCE]\MSSQL\Binn.

Linux: Trace file system activity of a process

To trace file system activity of a process the Linux utility strace can be used. strace traces all system calls, but using the -e trace=file option gives a nice output about file system activity of a given process. This gives a similar output to the SysInternals Process Monitor which I used sometimes on Windows.

In order to use the utility for a multithreaded program (like Java) the -f parameter helps too. Using the output of strace (blue text) I could manage to find a missing file which crashed a Java program:

 [pid 5997] open("/home/sag/My Documents/BookSmartData/log-2013.04.11-00.29.57.txt", O_RDWR|O_CREAT|O_EXCL, 0666) = -1 ENOENT (No such file or directory)
 java.io.IOException: No such file or directory
 at java.io.UnixFileSystem.createFileExclusively(Native Method)
 at java.io.File.createNewFile(File.java:947)
 at com.blurb.booksmart.util.vent.Vent.writeLogFile(Vent.java:388)
 at com.blurb.booksmart.util.vent.Vent$ExceptionHandler.handle(Vent.java:369)
 at com.blurb.booksmart.util.vent.Vent$BookSmartThreadGroup$1.run(Vent.java:510)
 at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
 at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:727)
 at java.awt.EventQueue.access$200(EventQueue.java:103)
 at java.awt.EventQueue$3.run(EventQueue.java:688)
 at java.awt.EventQueue$3.run(EventQueue.java:686)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
 at java.awt.EventQueue.dispatchEvent(EventQueue.java:697)
 at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
 at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
 at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)