Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Sql profiler

Author  Topic 

dineshrajan_it
Posting Yak Master

217 Posts

Posted - 2010-04-20 : 05:16:51
i have created a trace in sql profiler for finding out errors alone. like foreign key conflict, sntax errors, user errors like that. I have passed the error information to table and not to trc file. will it affect performance. since i have included only Error Log under Error& warning events i think it wont affect performance. any suggestions pls and also for trace table i have created a trigger which sends mail to admin.

thanks in advance

Iam a slow walker but i never walk back

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2010-04-20 : 05:50:06
Don't run traces via the profiler GUI to a table. It's got the highest overhead and worst impact of all possible trace options. If you're tracing a busy production server, don't use the profiler GUI at all, rather use a server-side trace and write to file on a fast local drive.

Yes, it means that the errors won't go immediately to an admin, but is it required that an admin be contacted immediately?

--
Gail Shaw
SQL Server MVP
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-04-20 : 12:46:36
http://weblogs.sqlteam.com/tarad/archive/2008/08/06/SQL-Profiler-best-practices.aspx

Instead of tracing for exceptions, we instead have the application log the event and then email us.

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

Subscribe to my blog
Go to Top of Page

dineshrajan_it
Posting Yak Master

217 Posts

Posted - 2010-04-21 : 02:14:00
hi thanks,

the prob is that not all errors get logged in sql server error log file. so i have used this approach. i have used sp_altermessage to log the error but it throws error. so i have used this approach of Sql server side trace and using a job for each day.

quote:
Originally posted by tkizer

http://weblogs.sqlteam.com/tarad/archive/2008/08/06/SQL-Profiler-best-practices.aspx

Instead of tracing for exceptions, we instead have the application log the event and then email us.

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

Subscribe to my blog



Iam a slow walker but i never walk back
Go to Top of Page

dineshrajan_it
Posting Yak Master

217 Posts

Posted - 2010-04-21 : 02:25:00
Thanks i have applied sql server trace

quote:
Originally posted by GilaMonster

Don't run traces via the profiler GUI to a table. It's got the highest overhead and worst impact of all possible trace options. If you're tracing a busy production server, don't use the profiler GUI at all, rather use a server-side trace and write to file on a fast local drive.

Yes, it means that the errors won't go immediately to an admin, but is it required that an admin be contacted immediately?

--
Gail Shaw
SQL Server MVP



Iam a slow walker but i never walk back
Go to Top of Page

dineshrajan_it
Posting Yak Master

217 Posts

Posted - 2010-04-21 : 06:07:37
hi everyone,

After creating server side trace and logging the errors to file, and using

SELECT *
FROM ::fn_trace_gettable('C:\ErrorTrace.trc', DEFAULT)

but the problem is Textdata column shows like "Invalid object name '%.*ls'.", "Incorrect syntax near '%.*ls'.". but what i need is the table name where the error occured.

any solution. Thanks in advance

Iam a slow walker but i never walk back
Go to Top of Page

stobe
Starting Member

1 Post

Posted - 2011-02-17 : 07:44:42
quote:
Originally posted by tkizer

http://weblogs.sqlteam.com/tarad/archive/2008/08/06/SQL-Profiler-best-practices.aspx

Instead of tracing for exceptions, we instead have the application log the event and then email us.

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

Subscribe to my blog



That is not a well written article on best practice. All it does is state some rules as though they are commandments and makes no effort to justify or explain them. I know DBAs who are very good at quoting best practice, but when pressed can not explain the reasons behind the rule. For example, I'm sure that rule #2 is very sensible, but after reading your best practices I am none the wiser as to why logging to tables is worse than logging to a file, especially when adhering to rule #1 by running the trace on a separate machine.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-02-17 : 11:02:21
You are too funny. The reason why these are the best practices is explained in one of the links I've got in that article. You just didn't read everything fully.

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

Subscribe to my blog
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-02-17 : 11:40:54
You are a lot nice than I am Tara
Go to Top of Page

KenW
Constraint Violating Yak Guru

391 Posts

Posted - 2011-02-28 : 16:29:01
quote:
Originally posted by russell

You are a lot nice than I am Tara



Agreed. +1000 to Tara for courtesy.
Go to Top of Page
   

- Advertisement -