SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Bringing them back from the dead


Bringing them back from the dead

Author
Message
Eirikur Eiriksson
Eirikur Eiriksson
SSC Guru
SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)

Group: General Forum Members
Points: 156774 Visits: 23033
Comments posted to this topic are about the item Bringing them back from the dead
Sal Young
Sal Young
Old Hand
Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)

Group: General Forum Members
Points: 375 Visits: 393
This is a promising script but I'm having some issues.
  1. If there are other file(s) or folder(s) in the drive that match the pattern "ERRORLOG" it may go to that folder instead of the location to the SQL error log files
  2. After renaming the other ERRORLOG folder, i still got the following message which I'm not sure if the script is working as expected
The current system date and time:
Tue 09/11/2018- 7:39:57.12
-------------------------------------------------------------------------
Operating system:
Microsoft Windows [Version 10.0.17134.228]
-------------------------------------------------------------------------
Testing Error Search: FINDSTR /I /R /G:"C:\TSES_V02\TEST_SEARCH.txt" "C:\Program*"
This should match once in every log file.
[Failed] Test string not found.

-------------------------------------------------------------------------
Severity Level 10 ( Memory )
No Severity Level 10 ( Memory ) errors found.
-------------------------------------------------------------------------
Severity Level 10 ( Disk )
No Severity Level 10 ( Disk ) errors found.
-------------------------------------------------------------------------
Severity Level 11
No Severity Level 11 errors found.
-------------------------------------------------------------------------
Severity Level 12
No Severity Level 12 errors found.
-------------------------------------------------------------------------
Severity Level 13
No Severity Level 13 errors found.
-------------------------------------------------------------------------
Severity Level 14
No Severity Level 14 errors found.
-------------------------------------------------------------------------
Severity Level 16 (Backup)
No Severity Level 16 (Backup) errors found.
-------------------------------------------------------------------------
Severity Level 16 (Restore)
No Severity Level 16 (Restore) errors found.
-------------------------------------------------------------------------
Severity Level 17
No Severity Level 17 errors found.
-------------------------------------------------------------------------
Severity Level 18
No Severity Level 18 errors found.
-------------------------------------------------------------------------
Severity Level 19
No Severity Level 19 errors found.
-------------------------------------------------------------------------
Severity Level 20
No Severity Level 20 errors found.
-------------------------------------------------------------------------
Severity Level 21
No Severity Level 21 errors found.
-------------------------------------------------------------------------
Severity Level 22
No Severity Level 22 errors found.
-------------------------------------------------------------------------
Severity Level 23
No Severity Level 23 errors found.
-------------------------------------------------------------------------
Severity Level 24
No Severity Level 24 errors found.
-------------------------------------------------------------------------

Sal Young
MCITP Database Administrator
Alan Burstein
Alan Burstein
SSC Guru
SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)

Group: General Forum Members
Points: 53634 Visits: 8955
Just read through this. Very good stuff. I've unwillingly become a part-time accidental DBA at work and deal with a my share of failing SQL instances. This will be good stuff to have in my back pocket.

-- Alan Burstein


Helpful links:

Best practices for getting help on SQLServerCentral -- Jeff Moden
How to Post Performance Problems -- Gail Shaw

Nasty fast set-based string manipulation functions:
For splitting strings try DelimitedSplit8K or DelimitedSplit8K_LEAD (SQL Server 2012+)
To split strings based on patterns try PatternSplitCM
Need to clean or transform a string? try NGrams, PatExclude8K, PatReplace8K, DigitsOnlyEE, or Translate8K

I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code. -- Itzik Ben-Gan 2001

Eirikur Eiriksson
Eirikur Eiriksson
SSC Guru
SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)

Group: General Forum Members
Points: 156774 Visits: 23033
Sal Young - Tuesday, September 11, 2018 6:53 AM
This is a promising script but I'm having some issues.
  1. If there are other file(s) or folder(s) in the drive that match the pattern "ERRORLOG" it may go to that folder instead of the location to the SQL error log files
  2. After renaming the other ERRORLOG folder, i still got the following message which I'm not sure if the script is working as expected
The current system date and time:
Tue 09/11/2018- 7:39:57.12
-------------------------------------------------------------------------
Operating system:
Microsoft Windows [Version 10.0.17134.228]
-------------------------------------------------------------------------
Testing Error Search: FINDSTR /I /R /G:"C:\TSES_V02\TEST_SEARCH.txt" "C:\Program*"
This should match once in every log file.
[Failed] Test string not found.

-------------------------------------------------------------------------
Severity Level 10 ( Memory )
No Severity Level 10 ( Memory ) errors found.
-------------------------------------------------------------------------
Severity Level 10 ( Disk )
No Severity Level 10 ( Disk ) errors found.
-------------------------------------------------------------------------
Severity Level 11
No Severity Level 11 errors found.
-------------------------------------------------------------------------
Severity Level 12
No Severity Level 12 errors found.
-------------------------------------------------------------------------
Severity Level 13
No Severity Level 13 errors found.
-------------------------------------------------------------------------
Severity Level 14
No Severity Level 14 errors found.
-------------------------------------------------------------------------
Severity Level 16 (Backup)
No Severity Level 16 (Backup) errors found.
-------------------------------------------------------------------------
Severity Level 16 (Restore)
No Severity Level 16 (Restore) errors found.
-------------------------------------------------------------------------
Severity Level 17
No Severity Level 17 errors found.
-------------------------------------------------------------------------
Severity Level 18
No Severity Level 18 errors found.
-------------------------------------------------------------------------
Severity Level 19
No Severity Level 19 errors found.
-------------------------------------------------------------------------
Severity Level 20
No Severity Level 20 errors found.
-------------------------------------------------------------------------
Severity Level 21
No Severity Level 21 errors found.
-------------------------------------------------------------------------
Severity Level 22
No Severity Level 22 errors found.
-------------------------------------------------------------------------
Severity Level 23
No Severity Level 23 errors found.
-------------------------------------------------------------------------
Severity Level 24
No Severity Level 24 errors found.
-------------------------------------------------------------------------

Haven't come across this situation, the assumption is that the patterns in the file C:\TSES_V02\TEST_SEARCH.txt will identify the error log files, neither the location of the files nor the file names.
Cool

Can you run the script again in verbose mode and ping back the output?

Eirikur Eiriksson
Eirikur Eiriksson
SSC Guru
SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)

Group: General Forum Members
Points: 156774 Visits: 23033
Alan.B - Tuesday, September 11, 2018 7:35 AM
Just read through this. Very good stuff. I've unwillingly become a part-time accidental DBA at work and deal with a my share of failing SQL instances. This will be good stuff to have in my back pocket.

Hi Alan,
it's very handy and one can have a non-sql server person(s) such as sysadmins running this and returning the output, very helpful in environments where it's hard to obtain sysadmin access to the servers.
Cool

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search