October 29, 2006 at 7:22 pm
Hi guys,
I need an advice on how I can set this governor cost limit option for certain users or roles that is accessing my database. I know that I can use the sp_configure to configure it machine wide or set it manually just for that session, but I can do that automatically using some sort of logon trigger to set it. We have a problem with developers sometimes running long queries locking our live database and want to do a problem prevention here.
Appreciate your help.
Thanks.
October 30, 2006 at 10:25 am
Much easier to implement a rule that developers DO NOT USE THE PRODUCTION DB for development. They should use a development DB to do development. You should crack down on access and eliminate this - unless, of course, you feel no responsibility as a DBA for your database.
Thank-you,
David Russell
Any Cloud, Any Database, Oracle since 1982
October 30, 2006 at 10:55 am
SET PROTECT_PRODUCTION_DATA_INTEGRITY_MODE ON
Developers running queries in production ??? That implies that they are 'developing'. A rather severe violation of protocols.
SET EXTREMIST_MODE ON
Solutions:
SET EXTREMIST_MODE OFF
SET PROTECT_PRODUCTION_DATA_INTEGRITY_MODE ON --> this setting should be ON at all times !
RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."
October 30, 2006 at 10:59 am
Rudy and David are right on target;
You KNOW it is only a matter of time before one of your developers runs an UPDATE or DELETE statement against production as well; whether they do it against critical data or something innoculous is irrelevant; you should lock them out immediately and make them restore a copy locally for testing;
a developer promising he won't use the production database anymore is just a lie. change passwords , drop users, lock them out. Now.
I'll bet a dollar they are connecting as SA or as an Administrator and not as a role with db_datareader only.
Lowell
October 30, 2006 at 11:44 am
SET PROTECT_PRODUCTION_DATA_INTEGRITY_MODE ON --> this setting should be ON at all times !
Thanx Rudy, I hadn't laughed that much in a long time. Not that it's funny topic but if you could just say the face I imagined when I read that line (angry DBA with lasers in the eyes).
October 30, 2006 at 11:52 am
Glad to help brighten your day !
RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."
October 30, 2006 at 5:24 pm
I have the developers put into a role which is assigned the SELECT for tables only. However, that too put the tables into a LOCK situation when new members are not aware of the long / expensive queries they are running.
No solution or alternative to this?
Thank you.
October 30, 2006 at 6:25 pm
Unfortunatley unlike Oracle, SQL Server does not have native features for query governor on a login basis. We could however setup a job to query sysprocesses and kill anything process belonging to a developer if it is longer than a set threshold and then schedule the job to run once a minute.
October 31, 2006 at 2:39 am
Setup read-only copy of production for developers to run their queries against.
October 31, 2006 at 9:19 am
If you set up an additional database for developers to execute 'read only' queries on the same production server you may have issues other than locking. These might include overall system slow down due to additional load and potentially tempdb size issues. Then there is the process of refreshing the database. How up to date does the 'read only' information have to be ?
Your best option still is to get the developers off of the production server. Put the 'read only' copy on a develoment server.
RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."
October 31, 2006 at 10:24 am
"Put the 'read only' copy on a development server."....that is what I implied...I was expecting an element of mind-reading
October 31, 2006 at 10:30 am
Sorry Andrew ... it was a late night for me and I forgot my 'swami' headdress today
RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."
November 1, 2006 at 2:59 pm
I can't help but feel you've got earplugs on, or just selective hearing.
Either way you are just not listening. Having developers actively querying the production server is a no-no.
The potential for pain for all is enormous - escpecially when compared with the cost of getting them on a separate development box so the only people they get in the way of is themselves.
Class = DB101
Lesson 1 = "Do NOT let developers near the production box - period'
You should be listening to the advice of these wise people.
November 1, 2006 at 6:36 pm
not fixing an issue like this could cost you your job. The great thing about posting here at SSC is you can build off of other's experience, and avoid the major gotcha's that others have already tripped over. Everyone here is giving you sound advice to get developers off of production;. Take advantage of the advice! Everyone is speaking from experience.
Imagine the president of the company is updating some accounting information that it took him a while to data enter; he ends up getting a time out error because one of your developers has a lock on a table due to a long running query. the data he entered could be lost.
Other Users's Transactions can be rolled back or timed out, even if the developers have read only access because they are accessing data.; you already stated that it is a known issue about long running queries.
Why? here's a typical example: developer is going to update some table from another; he does a select * from sometable, just to see/confirm the spelling of the column names, not realizing the table has 14 million rows or something.
goos luck!
Lowell
Viewing 15 posts - 1 through 15 (of 16 total)
You must be logged in to reply to this topic. Login to reply