Tuesday, 20 April 2010

MS DTC Problems With Oracle Linked Server & Windows 2008 x64 R2 Cluster (Server: Msg 7391, Level 16, State 1)

If you are getting this error (Server: Msg 7391, Level 16, State 1) trying to run a transaction using a linked Oracle server then I may have the fix you're looking for. I had to troubleshoot a problem with a new Windows 2008 Enterprise R2 x64 cluster today that was a real pain.

To get things ready normally you need to at least do the following:
  • install the Oracle drivers & reboot
  • set "allow in process" on the provider in SQL
  • ensure the default DTC is the clustered resource
  • enabled DTC for network access and set correct authentication.

Normally things would work at this point. No such luck today though! No matter what I did I couldn't get a specific stored procedure a user wrote to without firing off the "unable to enlist" error. Other DTC transactions worked just fine.

The solution was simple (but tricky for non-Oracle DBAs); I had to install the "Oracle Services for Microsoft Transaction Server 11.1.0.7.0" service and reboot.
Now, I *could* have re-written the query but since it was already working on another QA box and the user is going to be re-working the whole solution shortly I didn't see much point. Plus I wanted to know HOW or IF it could be made to work on this cluster! ;)

Hope this helps someone else out there!
-A

Monday, 29 March 2010

FreeNAS Magic Sauce: Getting Transmission to play nice with Samba

I love my FreeNAS setup. I can download torrents on it faster than with my Windows boxes and it's about as close to "set it and forget it" as it gets. Love it.
I did have one problem though. From some reason transmission got in the habit of downloading files with permissions that let me read them but not write or modify. It would get worse if I tried to move them around via Samba.
As I'm not keen on running scripts to constantly do the same thing (like reset permissions) over and over again with little regard for what they're doing I found another solution. Tell Samba how to behave!
Adding these commands to the "Auxillary Parameters" of the CIFS/SMB config will make all your problems go away. Is it secure? Probably not. Is my network secure? Yes. Good.
force group = wheel
force user = transmission
Bounce the service and you'll never have permission problems again! :)

Wednesday, 24 February 2010

Subaru Parts

I like to shop around for parts. For quality I'll only go with OEM or a recognized aftermarket brand. When it comes to filters oil, fuel WIX is a well known company that makes an excellent product.
What some people may not know is that NAPA Gold parts are just re-badged WIX products.
Here's an example using some common filters on a 2002 Subaru WRX (the apply on most WRX's from the 90's - 2006 as well as SAABurus 05-06)
Oil Filter - NAPA Gold - 1365 (WIX# 51365)
Fuel Filter - NAPA Gold - 3558 (WIX #33558)
Cabin Air Filter - NAPA Gold - 4485 (WIX #24485)

So there you go, now you know you can pick up a quality WIX filter locally nearly anywhere in North America. :)

Thursday, 4 February 2010

SQL Code: Object Location Within Data Files

I'm doing a lot of playing around with different numbers of data files and performance right now and in doing that I'm moving data around files and filegroups alot.
One of the things I find maddening is when I *think* I've moved all the data only to find that a filegroup still isn't empty. You check tables, indexes, indexed views, heaps, all look like they're in the right spot. That's why I wrote the query below. It will show exactly what data is where in your database. It's helpful for tracking down LOB_DATA that doesn't move with the rest of your table data :)

SELECT
OBJECT_NAME(object_id) AS obj_name
,p.rows
,au.type_desc
,au.used_pages
,au.data_space_id
,mf.name AS [file_name]
,mf.physical_name
,mf.state_desc
FROM sys.partitions p
JOIN sys.allocation_units au
ON p.partition_id = au.container_id
JOIN sys.master_files mf
ON au.data_space_id = mf.data_space_id
AND mf.database_id = DB_ID()
ORDER BY obj_name, au.data_space_id;