In this small blog post, I'm going to tell you the way in which you can can find the exact time when your database was taken offline.
As per my experience you can see the the database offline log from :
1: Event Viewer
2: Error Log File
If your default trace is enabled then you are lucky as you can find enough information related to same.
Now, I have a sample database "TestVK" which I'm going to set OFFLINE.
Use master
Go
Alter database TestVK set OFFLINE
Go
You can see in object explorer it is offline now:
Using Event Viewer:
Go to RUN > Event viewer (Press Enter Key)
In event viewer window Go to windows Log > Applications
Here you'll see an event from MSSQLSERVER with a description such as "Setting database option OFFLINE to ON for database TestVK". See the Below screen shot for same.
Using Error Log File:
You can open error log file following the path like C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log (it may be different in you case)
exec sp_readerrorlog or sp_readerrorlog (both will work)
As per my experience you can see the the database offline log from :
1: Event Viewer
2: Error Log File
If your default trace is enabled then you are lucky as you can find enough information related to same.
Now, I have a sample database "TestVK" which I'm going to set OFFLINE.
Use master
Go
Alter database TestVK set OFFLINE
Go
You can see in object explorer it is offline now:
Using Event Viewer:
Go to RUN > Event viewer (Press Enter Key)
In event viewer window Go to windows Log > Applications
Here you'll see an event from MSSQLSERVER with a description such as "Setting database option OFFLINE to ON for database TestVK". See the Below screen shot for same.
Using Error Log File:
You can open error log file following the path like C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log (it may be different in you case)
OR
You can run system store procedure SP_readerrorlog to read the error log file in SSMS. For OFFLINE databases You will see the log as below:exec sp_readerrorlog or sp_readerrorlog (both will work)
Thanks For Reading this Blog!!!!!
No comments:
Post a Comment