Git Product home page Git Product logo

Comments (7)

olahallengren avatar olahallengren commented on August 25, 2024

This is a good idea. Thank you. For now you can look at the data in the CommandLog table like this:

SELECT *
FROM dbo.CommandLog
WHERE EndTime IS NULL -- The command is currently executing or was aborted

SELECT *
FROM dbo.CommandLog
WHERE EndTime IS NOT NULL AND ErrorNumber = 0 -- The command was executed successfully

SELECT *
FROM dbo.CommandLog
WHERE EndTime IS NOT NULL AND ErrorNumber <> 0 -- The command failed

SELECT *
FROM dbo.CommandLog
WHERE EndTime IS NOT NULL AND ErrorNumber IS NULL -- The command was not executed

from sql-server-maintenance-solution.

CubsRep avatar CubsRep commented on August 25, 2024

Ola,

Does ErrorMessage and ErrorNumber columns ever update with actual error msg and number at failures? Error Number is NULL for failed ones but i don't see Error Message - it is always NULL

--// Source: https://ola.hallengren.com //--
--// License: https://ola.hallengren.com/license.html //--
--// GitHub: https://github.com/olahallengren/sql-server-maintenance-solution //--
--// Version: 2019-02-10 10:40:47 //--

The error message is logged in the Output file: For Example
Could not allocate space for object 'sys.sysobjvalues'.'clst' in database '' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup,

Ideally I would like to see a brief error message in the CommandLog but apparently it is not. Is that intended functionality?

Thank You

from sql-server-maintenance-solution.

olahallengren avatar olahallengren commented on August 25, 2024

@CubsRep, could you create a new issue for this?

from sql-server-maintenance-solution.

CubsRep avatar CubsRep commented on August 25, 2024

There is an one open issue already #141 in the backlog. This serves same purpose.

from sql-server-maintenance-solution.

olahallengren avatar olahallengren commented on August 25, 2024

That is actually a different issue (in that case the error is not being logged to the CommandLog at all). I will explain the issue that you are seeing, but it is more easy if you could create a new issue.

from sql-server-maintenance-solution.

CubsRep avatar CubsRep commented on August 25, 2024

Opened new issue #222

Thanks for your time

from sql-server-maintenance-solution.

speedy32129 avatar speedy32129 commented on August 25, 2024

I'm actually finding this is NOT true. Those queues don't give you any results for a queue in the Dec 3, 2022 version.

Example:

EXECUTE dbo.IndexOptimize @databases = 'ALL_DATABASES',
@FragmentationLow = NULL,
@FragmentationMedium = 'INDEX_REORGANIZE,INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE',
@FragmentationHigh = 'INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE',
@FragmentationLevel1 = 5,
@FragmentationLevel2 = 30,
@LogToTable = 'Y',
@execute = 'N';

I've change line 285
IF @LogToTable = 'Y'
BEGIN
UPDATE dbo.CommandLog
SET EndTime = @EndTime,
ErrorNumber = CASE WHEN @execute = 'N' THEN NULL ELSE @error END,
ErrorMessage = @ErrorMessageOriginal
WHERE ID = @id
END
to
IF @LogToTable = 'Y'
BEGIN
UPDATE dbo.CommandLog
SET EndTime = CASE WHEN @execute = 'N' THEN NULL ELSE @EndTime END,,
ErrorNumber = CASE WHEN @execute = 'N' THEN NULL ELSE @error END,
ErrorMessage = @ErrorMessageOriginal
WHERE ID = @id
END

I think even though nothing is actually executing the EndTime is being populate and it shouldn't when it come across as @mode = 2 AND @execute = 'N'

Still testing this solution further.

from sql-server-maintenance-solution.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.