question

scorpio_thech avatar image
scorpio_thech asked

SQL service

I would appreciate if any one can tell me if I can check or use a script and tell what causes my SQL server instance to stop and what time it happened.
check
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Grant Fritchey avatar image
Grant Fritchey answered
There are two places to look. First, the SQL Server log files themselves. [Here's how you can find where they are located][1]. It's basically going to be in the folder structure of your instance. They're just log files so you can open them in wordpad or notepad. By default there should be several. To see the last failure, open the open previous to the most recent one. Although, you can sometimes see the cause for a failure as part of the boot section at the front of the most recent log. The other place to look is in the Windows Event Viewer at the Windows Logs and the Application events. You can access this by right clicking on a computer and selecting Manage. One of these locations will generally tell you what happened. [1]: http://msdn.microsoft.com/en-us/library/dd206993.aspx
4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

scorpio_thech avatar image scorpio_thech commented ·
Thanks Grant, that was helpful but I am still stack cos I am unable to open any of the log files in a note pad or any other similar program. Would that be permission issue? and the event viewer wasn't much of a help. May be the server isn't configured to write to the windows application log.
0 Likes 0 ·
ThomasRushton avatar image ThomasRushton ♦♦ commented ·
"unable to open the log files in notepad" - why? What was happening? They won't open in notepad by default, but if you open notepad, and then drag one of the files into the notepad window, you'll open it that way.
0 Likes 0 ·
Grant Fritchey avatar image Grant Fritchey ♦♦ commented ·
It doesn't write identical stuff to both sets of logs. The windows log will primarily be windows related information, but a crash frequently evidences itself there. If you're trying to open the most recent SQL Server log file while SQL Server is running, you may be prevented because the file will be locked. But you can read the logs through SQL Server Management Studio or through xp_readerrorlog.
0 Likes 0 ·
scorpio_thech avatar image scorpio_thech commented ·
yes.that was the issue. I wasn't able to open it cos sql was running. Now I can open and get the information I wanted. thanks for the help.
0 Likes 0 ·
scorpio_thech avatar image
scorpio_thech answered
![alt text][1] [1]: /storage/temp/1502-capture.png I did it as you told me exactly and this attached screen shot is what I am getting.

capture.png (5.0 KiB)
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Grant Fritchey avatar image Grant Fritchey ♦♦ commented ·
That's a security setting on your machine.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.