Bringing them back from the dead

  • Eirikur Eiriksson

    SSC Guru

    Points: 182344

    Comments posted to this topic are about the item Bringing them back from the dead

  • Sal Young

    SSC-Addicted

    Points: 479

    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.
    -------------------------------------------------------------------------

    [font="Verdana"]Sal Young[/font]
    [font="Verdana"]MCITP Database Administrator[/font]

  • Alan Burstein

    SSC Guru

    Points: 61026

    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 ModenHow to Post Performance Problems -- Gail ShawNasty fast set-based string manipulation functions:For splitting strings try DelimitedSplit8K or DelimitedSplit8K_LEAD (SQL Server 2012+)To split strings based on patterns try PatternSplitCMNeed to clean or transform a string? try NGrams, PatExclude8K, PatReplace8K, DigitsOnlyEE, or Translate8KI 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

    SSC Guru

    Points: 182344

    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.
    😎

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

  • Eirikur Eiriksson

    SSC Guru

    Points: 182344

    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. 
    😎

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply