473,466 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using findstr on SQL 2005 ERRORLOG file

We have set up a couple of SQL Server 2005 systems and I have found
that the format of the ERRORLOG files and the SQL Agent's log files
are Unicode or some format that findstr cannot parse properly. "find"
parses them fine, but it doesn't have the capabilities that I need --
specifically, I can't search for multiple strings in one search.

I see the checkbox on the SQL Agent's for "Write OEM File", but it is
grayed out so I am not able to try checking that. I also don't know
if that would affect the server's ERRORLOG file too or just the
Agent's log file.

So what am I missing? What is everyone else doing who is used to
having scripts to parse these files looking for strings that indicate
problems? Is there a server setting that will force it to go back to
a plain ANSI text file format for log files? Is that a bad thing to
do?

Thanks in advance for any insight,
Teresa Masino
Feb 28 '08 #1
4 3659
Teresa Masino (te***********@peninsula.org) writes:
We have set up a couple of SQL Server 2005 systems and I have found
that the format of the ERRORLOG files and the SQL Agent's log files
are Unicode or some format that findstr cannot parse properly. "find"
parses them fine, but it doesn't have the capabilities that I need --
specifically, I can't search for multiple strings in one search.

I see the checkbox on the SQL Agent's for "Write OEM File", but it is
grayed out so I am not able to try checking that. I also don't know
if that would affect the server's ERRORLOG file too or just the
Agent's log file.

So what am I missing? What is everyone else doing who is used to
having scripts to parse these files looking for strings that indicate
problems? Is there a server setting that will force it to go back to
a plain ANSI text file format for log files? Is that a bad thing to
do?
I doubt there is a setting to force the SQL Server error log to be ANSI.
Would be a lot problem to log object and database names with characters
outside the ANSI set in that case.

I guess the answer is to use Unicode-capable tools. I don't have any
real suggestion for that. I search the errorlog fairly rarely, so most
of the time I'm content of opening it in Textpad. (Which understands
Unicode in so far it can handle the encoding, but it's not able to
work with characters outside the ANSI range.)

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Feb 28 '08 #2
On Feb 28, 11:12*am, Teresa Masino <teresa.mas...@peninsula.org>
wrote:
We have set up a couple of SQL Server 2005 systems and I have found
that the format of the ERRORLOG files and the SQL Agent's log files
are Unicode or some format that findstr cannot parse properly. *"find"
parses them fine, but it doesn't have the capabilities that I need --
specifically, I can't search for multiple strings in one search.

I see the checkbox on the SQL Agent's for "Write OEM File", but it is
grayed out so I am not able to try checking that. *I also don't know
if that would affect the server's ERRORLOG file too or just the
Agent's log file.

So what am I missing? *What is everyone else doing who is used to
having scripts to parse these files looking for strings that indicate
problems? *Is there a server setting that will force it to go back to
a plain ANSI text file format for log files? *Is that a bad thing to
do?

Thanks in advance for any insight,
Teresa Masino
The TYPE command will convert unicode to ASCII. i.e.

TYPE \\coxsql2\E$\MSSQL.1\MSSQL\LOG\ERRORLOG \\coxsql2\C$\ERRORLOG
\ErrorLog.txt
Jun 27 '08 #3
On Feb 28, 5:33*pm, Erland Sommarskog <esq...@sommarskog.sewrote:
Teresa Masino (teresa.mas...@peninsula.org) writes:
We have set up a couple of SQL Server 2005 systems and I have found
that the format of the ERRORLOG files and the SQL Agent's log files
are Unicode or some format that findstr cannot parse properly. *"find"
parses them fine, but it doesn't have the capabilities that I need --
specifically, I can't search for multiple strings in one search.
I see the checkbox on the SQL Agent's for "Write OEM File", but it is
grayed out so I am not able to try checking that. *I also don't know
if that would affect the server's ERRORLOG file too or just the
Agent's log file.
So what am I missing? *What is everyone else doing who is used to
having scripts to parse these files looking for strings that indicate
problems? *Is there a server setting that will force it to go back to
a plain ANSI text file format for log files? *Is that a bad thing to
do?

I doubt there is a setting to force the SQL Server error log to be ANSI.
Would be a lot problem to log object and database names with characters
outside the ANSI set in that case.

I guess the answer is to use Unicode-capable tools. I don't have any
real suggestion for that. I search the errorlog fairly rarely, so most
of the time I'm content of opening it in Textpad. (Which understands
Unicode in so far it can handle the encoding, but it's not able to
work with characters outside the ANSI range.)

--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se

Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx- Hide quoted text -

- Show quoted text -
From a batch job the TYPE command will convert unicode to ASCII. i.e.

TYPE \\SQLSRVR1\E$\MSSQL.1\MSSQL\LOG\ERRORLOG \\SQLSRVR1\C$\ERRORLOG
\ErrorLog.txt
Jun 27 '08 #4
check out LOGPARSER available from Microsoft. It can be used to parse
Active Directory and server event logs.
I use it to load data directly into a SQL table :)
HTH
Rob
Jun 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Karl Roes | last post by:
Hi all, I am after some suggestions on ways to email an errorlog table. I have been working on remote interfaces and would like the users to email the errorlog back to me at the push of a button...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
0
by: Bill Mittenzwey | last post by:
Is there a dotnet class which would give a list of files containing a certain string or regular expression like WinXPs FindStr function? I want to allow users to be able to search for all files...
1
by: lourivalsjr | last post by:
Hi, i have SQL 2000 and 2005 on same machine(with different intance names, of course), my laptop - XP with SP2. The 2005 works fine but i can't connect on SQL 2000. All the the SQL services are...
2
by: R.A.M. | last post by:
Hello, When I received a message "... See the SQL Server errorlog for details ...." I opened Management / SQL Server Logs where I see: Current - 2006-05-30 12:19:00 Archive #1 - 2006-05-30...
1
by: javs | last post by:
i have to call findstr dos command in my C# code... FINDSTR /S /I /P /N /G:C:\C1.TXT T:\A\*.* where C1.txt is a file providing the search strings and T:\A is the directory to be searched
1
by: Steve | last post by:
Hi guys, I'm trying to upgrade TFS 2005 to TFS 2008 on a test server in preparation for upgrading our live box. However, when I run the install of 2008, I get the following error message: ...
3
by: Tod Birdsall | last post by:
Hi, My boss has asked me to create a tool that can give us a list of stored procedure names that are being called from each of our app's web pages. This is an ASP.NET application that is rather...
1
by: =?Utf-8?B?YWxwbzQ4Ng==?= | last post by:
when I create a text file with: wmic ntdomain get /value z:\test\test.txt then run findstr /i /r ".*" z:\test\test.txt The output has a dot between each character. Is there any way to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.