SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Preserve trace flags between server restarts
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bassem_farouk
Starting Member

11 Posts

Posted - 12/11/2009 :  22:17:22  Show Profile  Reply with Quote
Hi
i am doing deadlock detection flags
dbcc traceon (1204 , -1)
dbcc traceon (1222 , -1)

i want to reservef those flags between server restarts.

i want to make sure that this is persistent , i may forget to start using
the -T flag
1-any other way to do it ?
2- also is trace flags overload a busy server?

Thanks

tkizer
Almighty SQL Goddess

USA
28518 Posts

Posted - 12/11/2009 :  22:25:59  Show Profile  Visit tkizer's Homepage  Reply with Quote
To preserver the deadlock trace flags after a restart, you must set it up as a startup parameter using the -T switch. Using the DBCC command only lasts until SQL Server is restarted. So when you want it to happen in the current session as well as future sessions, you issue the DBCC command and also setup the trace flag.

Please see BOL for details.

I don't see any issues with overloading the server for just the deadlock trace flag. We have it enabled on many of our systems, some of them even see a few thousand queries per second.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

bassem_farouk
Starting Member

11 Posts

Posted - 12/11/2009 :  23:01:37  Show Profile  Reply with Quote
Thanks very much
i think i need to script the sqlserver cmmand with -T , so if i restart the server after 1 year, i will forget which flags was on for sure.

Thanks
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
28518 Posts

Posted - 12/11/2009 :  23:10:08  Show Profile  Visit tkizer's Homepage  Reply with Quote
You don't need to script it, although you can for documentation purposes, as you can find it in the SQL Server Configuration Manager.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

GilaMonster
Flowing Fount of Yak Knowledge

South Africa
1825 Posts

Posted - 12/12/2009 :  04:11:25  Show Profile  Visit GilaMonster's Homepage  Reply with Quote
You don't need both 1204 and 1222. On SQL 2005 and 2008, the information that traceflag 1222 returns is a superset of the information that 1204 returns. Just use 1222 on SQL 2005/2008 and just use 1204 on SQL 2000.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000 Version 3.4.03