Comments (7)
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.
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.
@CubsRep, could you create a new issue for this?
from sql-server-maintenance-solution.
There is an one open issue already #141 in the backlog. This serves same purpose.
from sql-server-maintenance-solution.
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.
Opened new issue #222
Thanks for your time
from sql-server-maintenance-solution.
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)
- Exclude Multiple tables
- Include the name of the day, for daily differential backups.
- Default Backup Location Folder doesn't exists HOT 1
- Fallback backup location
- ChangeBackuplocation
- Add an option to generate the Task Scheduler commands for SQL Express
- Update Statistics very slow on a 3Tb database HOT 3
- PRINT when TimeLimit has been reached in IndexOptimize HOT 1
- Diff backup of new database created fom another database is not being converted to full.
- (JOBNAME) variable not working on SQL Server 2014? HOT 2
- ColumnStore Index Fragmentation Issue
- Support Veeam Databses backups
- IndexOptimize job randomly reporting failure even when the log file says the Outcome succeeded HOT 6
- running rebuild on individual index takes a long time compared to native SQL commands HOT 2
- Enhance Index Rebuild Decision Process with Page Density Factor
- Parallel processing for index maintenance
- IndexOptimize - wrong ONLINE setting when table contains ColumnStore index
- Clustered indexes
- 7Zip compression
- @Clearuptime does not consider is_copy_only backups
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sql-server-maintenance-solution.