I was able to deal with this issue, but I'm not sure it's the right
way to fix it.
By the way, the use of a wrapper had no effect so far as I could
tell. I tried using square brackets and such to fool it, and that
didn't work. If anyone knows how to make the sp_dbmmonitorupdate
procedure accept a hyphenated name, please let me know. *update* Now
we see that it's the call to DBCC DBTABLE (in a referenced proc) that
is erring.
What I did to stop the error was to edit the Database Mirroring
Monitor Job. I edited the first step so that it calls the
sp_dbmmonitorupdate procedure for each of the mirrored databases which
do not have hyphenated names. I added a second step to the job, and
pasted in the code from the sp_dbmmonitorupdate procedure, specifying
the name of the database (the one with hyphens) but after commenting
out this one line [180]:
exec @retcode = sys.sp_dbmmonitorMSgetthelatestlsn @database_name,
@end_of_log_lsn output
This is what I'm concerned about. I can't find this stored procedure
anywhere in the system, so I have no way of really knowing what it's
doing. The outputted variable, @end_of_log_lsn, isn't used anywhere
in the code. If it is actually doing something, it appears to be
ensuring that the latest LSN *can* be found, but does nothing else.
Well, there it is .. tucked away in the MSSQLServerResource database.
And the real culprit is in these lines [36-42] ..
set @command = N'dbcc dbtable(' + replace(@database_name,
N'''',N'''''') + N') with tableresults, no_infomsgs'
declare @temp table(parentObject nvarchar(255),Object
nvarchar(255),field nvarchar(255),value nvarchar(255))
-- TO DO: get correct values from SteveLi
-- DONE: They are all nvarchar(255)
insert into @temp exec( @command )
select @str = value from @temp where field=N'm_flushLSN';
This code chunk generates a command that would like something like
this ..
dbcc dbtable ( db-name )
That doesn't fly, but if you use square brackets or quotes, you're
fine. This runs ..
dbcc dbtable ( 'db-name' )
I'm thinking that if Microsoft had wanted to ensure that database
names with spaces and hyphens would process correctly, a small change
to line 36 would have worked. Here's the current line ..
set @command = N'dbcc dbtable(' + replace(@database_name,
N'''',N'''''') + N') with tableresults, no_infomsgs'
And here's the change that would resolve the issue ..
set @command = N'dbcc dbtable(''' + replace(@database_name,
N'''',N'''''') + N''') with tableresults, no_infomsgs'
At this point, I think I'm going to re-work these two procedures into
one chunk of code, and paste that into the job step for monitoring
this particular database's mirroring. It would be nice if Microsoft
would fix this in the next service pack. Seems to me that this is a
tiny detail that could easily get slipped into any update.
Aaron Bertrand [SQL Server MVP] - 10 Jul 2008 22:02 GMT
Great digging JOH. I filed a bug on your behalf, please validate and vote:
connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=355764
On 7/10/08 3:55 PM, in article
60bf2c5f-79e4-4f19-852d-785234956c1b@t54g2000hsg.googlegroups.com, "JOH"
> I was able to deal with this issue, but I'm not sure it's the right
> way to fix it.
[quoted text clipped - 57 lines]
> would fix this in the next service pack. Seems to me that this is a
> tiny detail that could easily get slipped into any update.
Aaron Bertrand [SQL Server MVP] - 10 Jul 2008 23:59 GMT
Due to more serious implications, I have marked the bug as private.
However, it seems that this issue has been resolved by CU5, which you can
get here:
http://support.microsoft.com/kb/943656
You can get more information about this specific problem here:
http://support.microsoft.com/KB/945907
JOH - 11 Jul 2008 06:03 GMT
On Jul 10, 6:59 pm, "Aaron Bertrand [SQL Server MVP]"
<ten....@dnartreb.noraa> wrote:
> Due to more serious implications, I have marked the bug as private.
> However, it seems that this issue has been resolved by CU5, which you can
[quoted text clipped - 5 lines]
>
> http://support.microsoft.com/KB/945907
Thanks!