Automatically Enable Broker After Restore Or Attach
Aug 22, 2007
Is there a way to automatically enable Service Broker on SQL Server 2005 Express Edition after a database has been attached or restored?
My initial idea was to check if broker is disabled whenever the client application starts and enable it from there but the problem with this is that the current user might not have the required permissions. So now I'm looking for another way to enable it right after restore/attach if at all possible. Any ideas would be appreciated.
View 3 Replies
ADVERTISEMENT
Dec 21, 2006
Hi All,
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?
Thanks in advance.
Michael
View 5 Replies
View Related
Feb 16, 2008
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
View 1 Replies
View Related
Apr 16, 2008
Here's the scenario -
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.
Thanks in advance
View 3 Replies
View Related
Aug 31, 2006
I'm having problems enabling service broker for DB Mail on a SQL 2005 cluster, when I try to execute this sql it just hangs. Any ideas?
USE master ;
GO
ALTER DATABASE AdventureWorks SET ENABLE_BROKER ;
GO
View 10 Replies
View Related
Nov 5, 2007
Hello, everyone:
I want to move a database instance (about 50 user databases) to another server, both are running SQL Server 2000. Which method is better, retore from backup files or detach/attach? Some papers said restore amybe cause incorrect login and password transfer. Is it true?
Thanks
ZYT
View 5 Replies
View Related
Feb 15, 2008
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?
View 4 Replies
View Related
Aug 19, 2002
First, let me say that I have already reviewed information posted by experts within the chat area.
Someone completely deleted my SQL Server 7 database. I retrieved the .LDF and .MDF files from a network backup. Now I am trying to attach the database. I have tried this without creating an instance of the database by using the attach stored procedure to attache the .LDF and .MDF files I retrieved from the network backup. Also, I have tried it by creating an instance of the database and doing a detach of the newly created db .LDF and .MDF files and an attach of the .LDF and .MDF files I retrieved from the network backup. Neither of these approaches have worked.
Here is what I have tried in the Query Analyzer, but to no avail:
For the following example, I created a database instance called 'qarun_diamond_48_brett' with brand new .ldf and .mdf files and then tried to detach and then attach the .ldf and .mdf files from the network backup:
use master
go
sp_detach_db
'qarun_diamond_48_brett', 'F:APPSSQL 7.0DatabaseDataqarun_diamond_48_brett_log.ldf'
Message: Usage: sp_detachdb <dbname>, [TRUE|FALSE]
use master
go
sp_detach_db
'qarun_diamond_48_brett', 'F:APPSSQL 7.0DatabaseDataqarun_diamond_48_brett.mdf'
Message: Usage: sp_detachdb <dbname>, [TRUE|FALSE]
I tried the following attaches of the retrieved/recoverd .ldf and .mdf from the network to the newly created db instance. That didn't work, so I tried attaching to a db that had not yet been created.
use master
go
sp_attach_db
'qarun_diamond_48_brett2', 'F:APPSSQL 7.0DatabaseDataqarun_diamond_48_brett2_log.ldf'
Message: Server: Msg 1801, Level 16, State 3, Line 1
Database 'qarun_diamond_48_brett' already exists.
If I use a different db name I get the following error:
Server: Msg 5105, Level 16, State 13, Line 1
Device activation error. The physical file name 'qarun_diamond_48_brett' may be incorrect.
use master
go
sp_attach_db
'qarun_diamond_48_brett2', 'F:APPSSQL 7.0DatabaseDataqarun_diamond_48_brett2.mdf'
Message: Server: Msg 1801, Level 16, State 3, Line 1
Database 'qarun_diamond_48_brett' already exists.
I have also tried these statements wtih the EXEC sp_attach_db and EXEC sp_detach_db commands from within the Master db in Query Analyzer.
Any help would greatly be appreciated.
Thanks,
-Brett
View 2 Replies
View Related
Apr 13, 2003
Database Restore & Attach Error
I have a problem with restoring or attaching DB files from different version of the engine. I Have a existing SQL server 7.x and another one is SQL 2000 but I try to backup my database and restore it into the 2000 engine This is the following Problem which occurs :-
1st Problem : During Restoration, The restoration process was runing fine until it reach the last inficatior tab and it fail and say Database terminated abnormal. I been try to restore into other machine also but it give me the same problem.
2nd Problem : Say I can't restore but I stop the engine and manual copy the *.mdf and *.ldf to another machine. I try to restore it but it "is on a network device not supported for database files." So what shall I Do with it.
Pls Advise If anything need to be done before I do the restoring and anything need to be done in both 7.x and 2000 Engine.
:confused:
View 1 Replies
View Related
May 25, 2006
I have an (as yet hypothetical) order entry system. Order data is entered into DB1 and processed in DB2. SSB is used to send the order (order header and detail) via a conversation group. DB1 goes down due to a HDD failure, and is restored from backup. What options do I have for re-processing order dialogs/conversations that were ended just before DB1 went down but do not exist in the restored version of the DB? Or lets say DB2 went down and was restored instead. Order dialogs that are not yet ended in DB2 may have already been ended before it went down, but now do not exist in DB2 after the restore.
Is there a way to restart the conversation from a certain point in time to recover order data that is out of sync due to the failure/restore? A similar scenario might be when restoring production dumps into a test environment; if the dumps are slightly out of sync I'd need to reprocess any messages that were not in sync then the dumps were created.
Thanks!
View 1 Replies
View Related
Jul 7, 2004
Hi,
I was having problems on myt PC so i did a fresh installation. However I had backed up my SQL database (I only have the MDF file and not the log file).
I have tried restoring and attaching options but nothing works :(
I also get the error saying
"Can not open backup device.... Device error or device off-line. See the SQL server error log for more details. RESTORE database is terminating abnormally".
Please this is urgent. WIll be VERY grateful for your urgent reply.
View 7 Replies
View Related
Jul 7, 2004
Hi,
I was having problems on myt PC so i did a fresh installation. However I had backed up my SQL database (I only have the MDF file and not the log file).
I have tried restoring and attaching options but nothing works :(
I also get the error saying
"Can not open backup device.... Device error or device off-line. See the SQL server error log for more details. RESTORE database is terminating abnormally".
Please this is really urgent. Will be VERY grateful for your urgent reply.
View 13 Replies
View Related
Jun 19, 2007
Hi,
I've got a question regarding attaching/restoring of DBs and wonder if anyone could help me out.
Does SQL Server 2000 provide a functionality to attach/restore DB automatically? ie, some kind of polling service to attach/restore DB that were detached previously?
Thanks
Danny.
View 6 Replies
View Related
Aug 29, 2007
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?
Thanks.
View 3 Replies
View Related
Mar 20, 2014
We have 5 databases which will sum up to 8+TB, housed in our EDW server. We are planning to migrate to another storage system for better performance.
I am planning Full backup and Differential backup and detach the DB and restore the DB in the new storage system.
Or should I detach,copy the data and log file and attach the files, will this approach have any advantages ?
View 5 Replies
View Related
Jul 15, 2006
I'm trying to see the differences between Backup/Restore and Attach/Detach. I backup and detach a database from SQL Server 2000 SP3 and then attach and restore it to SQL Server 2005 SP1.
The differences I noticed are:
1. The restored database has a much larger initial size (database size is same) for data and log.
2. The attached database has a last backup date
3. If the backup is restored over a database, the restored database is showing owned by the database owner of the database restored over but syslogins and sysusers do not match.
I don't understand why #1 happens.
Are there any other differences between Backup/Restore and Attach/Detach?
Thanks,
Peter
View 2 Replies
View Related
Apr 4, 2015
I am working towards automating the process of testing our backups. For the meantime, I do it all manually - I copy the backup files (full + transaction logs) to our test server and then run the restore script. Once database restored I run the DBCC CheckDB. The results of checkdb I manually upload to our Sharepoint portal as proof that the backup file is intact with no errors.
here are some ideas I have but have not yet tested:
Create a maintenance plan with each 3 jobs:
--> Powershell script to copy the files from Prod server to Test server - add this scrip to Job1
--> Powershell script to restore databases files - add this script to Job2
--> Run the DBCC in powershell (yet to find if possible in PS) - add this script to Job3
I would like to use seperate jobs as to get a report on the duration and status of each job
Would also like to get the results of the DBCC Checkdb as proof that no errors were found for upload to our Sharepoint portal. Dont know if possible via the job.
View 8 Replies
View Related
May 7, 2008
Hello there,
I've some really big problems with SQL Server 2005 Express. I Recently, I had 2 instances on my machine, one was a SQL Server 2000 Developer and the other a 2005 Express Version. The 2000 version was not necessary anymore, so I unstalled it, since then, the Express version keeps having probems.
Under the Server Properties -> Database settings -> Database Locations I've changed the path to D:sqldatamssql, but now, the programm always takes the "C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLData" to store and load the databases, no matter what I do.
And there are more problems see here:
Restoring does not work=======================
I wanted to restore a database called "fw40_admin" from a backup file (.bak), but that didn't work at all, it always says this as an error:
"System.Data.SqlClient.SqlError: The operating system returned the error '5(error not found)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'D:sqldatamssqlfw40_admin.mdf'. (Microsoft.SqlServer.Express.Smo)"
But as soon as I type in the installation path "C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLData" inside the "Restore As" under "Options", it works.
Why does the backup only work in "C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLData", BUT the database locations under the server properties is indicated with "D:sqldatamssql"????
Attaching does not work=======================
Attaching an existing database does not work either. Most databases (mdf) are located on the path D:sqldatamssql, but as soon as I press
Attach Databases -> Add
The dialog window appears with the "D:sqldatamssql" path, but it is unable to find any *.mdfs altough THERE ARE .mdfs in this directory. But Express can find databases in the selected installation: "C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLData".
Why can't Express see the directory on the D: partition???
What is wrong? Here? Can anybody help me?
View 5 Replies
View Related
Nov 21, 2007
An attempt to attach an auto-named database for file C:WebApp_Dataaspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
My web.config file, the connection strings
<connectionStrings>
<add name="POAdatabaseConnectionString1" connectionString="Data Source=sss;Persist Security Info=True;Initial Catalog=POAdatabase.mdf;Integrated Security=SSPI" providerName="System.Data.SqlClient" />
</connectionStrings>
I cann't really find the statement for attaching aspnetdb.mdf. I don't where to find it. Is there any other web.config file in the C drive? Thanks for help!
View 3 Replies
View Related
Apr 5, 2007
Hi,
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 look forward to some responses.
Kind regards,
Neeva
View 2 Replies
View Related
Sep 10, 2007
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?
View 3 Replies
View Related
Oct 29, 2015
While migrating Report services in SQL Server 2005 to 2014, I am trying to restore the Encryption Key in RS Configuration Manager in2014. But I cannot click the 'Restore' button in RS Configuration Manager. So if I should be grant more right to do so or any other action?
View 2 Replies
View Related
Dec 31, 2014
In Windows Server 2012. How do I do a System Restore to a previous restore point?I need to install the 64 bit and 32 bit Oracle Client Install for connections in SSIS and to create Oracle Linked Servers.
If you make a mistake it is not fun removing it. Sometimes it corrupts the machine and it is difficult to uninstall since there is not an Oracle Universal installer for Oracle 11g.If you install the 32 bit before the 64 you mess up the machine.how to create a restore point.
View 6 Replies
View Related
Jun 25, 2015
I am looking for a SQL Backup/Restore tools which can restore multiple environments. Here is high level requirements.
1. We have 4 DBs, range from 1 TB - 1.5 TB Each Database. When we restore to QA, DEV, or Staging, we usually restore 4 of them.
2. I am looking for the speed to complete restoring between 1 - 2 hours for 4 DBs.
I am evaluating the Dephix Software but the setup is very complex and its given us a lot of issues with Windows Authentions, and failure in the middle of the backup. I used Guess Software many years ago but can't find it on the web site any more. Speed is very important for us mean complete restoring as fast as possible. We are on SQL 2012 and SQL 2008 R2.We are currently using NETAPP Technology and I have Redgate Backup Tool but I am mainly looking for fast Restore Process.
View 4 Replies
View Related
Feb 1, 2007
I have a SQL 2005 database and am running the 2.0 framework. I cannot seem to enable SQL caching on the db. I'm using the command line tool as follows:
C:WINDOWSMicrosoft.NETFrameworkv2.0.50727>aspnet_regsql -S 99.99.999.999 -Uwebteam -P sa -t tblname -d dbname -et
Enabling the table for SQL cache dependency.
.An error has happened. Details of the exception:The database 'dbname' is not enabled for SQL cache notification.
To enable a database for SQL cache notification, please use the System.Web.Caching.SqlCacheDependencyAdmin.EnableNotifications method, or the command line toolaspnet_regsql. To use the tool, please run 'aspnet_regsql.exe -?' for more information.
C:WINDOWSMicrosoft.NETFrameworkv2.0.50727>
I've replaced the ip address, dbname and tblname with ficticious names for obvious reasons here in the post.
What command can I enter to enable the database for caching?
View 4 Replies
View Related
Feb 28, 2005
Hi evryone
I have two databases. one is bayan and other is clearance. clearance was already there. i created new bayan. both database having same things. such table ,views.
both contains arabic and english records.
when i try to fetch records from clearance table as arabic it is working
the query is like:
select * from customers where cust_name_araibc='here arabic text'
it is working fine
but same query i try with bayan databses it runs but it doesnt display any records.
So is there anything like to enable languages in sql server databses.
Please reply soon
Its very urgent.
thanx in advance
View 4 Replies
View Related
May 14, 2008
hi
i have backup of transaction log of database but tracnscation log check box is desable ho i can enable this
View 3 Replies
View Related
Oct 24, 2007
how do i enable logs on a DTS on sql server2005?
Thanks
Peleg
Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
View 1 Replies
View Related
Mar 3, 2008
I have to disable index using
alter index empind on emp diable;
but how to enable
alter index empind on emp enable;/its not working
View 1 Replies
View Related
Mar 8, 2008
All, I am using SSIS in sqlserver. I wanted to enable logging in SSIS. I just want to log all the activities in the log file. How can i enable logging in SSIS? I would appreicate if any one could answer for this. thanks in Advance.
View 1 Replies
View Related
Jul 23, 2005
Hi!I know that you can enable/disable a trigger through the altertable command. Once a trigger is disabled, is there a wayto determine whether it is disabled or enabled? I see there is astatus column in sysobjects ...is that what I should be using?thanks in advance for any helpKaren
View 1 Replies
View Related
Nov 30, 2006
Hello,
I understand that SQL2005x64 bits ignore AWE enable in SQL because it can address all the memory without having to use AWE. How about 32 bits SQL2005, does it support AWE enabled??
View 1 Replies
View Related
Sep 28, 2006
Hi Folks,
I was testing my error handling and purposefully failed some messages. Automatic posion message detection kicked in and disabled my queue. I tried the following, one at a time to enable it again but it doesn't work:
ALTER QUEUE MigrationQueue WITH STATUS = ON;
ALTER QUEUE MigrationQueue WITH STATUS = ON, ACTIVATION (STATUS = ON);
I would have thought the first line would've worked but I get the following when trying to receive...
The service queue "MigrationQueue" is currently disabled.
Help.
View 6 Replies
View Related