SansSQL: Error Log

Monday, April 29, 2013

View SQL Server log files offline in SQL Server 2012

Viewing the SQL server log files when the SQL server instance is offline or not accessible is something that every DBA would always wish to have as this helps in better troubleshooting.
This feature is now made available in SQL server 2012 and we can view SQL Server log files from a local or remote instance of SQL Server when the target instance is offline or cannot start.
We can also use this to connect to an instance that is online, but for some reason, you cannot connect through a SQL Server connection.

Wednesday, June 6, 2012

Recycle error log and SQL Server agent error log (SQLAgent.out) file

Recycle Error log:
When we run the below command, it Closes the current error log file and cycles the error log extension numbers just like a server restart.
Permission Requiredsysadmin fixed server role
USE msdb 
GO
EXEC sp_cycle_errorlog
GO

Recycle SQL Server Agent error log (SQLAgent.out):
When we run the below command, it Closes the current SQL Server Agent error log file and cycles the SQL Server Agent error log extension numbers just like a server restart.
Permission Required: sysadmin fixed server role
USE msdb 
GO
EXEC dbo.sp_cycle_agent_errorlog 
GO

Ads