Resources for IT Professionals > Forums Home > Lync Server Forums > Planning and Deployment > OCS 2007 R2 with SQL 2005 database mirroring failover?

Proposed Answer OCS 2007 R2 with SQL 2005 database mirroring failover?

  • Tuesday, May 26, 2009 5:39 PM
     
     
    We have OCS 2007 Enterprise Edition installed fine and with the databases mirrored to a backup server/location.  I'm testing our environment for a potential disaster, including losing our primary SQL server (SQL 2005).  I fail the databases over and update the backend pool to the backup SQL server name, but we cannot connect via Office Communicator and I see this error on the OCS server:

    OCS User Services, error category 1006, event id 30962:
    ************
    Connection to back-end database succeeded, but failed to execute registration stored procedure on the back-end. This error should not occur under normal operating conditions. Contact product support.

    Back-end Server: databkp Database: rtc Sql native error: 515 Connection string of:
    driver={SQL Native Client};Trusted_Connection=yes;AutoTranslate=no;server=databkp;database=rtc;
    Cause: Possible issues with back-end database.
    Resolution:
    Ensure the back-end is functioning correctly.
    ************

    Can anyone shed some light on this SQL 515 error?  Thanks in advance!

    -Erik
    • Moved by Matt Sousa - MSFT Thursday, December 17, 2009 2:06 AM forum migration (From:OCS Setup & Deployment)
    •  

All Replies

  • Tuesday, November 03, 2009 8:03 PM
     
     Proposed Answer

    We have located the problem it is a stored procedure that has a bug, the procedure expects a creation date and a restore date for both the RTC DB and the rtcdyn DB then then tries to insert those values in to corresponding tables in both DB's in a field that does not allow nulls, this causes the Proc to fail if a restore date does not exist for either one.

    Procedture is
    [RTC].[dbo]


    .[RtcpLinkStaticAndDynamicDatabases]

    we are planning on opening a bug fix with MS.

    line number 77 and 101 addinng the following will bypass the issue (Unsupported should be removed once you are back and running)

    Line 77
    where t.StoredDbName = N'rtc' and t.Value is not null

    Line 101
    where t.StoredDbName = N'rtcdyn' and t.Value is not null


    See the following Snippets:

    update dbo.DbConfigDateTime
    set Value = t.Value
    from @DbTime as t
    inner join dbo.DbConfigDateTime as st on (st.Name = t.ValueName)
    where t.StoredDbName = N'rtc' and t.Value is not null

     
    update rtcdyn.dbo.DbConfigDateTime
    set Value = t.Value
    from @DbTime as t
    inner join rtcdyn.dbo.DbConfigDateTime as dt on (dt.Name = t.ValueName)
    where t.StoredDbName = N'rtcdyn' and t.Value is not null

    • Proposed As Answer by newportl Tuesday, March 23, 2010 3:40 PM
    •  
  • Wednesday, November 04, 2009 4:41 PM
     
     
    That's fantastic!  It worked for me, yes, thanks so much for your reply.  I would only add that the line numbers I altered were 77 and 96, not 77 and 101, for that SP.  I saved the alter script for the original SP, so I can roll it back before another hotfix comes out for OCS.  THANK YOU for your help with this!
  • Tuesday, March 23, 2010 3:40 PM
     
     
    Worked for us too.  Thanks!

    Luke Newport
  • Wednesday, September 29, 2010 8:22 PM
     
     

    We had this issue today after installing Windows Updates and rebooting both Frontend and Backend.

    The solution proposed by Jason solved the problem!

    Thanks a lot!

  • Friday, November 12, 2010 9:54 AM
     
     
    Yes, this also fixed our issue tonight after patching.  Another thread to bookmark!!!
  • Thursday, September 08, 2011 12:36 AM
     
     

    We're having a similar issue but with error number 601. I've tried a million different things aside from restoring the database, which may be next. I tried editing the procedure and I *think* I edited the right lines 77 and 105 for me. Changed:

     

     

        delete dbo.DbConfigDateTime

          from @DbTime as t

         where dbo.DbConfigDateTime.Name = t.ValueName

           and t.StoredDbName = N'rtc'

           and t.Value is null

    to:

     

        delete dbo.DbConfigDateTime

          from @DbTime as t

         where dbo.DbConfigDateTime.Name = t.ValueName

           and t.StoredDbName = N'rtc'

           and t.Value is not null

     

    and 
        delete rtcdyn.dbo.DbConfigDateTime
        from @DbTime as t
        where rtcdyn.dbo.DbConfigDateTime.Name = t.ValueName
        and t.StoredDbName = N'rtcdyn'
        and t.Value is null
    to:
        delete rtcdyn.dbo.DbConfigDateTime
        from @DbTime as t
        where rtcdyn.dbo.DbConfigDateTime.Name = t.ValueName
        and t.StoredDbName = N'rtcdyn'
        and t.Value is not null

    Not sure if that's where the modification is supposed to go. Any clarity here? Anyone else get a 601 error?

  • Thursday, September 08, 2011 4:05 PM
     
     
    In case it helps anyone else, I resorted to restoring the database from a backup from prior to the issues (presence unknown for all users, address book not updating, the event above but with error code 601) and all issue have resolved. The puzzling thing is, none of the servers had been updated or rebooted for over a week (all were shut down in preparation for power outages expected from Irene) having been started on 8/28/11 and the issues didn't show up until 9/4/11 or 9/5/11. Very odd, but, it seems something chewed up the databases or permissions inside them. No idea what caused it. So far, it doesn't seem like any of the other databases unrelated to OCS have been affected. I restored all 5 databases (accdyn, rtc, rtcab, rtcconfig, rtcdyn) from the same backup time. Hopefully this helps someone else.