Enable SQL Server Broker taking too long

前端 未结 4 1652
广开言路
广开言路 2020-12-12 12:14

I have a Microsoft SQL server 2005 and I tried to enable Broker for my database with those T-SQL:

 SELECT name, is_broker_enabled FROM sys.databases 
 -- che         


        
相关标签:
4条回答
  • 2020-12-12 12:14

    Enabling SQL Server Service Broker requires a database lock. Stop the SQL Server Agent and then execute the following:

    USE master ;
    GO
    
    ALTER DATABASE [MyDatabase] SET ENABLE_BROKER ;
    GO
    

    Change [MyDatabase] with the name of your database in question and then start SQL Server Agent.

    If you want to see all the databases that have Service Broker enabled or disabled, then query sys.databases, for instance:

    SELECT
        name, database_id, is_broker_enabled
    FROM sys.databases
    
    0 讨论(0)
  • 2020-12-12 12:21

    Actually I am preferring to use NEW_BROKER ,it is working fine on all cases:

    ALTER DATABASE [dbname] SET NEW_BROKER WITH ROLLBACK IMMEDIATE;
    
    0 讨论(0)
  • 2020-12-12 12:24

    http://rusanu.com/2006/01/30/how-long-should-i-expect-alter-databse-set-enable_broker-to-run/

    alter database [<dbname>] set enable_broker with rollback immediate;
    
    0 讨论(0)
  • 2020-12-12 12:30
    USE master;
    GO
    ALTER DATABASE Database_Name
        SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE;
    GO
    USE Database_Name;
    GO
    
    0 讨论(0)
提交回复
热议问题