Will ALTER DATABASE ... SET NEW_BROKER Retain Structure?

Oct 3, 2006

I am considering the use of ALTER DATABASE ... SET NEW_BROKER within an existing Service Broker instance. The reason is that I have about 23 million old endpoints in Service Broker that I am unable to clean up using the standard END CONVERSATION loops that have been discussed on these forums previously. It's a busy database, and it just cannot do the job within a reasonable timeframe.

There are no critical conversations to be lost, becuse the majority of the old endpoints deal with ASP.NET SQL caching, so they are disposable.

I have read that using the ALTER DATABASE command will delete all past endpoints, but I haven't seen much in the way of the retention of the existing message framework.

If I execute ALTER DATABASE ... SET NEW_BROKER, will it retain everything I have setup, including security, message types, contracts, services, queues, etc.? Is there anything, other than the old conversations and endpoints, that is deleted?

Thanks very much!

View 5 Replies


ADVERTISEMENT

Impact Of ALTER DATABASE GPx SET NEW_BROKER WITH ROLLBACK IMMEDIATE In Production Db

Feb 20, 2007

System Configuration :
OS : Windows 2003 latest SP
SQL Server : Standard Edition, SP2
Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86)
Feb 9 2007 22:47:07
Copyright (c) 1988-2005 Microsoft Corporation
Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 1)

DownTime : This is not a 24x7 kind of machine. It can have downtime

Reference : http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1198044&SiteID=1
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1026884&SiteID=1

I have been discussing this Service Broker issues in this forum for quite sometimes and sorry to bother u all again€¦ To make things more clearer before implementing in production environment I have few doubts and it should be clarified..

As discussed in the first link we can clear sys.conversation_endpoints by just giving ALTER DATABASE GPx SET NEW_BROKER WITH ROLLBACK IMMEDIATE. But my apprehension is that if we run this command on production server and it truncate this table€¦ what will be the impact and overall overhead on the system€¦ Is it recommended to give this statement on Production Server daily at less traffic times, to clear this table ?€¦ will it have adverse effect. I repeat I have downtime , I can even shutdown this server daily€¦

I also, just want to know why Microsoft has not looked into this aspects€¦ why the system itself is clearing the expired messages.. What is the thought behind this architecture

I have the script to run in batch€¦ but in high-level meetings it is always difficult to convince this architecture/process€¦


Thanks in advance

View 5 Replies View Related

Alter Table Structure

May 9, 2008

have the following table:


RecordKey MonthYear SD1 SD2 SD3
1 Jan 2008 6 AA 0
2 Feb 2008 10 BB 3
3 Mar 2008 12 CC 8

etc....



I need to transform it to this:


1 2 3

Jan 2008 Feb 2008 Mar 2008
6 10 12
AA BB CC
0 3 8



Can this be done in SQL?

View 1 Replies View Related

Transact SQL :: Dynamically Alter Schema Of Stage Table When Source Table Structure Changed?

Oct 25, 2015

we have a table in our ERP database and we copy data from this table into another "stage" table on a nightly basis. is there a way to dynamically alter the schema of the stage table when the source table's structure is changed? in other words, if a new column is added to the source table, i would like to add the column to the stage table during the nightly refresh.

View 4 Replies View Related

SET NEW_BROKER Statement Hangs System

Feb 7, 2007

SQL Version - SQL Server 2005 Standard Edition, SP 1

I have a database which is Broker Enabled. We use Query notification extensively and the application is in testing stage. Both Testing and development database is on the same server. When I create database for testing I used to do Backup-restore method. When i restore a borker enabled database, the restored database and the source database will have same GUID for Broker. So by default the restored database will not be broker enabled. So what I do is , i run

Alter database somedatabase SET NEW_BROKER.

This statement will generate new GUID for this database and then we can enable the Broker by SET ENABLE_BROKER statement. Till last week this process was working fine. When I did the same thing yesterday the Alter database somedatabase SET NEW_BROKER query was runing for whole night and it could not complete the process.
What SET NEW_BROKER internally does as per BOL is

NEW_BROKER
Specifies that the database should receive a new broker identifier. Because the database is considered to be a new service broker, all existing conversations in the database are immediately removed without producing end dialog messages.
When I checked the Conversation in the database there were millions of rows.
My question is , can I do the same process in a better way and how. Is there any way to clear Conversation in a faster method. I googled , but I could not find a better solution.


pse help

Madhu

View 15 Replies View Related

Set New_broker When The Activated Stored Procedure Changes.

Sep 4, 2007

Hi I have a couple of questions to understand better Service Broker..

Every time I alter the activation Stored Procedure on the receiving queue I also execute the:
alter database set new_broker rollback

1) can somebody explain me in a detailed way why I have to do that? what happen inside SQL Server when there is a Stored Procedure activated on a queue??
Also link to white papers, resouces on so on are appreciated.

My Activation Stored Procedure calls other stored procedure.
2) If ONLY one of the nested stored procedures changes I have to execute the command:
alter database set new_broker rollback ???

I think that the answer to the first question will answer the second one..

Thank you for any helps!
Marina B.

View 3 Replies View Related

After Set New_broker, It Works For Half Hour And Don;t Work Anymore, Please Advise, Thanks!

Sep 10, 2006

I use ASP.NET 2.0 and SQL 2005, the SQLCacheDependency didn't work stable for me, it usually works and after a while, it stops working. Recently, It doesn't work. Today I reset service broker by

Alter DB set new_broker

It seems all work, but too early to be happy, it doesn't work now anymore. I don't see any record in

sys.transmission_queue

And I don't see new entries in

sys.dm_qn_subscriptions neither when I modify a record which bind to SQLCacheDependy.

I see some errors in log like


Message
The query notification dialog on conversation handle '{8F8CC642-6340-DB11-8F09-0014227B7B80}.' closed due to the following error: '<?xml version="1.0"?><Error xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8490</Code><Description>Cannot find the remote service &apos;SqlQueryNotificationService-f79776f7-9ca5-4c5f-8a66-0d81f7673683&apos; because it does not exist.</Description></Error>'.

Any idea how to find out the problem?

thanks!

View 1 Replies View Related

Cache Database Structure (How To Detect If Database-design Has Changed..)

Feb 24, 2006

Hello everyone,I have a webcontrol that uses database-structures alot, it uses the system tables in SQL to read column information from tables. To ease the load of the SQL server I have a property that stores this information in a cache and everything works fine.I am doing some research to find if there are anyway to get information from the SQL server that the structure from a table has changed.I want to know if a column or table has changed any values, like datatype, name, properties, etc.Any suggestions out there ?!

View 3 Replies View Related

Copy Sqlce Database Structure To Sqlserver Database

Jan 6, 2008

Hi,
I have a complicated sql server mobile database (.sdf) and need to create a SQL SERVER database with the same tables. How can I do it without scripting the whole thing? I thought of using the views.information_schema databases, but it is still a lot of coding.

thanks

View 3 Replies View Related

Granting Permission To A Database User To Alter Database Role

Sep 5, 2006

I want a database user to be able to alter login, database user and database role from my application. so, i assigned that user to sccurityadmin server role, db_accessadmin and db_securityadmin database roles....By now, the user can add or remove login and database user. However, the user cannot add or remove any database role membership. What am I missing here?? What should I do so that the user can create, and alter database roles in the database??

View 1 Replies View Related

SQL Security :: ALTER DATABASE Failed Because A Lock Could Not Be Placed On Database

Jul 20, 2015

I have a script that automates some db drop/restore operations and bringing the database to single user mode is part of it: ALTER DATABASE ... SET SINGLE_USER WITH ROLLBACK IMMEDIATE...I want this to executes under a login, that has restricted privileges, so I've created a login and granted it a dbcreator role + ALTER ANY DATABASE privileges.

Problem: When I run the script against a database with an active/sleeping connection:It fails when using the restricted login: "Msg 5061...ALTER DATA BASE failed because a lock could not be placed on database ..."It completes successfully when using a sysadmin login According to stackoverflow.com the solution is to kill the active/sleeping connections to the database, before ALTER-ing it, which works fine, but the question is....

Questions: Why the "ALTER DATABASE..." statement works under the sysadmin login, but not under a dbcreator one?Does this mean the sysadmin login kills the connections to the target database in the background?Is it possible to grant additional privileges to the restricted login, so the "ALTER DATABASE..." statement won't need preventive killing of the connections?

View 5 Replies View Related

Database Mirroring Hangs On ALTER DATABASE SET PARTNER

Jun 26, 2005

Hi,

View 6 Replies View Related

Database Structure

Sep 25, 2007

Hello I am a final year student and for my final year project I have decided to try and create a price comparison website due to the fact that i feel it would be a good project to work on and develop my technical skills in C# and microsoft sql server 2005, since these are mainly the two programs I would say i have more experience with. Basically I want to create a website such as www.pricerunner.com. At this point in time i have started playing around with how i feel the database will look, in terms of tables and columns, below is what i have produced;
Company                                
 Company_ID
Company_name
ADDRESS
 Website link
 contact 
Products
Product_ID
Product_name
Product_Category
Product_Price
 
I am now stuck as how i will link each company with a product bearing in mind a company will stock different categories of products, also do you think i need any more columns in any of the above tables, as well as am i missing out on anything, I am hoping someone with more knowlegde than myself can shed some knowledge on my problem, thank you.

View 5 Replies View Related

Getting SQL Database Structure From Here To There

Aug 10, 2005

I'm sure there is a simple way to do this but I cannot think of it.I have an ASP.NET application that I am publishing to a webhost. I have chosen to use FTP to copy my files (aspx, etc.). They work as far as links etc. Now, the next step is to create my SQL database on their server as they instruct, which I have done in name only. (Oh, if it makes a difference, I access the hosting service using Plesk control panel.) Is there any simple way to get my database structure from my PC to the host server? All responses welcome. Thanks.

View 5 Replies View Related

Database Structure

Oct 9, 2001

Hi All,
I need to get some info on how I can get the script of the entire database stucture. I need to write a procedure to do this. I know in SQL Server I could get the script in a mouse click. But I need to write a procedure to do the task. Is there a package in SQL Server that I could use to accomplish this task?
Any thoughts will be of help.
Thanks in advance.
sj

View 1 Replies View Related

New Database Structure

Sep 2, 1999

I am very new to SQL server, and am completely stumped here. I need to transfer the data from an old database to a new one (both SQL Server 6.5 DBs.) The only problem is that the database has been restructured, and I can't for the life of me figure out how to get the data imported. I am working on manually making all of the structure changes, but there must be a better way. Any ideas? Thank you SO much!

Jeff

View 1 Replies View Related

Database Structure

Nov 1, 2004

This is a sort of database structure question that could I guess apply to any type of database...

Say I have 4 production lines and I want to log serial numbers on the start of every line and off the end of every line.

Is there any advantage in having a separate table for each Production Line and serial number logging point? (i.e. t_Line1Start, t_Line1End, t_Line2Start etc) or is it just the same as having one big table and having a LineNumber field and a StartEnd field?

Is SQL Server just as happy dealing with fewer transactions to several tables as it is to many transactions to one table?

View 1 Replies View Related

Database Structure

Apr 9, 2008

Hi,
I have a question. I want to build a db for the following entities:
drivers
cars
companies

each driver nay has a car (NULL or carId)
each driver belongs to company
each car belongs to company

The db structure I built is:
car(carId, companyId)
driver(driverId, companyId, carId)
company(companyId)

The problem is that in this structure driver from company a can have a car from company b.

but this situation is not possible.. How can I prevent such situation??

tnx

View 14 Replies View Related

SQL Database Structure

Jul 8, 2006

Is there a way I can copy my SQL 2000 database including procedures, views tec. the whole works but not the data in any table.

I want to share with a relative a copy of my application (web based) he has his own SQL 2000 server but I do not want to give my data just the database so the application will run and he can start inputting his own data.

How can I do this like a backup which has everything but with no data.

I tried scripting it using the EM but it did not give me everything just the system db's

Thanks

Xavier

View 3 Replies View Related

Database Structure Q:

Jan 11, 2008

I'm designing a web application that acts as business management software for many small autobody shops. This method was chosen because it creates a central point of administration for the software and I believe that a properly configured cluster of services will meet performance requirements. Using SQL Server 2k5 as my backend, I need to structure my DB(s) so that performance and size are kept to a minimum.

That being said, the first problem I encounter is in creating a structure that supports multiple businesses, each with their own unique dataset.

For example, each business will have work orders specific to their business. This necessitates a uniqueness constrained by businessID (hereafter titled "BizID") and WorkOrderID (WoID). The first solution I happened on was the simplest: A composite primary key composed of BizID (int) and WoID (int). The unfortunate consequence of this, as I soon realized, was that *every* table containing multiple business' data would need this composite key structure. The second problem with this method is that there is no such thing (to my knowledge) as a composite identity. I could identify WoID as the identity column, but it would not iterate WoID for BizID x properly if any other Biz added a work order to the table. (i.e. biz 1 adds three work orders (identitied 1, 2, 3), biz 2 adds one work order (would identity as 4) and Biz 1 adds another (would identity as 5), leaving us with 1, 2, 3, 4, 5 across two businesses, rather than 1, 2, 3, 4 for biz 1 and 1 for Biz 2)

The second idea I considered was one DB per business. I didn't consider that for very long, since I assumed size considerations would be blown out of the water if I had 50 business and 50 DBs. I could be wrong, as I am decidedly a novice at this. It does benefit from not putting all my eggs in one basket though and makes backup/recovery/troubleshooting much simpler.

The third idea I considered was one table per business. This suffers from the same issues as #2 above with not as many of the benefits.

Both ideas 2 and 3 would need a master table relating logins to the DBs they belong to, which would not be hard to implement at all, but the implications of using this method are unknown to me.


So quite obviously, I'm a novice at this. Perhaps I took a project on that was too big for my britches, but just getting out of college puts me in a good place to take a risk and I will learn a great deal from putting a complex (is it so?) system like this into action.

I appreciate any and all responses, thanks in advance for your replies!

-Devin

View 5 Replies View Related

How To Compare Structure Of Two Database ?

Oct 3, 2006

I have one databaseand I create new database by copy everything from first db I then alter some column on new database and now I would like to compare two databaseHow can I do it ? 

View 4 Replies View Related

Advice On Database Structure

Jun 4, 2007

 I am thinking of doing a fake PC company site for my ASP project. so
what they will have is a chat, products with reviews, and users can
have "Buddies".So my DB so far (Tables):ProductPC - ID, Processor, RAM, HDD, Graphics, LCD ...ProductHardware
- ID, Title (Like "Intel C2D E6600"), Description, Price, Rating (0-5
stars, so integer), Category (CPU, HDD, Graphics)ProductSoftware - ID, Title (eg. "Adobe CS3"), Description, Price, Rating, Category (eg. Design, Programming)Reviews - ID, ProductID, Title, Content, DateChat - ID, TopicID, Title, Content, DateUsers - ID, Username, Password,The problem, how do i connect Reviews to the products since they are from diff tables.How do i get the "buddy" system workingChat i think its not as simple as thatBut i just need a simple ASP project, so no need to get too complex, but i still hope to learn as much.

View 12 Replies View Related

Webzine Database Structure

Nov 26, 2007

Hey,
 I havent been working with databases for quite a while but now im in charge of creating a rather powerful website with webzine (online magazine) among other things. Within this magazine there are several different categories of articles such as concerts, album reviews, interviews, product reviews etc etc which obviously recquire rather differently structured tables. Multiple images are going to be uploaded to all articles and users are going to be able to comment on all the articles. Since the comments and image tables dont differ between the articles i would much rather store all comments for example in the same table, but wont i get relationship problems? Perhaps I could have a column referring to a certain kind of article, and then a second column with the id of that specific article? Or is the best way simply to have a seperate image and comment table for each set of articles?

View 4 Replies View Related

Database Table Structure

Jan 29, 2008

Hi i have a student table and also an societies table,  and a student can belong to as many societies as possible, for example student John Taylor belongs to the Football society, rugby societey and dance society, where as student Jim Jenkins belongs to the Football society, rugby society, arts society and graphics society.
My tables so far look like this;
STUDENTS; student_id, student_name
SOCIETIES;  society_id, society_name
 
My question is how can i make the scenario above reflect in my table structure, would i need to create another table, if so what fields or columns should i place in this new table, thank you.

View 7 Replies View Related

Database Structure Question

Mar 31, 2008

Hello all!
I'm working on an application that requires a bit of tricky database development, and I was hoping to get some advice from you.
The best way to describe the application, is to use an example, and the best I can think of is Facebooks news feed, where you can see if any of your friends have become friends with other members, or joined any groups, if your friends have completed quizs, attended any meetups, got arrested at the weekend etc etc..
My application is similar, but requires a lot less features. It will only tell show you if any of your friends have become friends with other members, or joined any groups (example: your friend Dave is friends with Jane).
Currently in my database, I have... users table (that holds a list of registered users) friends table (that links users who have decided to become friends with other users)groups table (that holds different groups)user_joined_groups table (that links users to groups they have decided to join).
Its simple and it works fine.
So to get around the newsfeed problem, I thought of doing this, creating 2 new tables. The first table will hold the news type and give it an ID...
NewsTypeTable============NewsTypeID       NewsType1                       NewFriend2                       JoinedGroup
The next table will be FriendsNewsTable, and everytime a user joins a group, or makes a friend with another user, details are added in here...
FriendsNewsTable=============NewsID        NewsTypeID     FriendID       newFriendID         newGroupID         datecreated1                       1                   225                 156 2                       2                   95                                              52
Ok, so above in the FriendsNewsTable, the first record shows that the user has made friends with someone, and the second record shows that a user has joined a group. I though that this approach might work. but then I though... If I have 20 friends, that means I am going to have to search with each one through FriendsNewsTable, which could contain 30,000 records (wishful thinking!) So this is bound to make the page crawl to say the least.
So does anyone have any advice how I should go about this?
Thanks!
Matty
 
 

View 4 Replies View Related

Database Code Structure

Apr 26, 2008

What method would you suggest is the best way to deal with a website?

Say for example, writing SQL. Am I better using Stored Procedures and adding methods for accessing there or just writing the SQL inline. What do you think about this? Is it totally overkill to use stored procedures in a small website?  

View 6 Replies View Related

Database Structure And Presentation

May 14, 2008

I'm trying to design a site for parent conference scheduling.
Usually we have a couple of days appointment time, for example 5/8/2008, and 5/9/2008. and the time usally start at 7:00 and ends at 9:00. one appointment time lasts about 20 minutes.
I would put a page something like this, after parent or student login, 1. they are asked to choose a date, 2.after the date is chosen, show available teacher names, 3, after the teachers are selected, for each teacher, it will show a list of radio buttons for parents to select the time period open, For example: 
 teacher: John smith. time: 7:00; radio button        7:20 radio button        7:40 Booked...............        8:40  radio button       
4, the student choose the available time, and then enter student name, then submit.
I would like to know how to setup the database table and present to the users. Currently for this scheduling part I have tables like teachertable, scheduling table, Appointment table.
Teacher table: teacherID, name, email, course,Scheduling table: appointD, TeacherID, room, appt date
I think I will prepopulate the two tabels before conference time.
 and after user submit the selection, insert into Appointment table the other fields like scheduling ID, appoint time, and studentname.
The things confuse me, is how can I deal with the appointment time fields, shall I add another table for appt time? should this field be prepopulatd to the table and pull from the table for student to select or something else?
HOw can I do with this: if a teacher not available after 8, how can I excluded the time period for the teacher?
 Thanks
 
 

View 1 Replies View Related

Database Menu Structure

Sep 30, 2005

Hello,I am upgrading my (simple) cms from one menu layer to two layers. So i have two tables in de my DB- table_mainmenu- table_submenuThe submenu records are linked to the mainmenu records on the mainmenu id. So far so good. Heres my problem, i cant figure out how to change the order of the pages...!? What is the theory behind recording the stacking order of the menu items? How can i record this information in the DB?I just need the theory, i can figure out the details for myself. Thanks in advance!Corstiaanp.s. is the the right forum to post this?

View 4 Replies View Related

Logging Changes To The Database Structure

Dec 27, 2000

Hi all!

I have a friend who is a contract developer working remotely for a company on a SQL Server + VB project. He is having difficulty because someone at the company is making changes to the database tables without informing him, and of course then there are numerous application errors. This has happened far too many times for him to dismiss it. Examples of these changes are changing field names, deleting fields, changing datatypes, even changing the server name. My question is does SQL Server automatically log changes to the database, and if so, how can this log be read?

Thanks!

Lia

View 3 Replies View Related

Copy Database Structure

Apr 13, 2000

Can anyone tell me;

Is there anyway to copy an entire database structure (layout of column definitions and character formatting)?

Or do I have to delete the relationship, then the child first?

For testing purposes, if I screw one up, I would like to be able to start with another copy.


Thanks

View 2 Replies View Related

Copy Database Structure

Nov 1, 1999

Hi all,

I want to copy a production database schema to an archiving database, only
the structure : tables, views, defaults, rules,UDTs. For achieving that
I am trying to use SQL/DMO functions, "CopyAllTables" for example. My script works with no error but unfortunately the destination database
contains no objects. Why, have I missed something ?
Does anyone know how to do that?

Many thanks for your help

Regards,
Herve

hmeftah@aol.com

View 1 Replies View Related

SQL Database Structure Question

Jul 23, 2005

Hi.We have a .NET programmer using our SQL server. The database is roughly8GB at this point, full of all of our inventory, payroll data, etc. forrunning reports.This is on a dual-xeon 3.2Ghz, 4GB DDR, 3x15k RPM SCSI RAID-5, gigabitethernet, etc server.Yet, every once in a while it slows to an absolute crawl. IIS6 is thefront-end, and its limited to a web garden with 4 threads. However,sometimes only 1 processor does any real work, even when multiplepeople are running reports.Blocking is NOT a problem, however I've seen 300,000+ locks/secrequested occasionally (not waiting or anything like that, justopened).Cache hit ratios are roughly 99%.One issue that I suspect is that the programmer is using varchar(50)for EVERY column in EVERY table (except unique keys).My question: In this configuration, would varchar(50)s be the cause ofthe awful slowdowns?I know its all cached in memory, but on these older xeons (533fsb,DDR266) the memory subsystem could be better. If we are pulling THATmuch excessive data on an already congested bus (since its dualintels), would it cause a dramatic slowdown?The reports we run are highly intensive, but usually do not take afraction of the time that they do when the server exhibits thesebehaviors.I really could use anyone's input on the matter. I've read onlineguides, 2 performance optimization books, and seemingly created optimalindexes, but none of that has led me to a real solution.ThanksMortrek

View 6 Replies View Related

Export Database Structure

Feb 15, 2007

Hi,is there a way of exporting database structure not the data in it?Thanks.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved