Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

DBCC command execution History Expand / Collapse
Author
Message
Posted Monday, February 1, 2010 5:13 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, November 13, 2014 6:17 AM
Points: 87, Visits: 403
Hi,

I need an urgent help. I have to provide the result to audit team on when exactly DBCC commands executed in a specific DB. Can anyone please help >

Thanks in Advance!
Post #857066
Posted Monday, February 1, 2010 5:27 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, November 20, 2014 8:17 AM
Points: 1,576, Visits: 1,785
Which DBCC commands are you tring to audit?

In most cases you can query the Error log to find out when they are run.

DECLARE @ErrorLog TABLE 
(
LogDate DATETIME NOT NULL,
ProcessInfo VARCHAR(75),
LogInfo VARCHAR(MAX)
)

INSERT INTO @Errorlog
EXEC xp_readerrorlog

SELECT *
FROM @Errorlog
WHERE LogInfo LIKE '%DBCC%'

Post #857072
Posted Monday, February 1, 2010 5:32 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, November 13, 2014 6:17 AM
Points: 87, Visits: 403
Thanks a lot for a quick response ! Will this log available in db only for certain period ? because when i execute this in my db it didnt return any result.
Post #857076
Posted Monday, February 1, 2010 5:38 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Wednesday, January 18, 2012 7:43 AM
Points: 351, Visits: 406
Doesn't xp_readerrorlog take some parameters. If you don't specify any of the parameters, then it reads only the current log file.
Error logs can be cycled either manually or by retarting SQL Server. Typically, SQL Server retains backups of the previous six logs and gives the most recent log backup the extension .1, the second most recent the extension .2, and so on. The current error log has no extension.
So it could be that it is not in the current log file.
Just try opening the SQL Server Error Logs in SQL Server Management Studio.


1. In Object Explorer, expand a server, expand Management, and then expand SQL Server Logs.
2. Right-click a log and click View SQL Server Log.



Post #857080
Posted Monday, February 1, 2010 5:47 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, November 13, 2014 6:17 AM
Points: 87, Visits: 403
to be more specific on my question i need to know when did DBCC Checkident applied for a table recently ....
Post #857084
Posted Monday, February 1, 2010 5:48 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, November 20, 2014 8:17 AM
Points: 1,576, Visits: 1,785
vstitte (2/1/2010)
Doesn't xp_readerrorlog take some parameters.


Correct. I just use the above script as a job to notify me of any certain alerts

You could try

EXEC xp_readerrorlog 6,1,'dbcc'

Change the 6 to be the number of logs you keep...
Post #857087
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse