I've search this forum and the web - tried this with and without sqlagent running and it always fails:
alter database dbname set enable_broker
I believe there are messages in queues somewhere, but have no idea how to see if and how many there are.
Maybe the broker for this database can't be enabled with too many messages in the queue?
I found code on here that was supposed to clear all message queues, but it never completes.
Anyway...someone else designed this entire system and I have no knowledge of the service broker.
I am getting this message in the SQL Server error log:
Could not start Service Broker for database id: 10. A problem is preventing SQL Server from starting Service Broker. Check the SQL Server error log for additional messages.
It appears even when the broker is disabled on the database. How can I eliminate this error?
I've got a situation where I want to put request message on a queue. Because starting a conversation is the only way to put messages on a queue I have to start a conversation with myself. So my Begin Dialog Statement looks something like this:
DECLARE @conversation_handle UNIQUEIDENTIFIER;
BEGIN DIALOG CONVERSATION @conversation_handle
FROM SERVICE [ServiceName1]
TO SERVICE 'ServiceName1'
ON CONTRACT [ContractName1]
WITH ENCRYPTION = OFF;
SELECT @conversation_handle AS ConversationHandle
I haven't noticed any problems with doing this but I wanted to know if there was anything wrong with it. Does someone know what problems this might cause?
Hello, I receive this error "The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported. Please enable the Service Broker for this database if you wish to use notifications." I attach the database in Management Studio to query and enable the broker using the scrip below but to no avail. ALTER DATABASE DataName SET ENABLE_BROKER ‘''<<------successfulandSELECT is_broker_enabled FROM sys.databases WHERE name = 'Database name' ‘'''<<-------value is 1 Global.asax ... Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) System.Data.SqlClient.SqlDependency.Start(ConfigurationManager.ConnectionStrings("dataConnectionString1").ConnectionString) End Sub...Web.config ... <connectionStrings> <add name="dataConnectionString1" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|jbp_data.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" /> <add name="ASPNETDBConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" /> </connectionStrings>... Hope you could help. cheers,imperialx
I am struggling with the position SSB could take in an SOA. If I would want a broker in the general sense, meaning an intermediary sitting between applications which exchange information through messaging, would SSB be a good candidate? I know Biztalk is probably the primary candidate, but in my scenario I would end up with Biztalk apps with empty orchestrations. Also, I think Biztalk is more expensive to manage. So I am looking for a lightweight broker for a simple SOA targeted at application interoperability, no fancy business processes in sight.
I'm trying to create a service broker on the same database...with one service and one queue. But my queue ends up with nothing in it. Here is the source...what's wrong?
Alter Database adventureworks set ENABLE_BROKER;
ALTER AUTHORIZATION ON DATABASE::[adventureworks] TO [SA];
create master key encryption by password = 'P@SSw0Rds';
CREATE MESSAGE TYPE CreateQBLetters VALIDATION = NONE
CREATE MESSAGE TYPE LetterResponse VALIDATION = NONE
CREATE CONTRACT BuildQBLetters (CreateQBLetters SENT BY INITIATOR, LetterResponse SENT BY TARGET)
CREATE QUEUE BuildLettersQueue with status=on
CREATE SERVICE CreateQBLetters ON QUEUE BuildLettersQueue
-- At this point, we can begin the conversation
DECLARE @conversationHandle UNIQUEIDENTIFIER
DECLARE @message NVARCHAR(max)
BEGIN
BEGIN TRANSACTION;
BEGIN DIALOG @conversationHandle
FROM SERVICE CreateQBLetters
TO SERVICE 'CreateQBLetters'
ON CONTRACT BuildQBLetters
-- Send a message on the conversation
SET @message = N'Hello World';
SEND ON CONVERSATION @conversationHandle MESSAGE TYPE CreateQBLetters (@message)
END CONVERSATION @conversationHandle
COMMIT TRANSACTION
END
GO
select * from sys.transmission_queue
select * from sys.conversation_endpoints
-- peek into the queue
select cast(message_body as nvarchar(max)) from BuildLettersQueue
GO
-- Receive a message from the queue
--RECEIVE CONVERT(nvarchar(max), message_body) AS message FROM BuildLettersQueue
-- Cleanup
DROP SERVICE CreateQBLetters
DROP QUEUE BuildLettersQueue
DROP CONTRACT BuildQBLetters
DROP MESSAGE TYPE CreateQBLetters
DROP MESSAGE TYPE LetterResponse
GO
-- you have to clean out the service broker first -- a conversation could be hanging around
I read the blog about service broker and database mirroring. Have you actually gotten this to work? I have a database that is mirrored. A third party vendor's software is using query notification which in turn uses service broker for dirty cache notification. Based on your blog I created a route specifying a mirror address.
And then I tried to ALTER DATABASE SET ENABLE_BROKER but it fails with a
Server: Msg 9778, Level 16, State 1, Line 1 Cannot create a new Service Broker in a mirrored database "mydatabase". Server: Msg 5069, Level 16, State 1, Line 1 ALTER DATABASE statement failed.
Is there an order to this should I have enabled servicebroker on the database and then mirrored it?
I have a database that we have running service broker. Its a web based application hitting the database. Occasionally I need to restore the database in the development environment. Every time I trie to restore I have issues because there is a service broker connection. I have tried various commands to stop it, and usually after 20 minutes I finally get it to stop and not recreate itself.
Can anyone point me to an article or provide information on the best way to stop/prevent service broker so that you can restore a database?
I tried to setup service broker to fail over to a mirror database. After the target database failed over, the message I send stays in sys.transmission_queue with no error in transmission_status. I check the mirror server log and I see the following.
An exception occurred while enqueueing a message in the target queue. Error: 15581, State: 3. Please create a master key in the database or open the master key in the session before performing this operation.
The database has the master key because its a mirrored database? Did I have to do something extra here
I am newbie in SQL Service broker. As we know, the is_broker_enabled can help us check whether the specified database is enabled for service broker. I would like to know
<>How can I enable servce broker for specified database if I see the value(is_broker_enabled) is 0?
<>How can I disable the service broker for specified database is I see the vlaue (is_broker_enabled) is 1? Do I need to dropped all service broker configration in the specified database?
We had issues with our production database which had 'broker enabled', I restored an older backup and then renamed the Prod database to ProdOld and the Backup database to Prod. We noticed yesterday that the broker service wasn't working and had the error
'The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported. Please enable the Service Broker for this database if you wish to use notifications.
' I ran the following script against the database
ALTER DATABASE prod SET ENABLE_BROKER go GRANT CREATE PROCEDURE to User
GRANT CREATE QUEUE to User GRANT CREATE SERVICE to User GRANT REFERENCES on CONTRACT::[http://schemas.microsoft.com/SQL/Notifications/PostQueryNotification] to User GRANT VIEW DEFINITION to User
And it came back with a message that the broker was already enabled. I did a disable/enable just for kicks, but we still get the same error message. I did a check on the sys.databases table and it shows that the 'is_broker_enabled' field set = 0 (should be one)
Any ideas on what's going on here? Could the rename caused the broker to become out of sync? It would be great if I could just update the bit field, but I don't believe there is an easy way of updatting the system tables.
I backed up a database "Broker", and restored it on the same instance as "BrokerQA" (Broker db still exists, I need them both running on the same instance).
I had to restore a database in one of the staging servers the other day. However, upon completion, I found out that the service broker queue in the database is not working anymore. The service broker queue error was similiar to this error: The activated proc dbo.procedure_name running on queue database_name.dbo.queue_name output the following: '<error message>.'
For developers, we often have a need to backup a production database and restore it on local or integration machines. This production database is enabled for service broker and operates at a relatively high traffic level. When the database is backed up, the size is nearly 12GB; when SET NEW_BROKER is subsequently executed on the restored database, the size goes down to about 800MB. It appears that most of this is residing in the xmit queue. So, my question is: how best to backup a production database with queues activated, etc. without ending up with a 12GB backup?
How to prevent the hang on the initator service broker if the target service broker is not started?
Our case has two service brokers (two databases), sometime, the target is need to turn off. But the sitation is the initator service broker (in fact, the message is sent from triggers) become hang, I want to prevent this case and continue to operation, and the messages should queue and will continue to send to target service broker when it startup. How should I do?
I am running Web Matrix version 0.5, .Net version 1.1 on a computer with XP Pro.
Web Matrix works fine and returns forms properly. I installed MSDE from the website (SQL2KDeskSP3a.exe) I believe that SQL Server IS running, because I see the tower icon with a green arrow; when I double-click that I get a message that it is running SQL Server.
When I click the "data" tab in Web Matrix I get the blank workspace. Then I click the New Connection icon at the top left, which opens up a dialog box. I change "Windows Authentication" to "SQL Authentication." That opens up the Username/Password prompt. I am entering "sa" for the username (I AM NOT SURE IF THAT IS CORRECT) and "**secret**" for the password (that's what I entered in the command prompt when I setup the MSDE). Then I click "Create a New Database." I am asked to enter a name. After a pause, I get an error message: "Unable to connect to the database server. SQL Server does not exist or access denied. Connection Open (Connect ( )). OK
I am trying to restore SQL2K DB backup to SQL2005 Express. The process goes fine, but at the end of the process (100% progress), it shows error Restore Could not start database.
It does not provide more detail to remedy the error.
Hi everyone I have been trying hard to unserstand the way my isp does things sort of a communication gap I guess. The problem is I want to use the personal website... yes I know this is a SQL forum and that is what I am going to get at. I having a problems with the database aspect of the whole situtation, I can't creat a aspnetdb.mdf on their server because that name aready exists and I am assuming that it is the system and not a user that ows it. Also I can't name the other database personal.mdf either for the same reasons, so someone at the isp has had me creat a different name database during the install process of the application and that worked fine for a little while and now it does not work no more and I am getting old faster than I'd like. So here is my plan my plan is to wipe out the current database for the application on my workstation but first make a list of tables and then create a new database for that web application. So I ask is it feasible and what do I have to look out for and if it is not to much to ask what steps might take to accomplish such a task. I want to thank anybody that is willing to help me in this matter. DKB
Hello, I was wondering if someone could help me answer this question.
If I had a site like Yahoo, that constantly had users accessing it. Would it be a good or bad idea to automatically open a database connection to SQL Server on Application Start? What would you recommend? Would opening and closing the DB connection on every page save alot of overhead and bottleneck? Thank You.
I dont know how this happened but my (local) SQL Server wont start. I cant access any of the databases. I just get this error:
'A connection could not be established to (local).
Reason: SQL Server does not exist or access denied. ConnectionOpen (Connect())
Please verify SQL Server is running and check your SQL Server registration properties (by right-clicking on the (local) node) and try again.'
If I go to check the properties I get the same error. Im completely locked out. I looked at the folder and the database files are there, but I cant get to them through Enterprise Manager.
I have no idea how this problem could have happened. It just seemed to have stopped working. All my other databases can be reached (they are external). Could this be a virus or something? Can someone help me out on this one? I dont have a clue what the problem is, much less how to fix it.
I'm trying to migrate a compensation database from Access 2010 to SQL 2014. It's not a very large database. It has 12 tables. One table, the Wage table, has information in it that I wouldn't consider as being a wage. For example, it has a few Life Policy columns. I want to design the database correctly in SQL, and not just duplicate the design flaws from Access.
I just installed SQl Server 2005 on my Windows XP Pro system. But I can't figure out how to start the Database Engine. In the MS SQL Server Management Studio I see one Database Engine, but not SQL Servers. If I do "Update Local Server Registration" nothing happens. If I do right-click "New Server Registration" I get a databse icon with a white open circle. If I the try "right-click, Connect, Object Explorer" I get "An error has occurred while establishing a connection to the server...". All this time the right Summary pane is showing "No Server Connection."
The tutorials are no help and do not function as they describe.
Sample databases install but do not show up in program list as they are supposed to.
How do I start up my SQL Server Database Engine with a new database?
I am hoping someone can help me. I am having issues changing the service account MSSQLSERVER. I changed it to Local System only due to issues installing Service Packs up SP2 Critical. I used the Configuration tool to do so. I have installed all patches up to and including Critical update ( KB 934458 ). I had a heck of a time getting them to install under custom service accounts. Now when I change the service accounts back to a custom account using the configuration tool the service wont start at all.
To be clear. The service runs fine under Local System Account, but I want to run it under a limited account. I used the config tool and made sure the permissions groups were added, but it still fails to start. I am not sure what SSL log entries below is referring to.
I am running:
SQL Server Standard Edition x86 Windows 2003 Stnd SP2
Below is the log file: 2007-09-01 23:50:16.15 spid9s Starting up database 'model'. 2007-09-01 23:50:16.20 Server Error: 17190, Severity: 16, State: 1. 2007-09-01 23:50:16.20 Server FallBack certificate initialization failed with error code: 1. 2007-09-01 23:50:16.20 Server Unable to initialize SSL encryption because a valid certificate could not be found, and it is not possible to create a self-signed certificate. 2007-09-01 23:50:16.21 Server Error: 17182, Severity: 16, State: 1. 2007-09-01 23:50:16.21 Server TDSSNIClient initialization failed with error 0x80092004, status code 0x80. 2007-09-01 23:50:16.21 Server Error: 17182, Severity: 16, State: 1. 2007-09-01 23:50:16.21 Server TDSSNIClient initialization failed with error 0x80092004, status code 0x1. 2007-09-01 23:50:16.21 Server Error: 17826, Severity: 18, State: 3. 2007-09-01 23:50:16.21 Server Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately preceding this one in the error log. 2007-09-01 23:50:16.21 Server Error: 17120, Severity: 16, State: 1. 2007-09-01 23:50:16.21 Server SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.
I am not DBA or very heavy IT, but rather a developer wearing multiple hats, for the time being. So any help is greatly appreciated.
Hi, I have a MSSQL database running in a Microsoft cluster. I was working on troubleshooting for another SAP problem when they suggested I change the setting using hte SQL Server Client Network Utility to 'named pipes' from 'tcp/ip'. Every since, despite changing it back I'm unable to start the database in the cluster.
I'm kind of a newbie at this so I'd really appreciate any help in getting this database up and running.
Here is the error message from the event log: sqsrvres] checkODBCConnectError: sqlstate = HY000; native error = 0; message = [Microsoft][ODBC SQL Server Driver]Cannot generate SSPI context
I tried to apply the SP2 on a newly installed SQL Server 2005 Developer edition. The installation failed and the MSSQLSERVER service does not start. I work on 32 bits Windows Server 2003 Standard Edition SP1 with all the patches up to date. I downloaded SQL Server 2005 SP2 on March 15, 2007.
Here are the error messages from 2 of the log files:
Summary.txt:
Product : Database Services (MSSQLSERVER) Product Version (Previous): 1399 Product Version (Final) : Status : Failure Log File : C:Program FilesMicrosoft SQL Server90Setup BootstrapLOGHotfixSQL9_Hotfix_KB921896_sqlrun_sql.msp.log Error Number : 29534 Error Description : MSP Error: 29534 Service 'MSSQLSERVER' could not be started. Verify that you have sufficient privileges to start system services. The error code is (-2146885628) Cannot find object or property.
SQL9_Hotfix_KB921896_sqlrun_sql.msp.log:
Doing Action: ComponentUpgradeInstall PerfTime Start: ComponentUpgradeInstall : Sun Mar 18 17:37:33 2007 <Func Name='ComponentUpgradeInstall'> <Func Name='ComponentUpgrade'> Failed to add file 'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLLOGERRORLOG' to datastore in AddFileToFailureHandling Service MSSQLSERVER with parameters '-r' is being started at Sun Mar 18 17:37:33 2007 Failed to start service MSSQLSERVER. Error code 2148081668 Service failed unexpectedly (2148081668) Error Code: -2146885628 Windows Error Text: Cannot find object or property. Source File Name: sqlsetuplibservice.cpp Compiler Timestamp: Wed Jun 14 16:29:04 2006 Function Name: sqls::Service::Start Source Line Number: 301
And below you can see the content of the SQL error log:
2007-03-18 19:46:11.51 Server Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86) Feb 9 2007 22:47:07 Copyright (c) 1988-2005 Microsoft Corporation Developer Edition on Windows NT 5.2 (Build 3790: Service Pack 1)
2007-03-18 19:46:11.51 Server (c) 2005 Microsoft Corporation. 2007-03-18 19:46:11.51 Server All rights reserved. 2007-03-18 19:46:11.53 Server Server process ID is 796. 2007-03-18 19:46:11.53 Server Authentication mode is WINDOWS-ONLY. 2007-03-18 19:46:11.53 Server Logging SQL Server messages in file 'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLLOGERRORLOG'. 2007-03-18 19:46:11.53 Server This instance of SQL Server last reported using a process ID of 712 at 3/18/2007 5:39:48 PM (local) 3/18/2007 3:39:48 PM (UTC). This is an informational message only; no user action is required. 2007-03-18 19:46:11.53 Server Registry startup parameters: 2007-03-18 19:46:11.53 Server -d C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDATAmaster.mdf 2007-03-18 19:46:11.53 Server -e C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLLOGERRORLOG 2007-03-18 19:46:11.53 Server -l C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDATAmastlog.ldf 2007-03-18 19:46:11.56 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required. 2007-03-18 19:46:11.56 Server Detected 2 CPUs. This is an informational message; no user action is required. 2007-03-18 19:46:11.87 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required. 2007-03-18 19:46:11.98 Server Attempting to initialize Microsoft Distributed Transaction Coordinator (MS DTC). This is an informational message only. No user action is required. 2007-03-18 19:46:14.06 Server Attempting to recover in-doubt distributed transactions involving Microsoft Distributed Transaction Coordinator (MS DTC). This is an informational message only. No user action is required. 2007-03-18 19:46:14.06 Server Database mirroring has been enabled on this instance of SQL Server. 2007-03-18 19:46:14.07 spid5s Starting up database 'master'. 2007-03-18 19:46:14.15 spid5s 1 transactions rolled forward in database 'master' (1). This is an informational message only. No user action is required. 2007-03-18 19:46:14.17 spid5s 0 transactions rolled back in database 'master' (1). This is an informational message only. No user action is required. 2007-03-18 19:46:14.17 spid5s Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required. 2007-03-18 19:46:14.37 spid5s SQL Trace ID 1 was started by login "sa". 2007-03-18 19:46:14.42 spid5s Starting up database 'mssqlsystemresource'. 2007-03-18 19:46:14.50 spid5s The resource database build version is 9.00.3042. This is an informational message only. No user action is required. 2007-03-18 19:46:14.89 spid5s Server name is 'YODA'. This is an informational message only. No user action is required. 2007-03-18 19:46:14.89 spid9s Starting up database 'model'. 2007-03-18 19:46:15.06 spid9s Clearing tempdb database. 2007-03-18 19:46:15.67 spid9s Starting up database 'tempdb'. 2007-03-18 19:46:15.79 spid12s The Service Broker protocol transport is disabled or not configured. 2007-03-18 19:46:15.79 spid12s The Database Mirroring protocol transport is disabled or not configured. 2007-03-18 19:46:15.82 spid12s Service Broker manager has started. 2007-03-18 19:46:21.62 Server The server could not load the certificate it needs to initiate an SSL connection. It returned the following error: 0x8009030d. Check certificates to make sure they are valid. 2007-03-18 19:46:21.62 Server Error: 17190, Severity: 16, State: 1. 2007-03-18 19:46:21.62 Server FallBack certificate initialization failed with error code: 1. 2007-03-18 19:46:21.62 Server Unable to initialize SSL encryption because a valid certificate could not be found, and it is not possible to create a self-signed certificate. 2007-03-18 19:46:21.64 Server Error: 17182, Severity: 16, State: 1. 2007-03-18 19:46:21.64 Server TDSSNIClient initialization failed with error 0x80092004, status code 0x80. 2007-03-18 19:46:21.64 Server Error: 17182, Severity: 16, State: 1. 2007-03-18 19:46:21.64 Server TDSSNIClient initialization failed with error 0x80092004, status code 0x1. 2007-03-18 19:46:21.64 Server Error: 17826, Severity: 18, State: 3. 2007-03-18 19:46:21.64 Server Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately preceding this one in the error log. 2007-03-18 19:46:21.64 Server Error: 17120, Severity: 16, State: 1. 2007-03-18 19:46:21.64 Server SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.
I am not able to start the sql server 2005 database engine services...
Sql server 2005 server is installed in one machine(SERVER) and we have 10 client machine connecting to the server
When i try to start the service from the Service.msc in the SERVER i am getting the following error
===================================
Cannot connect to KEYSKILL.
===================================
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)
Today we were trying to use restore wizard (recovery advisor) to restore a database which is over 80 GB, but the wizard won't load or start. However the wizard dialog box opens without any problems with all other databases stored in the instance. Is there any problem or reason to why the restore wizard won't come up?
This is SQL 2012 enterprise version we are running.