Re: Using findstr on SQL 2005 ERRORLOG file



Teresa Masino (teresa.masino@xxxxxxxxxxxxx) 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, esquel@xxxxxxxxxxxxx

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.



Relevant Pages

  • Re: Using findstr on SQL 2005 ERRORLOG file
    ... are Unicode or some format that findstr cannot parse properly. ... a plain ANSI text file format for log files? ... I doubt there is a setting to force the SQL Server error log to be ANSI. ... Unicode in so far it can handle the encoding, ...
    (comp.databases.ms-sqlserver)
  • Re: verfiy a query like Query Analyzers parse query function
    ... There used to be a parser that shipped with SQL Server 2000 which would ... parse apart the keywords for SQL queries (for Oracle syntax and for SQL ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SPS - SQL Server - LOG FILES.
    ... you should have your DBA help you with removing and shrinking the files as you can't simply delete them (SQL will startup again trying to find them and won't create them until something like a CREATE DATABASE command is issued). ... This isn't something I can post in a step-by-step message here as it's a fairly involved process and requires a good understanding of SQL Server. ... these log files are using lot of space on c drive. ...
    (microsoft.public.sharepoint.portalserver)
  • Re: do not display the result of a SELECT
    ... log files, which would make them very large. ... INTO #temp FROM ... Links for SQL Server Books Online: ...
    (microsoft.public.sqlserver.programming)
  • Re: Failed When Installing SQL Server 2005 on Windows 2003 R2 SP2
    ... I have checked and I found 2 error messages in the system log files (be ... opened from event viewer) when installing the SQL 2005: ... The SQL Server service failed to start due to the ... Timeout waiting for the SQL Server ...
    (microsoft.public.sqlserver.setup)