Showing posts with label disable. Show all posts
Showing posts with label disable. Show all posts

Friday, March 23, 2012

Is it possible to disable Poison Message Detection?

Hi,

I'm using the Service Broker to parallize my processes (I know that the Service Broker was not designed for that purpose), however it's working quite well.

I use the broker procedure to start procedures which all process all a part of the workload. When the procedure fails because of a lock timeout (or for that concern, for whatever reason), I rollback the transaction (which also roll back my message received on the queue so that it can be retried at a later time.). And this is where my problem lies, if there are 5 sequential rollbacks of messages then the poison message detection kicks in and disables the queue, stopping all the processing. :(

Is there a way to disable poison message detection? I have implemented my own stop-mechanism through a counter system on a per sub-task system so if I could disable poison message detection that would be ideal.

If this is not possible is there a way to turn the queue back on automatically so that it will continue processing the messages on the queue?

Cheers,
Peter.

Not sure if this helps your situation but you could do a SAVE TRANSACTION after you have received it off the queue.

Then, if whatever condition happens for it to rollback you can rollback to the save point, that way all work will be rolled back but the poison message is committed off the queue, you could also write the message to a table afetrwards, that way your queue will keep working and you can save the poison message to check them out later, and possibly put a notification trigger on the poison message table so that you know when they happen so you can check them out, hope that helps ?

Thanx

|||

In SQL Server 2005 is not possible to disable poison message support. The main problem with disabling poison message detection is that when something goes wrong and a real poison message comes into a production system, it takes the service down. We really encourage developers to avoid using rollbacks in activated procedures.

For instance, in your case, maybe is better to save the message being processed (e.g. into a table, or turn on message retention to use the queue itself w/o the need for a table) and then send yourself a timer message (BEGIN CONVERSATION TIMER with a small delay) and commit. When the timer fires a message is sent to your own service and you are going to be activated again. the activated procedure reacts to the timer message by looking up the saved message and trying to process it again. If it fails again, set a new timer ang commit. This way you can set up a more reasonable retry policy than rollback and retry immedeatly.

As about a way to turn the queue back on automatically, yes, there is a way. When a queue is deactivated, it can generate an event notification:

CREATE EVENT NOTIFICATION [QueueDisabled]

ON QUEUE [<queue name>]

FOR BROKER_QUEUE_DISABLED

TO SERVICE 'QueueDisabledServiceHandler', 'current database';

HTH,
~ Remus

|||thanx I'll look into it :)|||Remus how would I implement the automatic activation, it doesn't seem to work for me, but my q_task_detail_receive queue still gets disabled (and does not reenable)....

I have the following code for reactivation:
CREATE QUEUE q_task_detail_receive_disabled_handler
CREATE SERVICE s_task_detail_receive_disbaled_handler ON QUEUE q_task_detail_receive_disabled_handler

CREATE EVENT NOTIFICATION q_task_detail_receive_disabled
ON QUEUE q_task_detail_receive
FOR BROKER_QUEUE_DISABLED
TO SERVICE 's_task_detail_receive_disbaled_handler', 'current database';

create procedure p_enable_queues
as
begin
ALTER queue q_task_detail_receive WITH STATUS = ON
end
go

ALTER QUEUE q_task_detail_receive_disabled_handler
WITH ACTIVATION (
STATUS = ON, -- Activation turned on
PROCEDURE_NAME = p_enable_queues, -- The name of the proc to process messages for this queue
MAX_QUEUE_READERS = 1, -- The maximum number of copies of the proc to start
EXECUTE AS SELF -- Start the procedure as the user who created the queue.
);|||

Is the notification being delivered into q_task_disabled_handler?

You must RECEIVE from q_task_receive_disabled_handler in the p_enable_queues. This is a general rule for activated procedures, they must RECEIVE from the queue, even if they don't care about the message.

HTH,
~ Remus

Is It possible to disable drop database for sa or sysadmin also ?

Hello,

I would like to know is it possible to disable drop database for sa
or sysadmin. If saor sysadmin needs to drop the database , he/she may
have to change status in one of the system tables (sysdatabases ?) and
then only database can be dropped . This is to avoid dropping the
database by mistake by sa.

In books online under drop database
System databases (msdb, master, model, tempdb) cannot be dropped

I would like to know how this is implemented for system databases ?

Thanks

M A Srinivas"M A Srinivas" <masri@.vsnl.com> wrote in message
news:f7e90f78.0308160008.176fc1bc@.posting.google.c om...
> Hello,
> I would like to know is it possible to disable drop database for sa
> or sysadmin. If saor sysadmin needs to drop the database , he/she may
> have to change status in one of the system tables (sysdatabases ?) and
> then only database can be dropped . This is to avoid dropping the
> database by mistake by sa.
> In books online under drop database
> System databases (msdb, master, model, tempdb) cannot be dropped
> I would like to know how this is implemented for system databases ?
> Thanks
> M A Srinivas

Basically, no, it's not possible. A sysadmin can do anything in SQL Server,
so the best approach is to limit sysadmin membership to DBAs only. As with
any system administrator, you have to trust them to do the job properly,
based on their training, experience etc.

I don't know the mechanism that prevents system databases being dropped (I'd
guess that there may be a check in the MSSQL engine that won't drop dbid <=
4 or something similar), but there is no flag or other mechanism to prevent
someone with DROP DATABASE authority dropping user databases.

Simon|||"Simon Hayes" <sql@.hayes.ch> wrote in message
news:3f3e0eb0$1_4@.news.bluewin.ch...
> Basically, no, it's not possible. A sysadmin can do anything in SQL
Server,
> so the best approach is to limit sysadmin membership to DBAs only. As with
> any system administrator, you have to trust them to do the job properly,
> based on their training, experience etc.
> I don't know the mechanism that prevents system databases being dropped
(I'd
> guess that there may be a check in the MSSQL engine that won't drop dbid
<=
> 4 or something similar), but there is no flag or other mechanism to
prevent
> someone with DROP DATABASE authority dropping user databases.

I'd also question the utility of it.

If you're afraid of an sa purposely trying to do damage, a drop database is
the least of your worries (note normally you can't do it in any case if the
DB is in use).

If you're afraid they might do it by accident, I'd have to ask what are they
doing that the likelihood is all that high?

> Simon|||I know that database can not be dropped while in use.
Sometimes while dropping a database through EM, sa may select the
wrong database to drop by mistake.
Restoring of database from back-up takes time (depends on the size)

M A Srinivas
"Greg D. Moore \(Strider\)" <mooregr@.greenms.com> wrote in message news:<1iq%a.106647$wk4.105134@.twister.nyroc.rr.com>...
> "Simon Hayes" <sql@.hayes.ch> wrote in message
> news:3f3e0eb0$1_4@.news.bluewin.ch...
> > Basically, no, it's not possible. A sysadmin can do anything in SQL
> Server,
> > so the best approach is to limit sysadmin membership to DBAs only. As with
> > any system administrator, you have to trust them to do the job properly,
> > based on their training, experience etc.
> > I don't know the mechanism that prevents system databases being dropped
> (I'd
> > guess that there may be a check in the MSSQL engine that won't drop dbid
> <=
> > 4 or something similar), but there is no flag or other mechanism to
> prevent
> > someone with DROP DATABASE authority dropping user databases.
> I'd also question the utility of it.
> If you're afraid of an sa purposely trying to do damage, a drop database is
> the least of your worries (note normally you can't do it in any case if the
> DB is in use).
> If you're afraid they might do it by accident, I'd have to ask what are they
> doing that the likelihood is all that high?
>
> > Simon

Is it possible to disable a specific warning ?

Hi!

I'm running dtexec with the /WarnAsErrors flag, to be sure to detect any configuration warning (configuration errors are actually throwed as warning, which is not sufficient) or any other important warning.

I only get one warning (0x80047076, optimisation warning). Is there a way to disable this specific warning ?

thanks

Thibaut

You can't disable warnings in SSIS

Thanks,
Ovidiu

Monday, March 19, 2012

Is it possible to "disable" all restrictions on a Ms sql DB?

In meen. primary keys, NOT NULL, IDENTETIES...et.c

I have to do a maunally, one time, building of a database. Sometables has to
stay an some are to be exchanged. The foreignkey inforcemnt ill do for my
self so everything is correct. I just need to be allowed to de thede task
for a while. Is it impossible?

Regards
Anders"Flare" <dct_flare@.hotmail.com> wrote in message news:<3f302ad3$0$24659$edfadb0f@.dread14.news.tele.dk>...
> In meen. primary keys, NOT NULL, IDENTETIES...et.c
> I have to do a maunally, one time, building of a database. Sometables has to
> stay an some are to be exchanged. The foreignkey inforcemnt ill do for my
> self so everything is correct. I just need to be allowed to de thede task
> for a while. Is it impossible?
> Regards
> Anders

You can disable foreign keys, check constraints and triggers with
ALTER TABLE. But you can't disable primary keys, NULL/NOT NULL is
(usually) part of the column definition, and IDENTITY is a column
property, so they can't be enabled/disabled in the same way.

It's not entirely clear from your comments what problems you're having
with the import, so if you can be more specific then perhaps someone
can help.

Simon