|
|
|
Say Hey Kid
      
Group: General Forum Members
Last Login: Wednesday, September 21, 2011 4:03 AM
Points: 713,
Visits: 100
|
|
Hi Christian
You are right, I should mention that : "Service had already been enabled in db1"
Regards,
-------------------------------------------------------------------------------- Mayank Parmar Software Engineer Clarion Technologies SEI CMMI Level 3 Company 8th Floor, 803, GNFC info Tower, SG Highway, Ahmedabad - 380 054, Gujarat, India. www.clariontechnologies.co.in Email: mayank.parmar@clariontechnologies.co.in MSN : mayank.parmar@clariontechnologies.co.in Mobile: +91 9727748789 --------------------------------------------------------------------------------
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: 2 days ago @ 12:30 AM
Points: 1,788,
Visits: 3,330
|
|
| I agree with Christian, the question should have stated whether service broker was enabled or not in db1.
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Thursday, June 06, 2013 5:57 AM
Points: 557,
Visits: 1,365
|
|
Yeah good question. Knew the answer wasn't "enable" so I took a choice between "create" and "new" since I couldn't remember the syntax. I picked wrong
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Thursday, February 07, 2013 5:12 AM
Points: 509,
Visits: 182
|
|
To create a new identifier (or as I view it, reset service broker) for a restored database, yes, I would use the NEW_BROKER. However the question could have been phrased a little better; for example, there was no mention that Service Broker was enabled previously; and although the assumption could be made, you specifically asked how would you 'enable' Service Broker.
Phil
Although all answers are replies, not all replies are answers. Blog: http://philjax.wordpress.com
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 4:45 PM
Points: 5,297,
Visits: 7,240
|
|
Thanks for the question. I missed a point, but learned something new.
The reason I missed a point is because, when doing some research, I found this text: "If you attach a database with the same service broker identifier as an existing database, SQL Server deactivates Service Broker message delivery in the database being attached." (This is from http://msdn.microsoft.com/en-us/library/ms166057%28SQL.90%29.aspx). The quote specifically mentions attaching, but since the entire page is about attach and restore, I assumed that the restore behaviour would be identical. Obviously not.
Hugo Kornelis, SQL Server MVP Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Yesterday @ 6:30 AM
Points: 9,410,
Visits: 6,495
|
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Thursday, June 06, 2013 12:28 AM
Points: 132,
Visits: 126
|
|
u r right, the question was not phrased very well.
not mentioned Service broker is enabled or not db1.
when we restore database from any existing DB Backup.
we always need to 1) Enable Broker -- when Backup db is not set broker ON. 2) New Broker -- When backup db broker is ON.
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Tuesday, June 11, 2013 4:35 AM
Points: 2,673,
Visits: 729
|
|
I realized there was probably a 50% risk of getting it wrong which I did. 
Interestingly in BOL it wasn't specified whether assigning a new identifier with NEW_BROKER actually enabled the Service Broker.
Just because you're right doesn't mean everybody else is wrong.
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 8:36 AM
Points: 2,681,
Visits: 2,423
|
|
| Good question....got it wrong, but I learned something. Thanks.
|
|
|
|
|
Say Hey Kid
      
Group: General Forum Members
Last Login: Friday, April 26, 2013 11:57 AM
Points: 708,
Visits: 660
|
|
I guess I'm 'nitpick mode' on as well; backup was to disk 'D:\db1.bak' but the restore was from 'D:\main.bak', technically we have no idea what was restored
|
|
|
|