Thursday, January 12, 2017

SQL Server Common errors


As a DBA we need to investigate the SQL errors from the error log. if you need info on finding your errorlog file location you can refer this article.

The below are some of the common sql server errors i have seen, may be this can help you to get some insights into this errors.


Error: 18210, Severity: 16, State: 1.


Causes:  Backup device not accessible or SQL Backup process expecting a reply, but could not get reply.

Observation: This can be a message when your third party backup software is not sending the info needed by SQL server to say that backup was successful. This error is random, so needs investigation from third party backup tools and logs to check the status of backup.


Error: 1205


Causes: Deadlock and victim has been killed.

Observation: Source: Locking, Blocking and transactions open


Error: A time-out occurred while waiting for buffer latch -- type 4


Causes:
·        You enable the row versioning feature on a database in SQL Server 2008 R2 or in SQL Server 2008.
·        You configure the database to use the snapshot isolation level.
·        You run many transactions that update the database concurrently.
Observation:

essage:A time-out occurred while waiting for buffer latch -- type 4, bp 00000000E5FD39C0, page 1:90809119, stat 0xc0000b, database id: 7, allocation unit Id: 72057594492944384, task 0x0000000004FB9708 : 0, waittime 300, flags 0x1038, owning task 0x0000000000000000. Not continuing to wait.


Error: 18456, Severity: 14, State: 38.


Causes: Login failed due to wrong access issues

Observation: Usually observed when login is trying to access Database or perform action on restricted database.




SQL Server ErrorLog Location

Sometimes as a DBA we need to Invetsigate the SQL errors. SQL Server stores errors in error logs, which can be fined in no of ways.

Finding the location of log file.

Error log file location can be found in startup parameters of instance. You need to go to SQL Server configuration manager, select the SQL Server Services on Left pane and select the instance you are interested. Right click properties and select parameters, the parameter which start with -e is the location of your error log file for the selected instance.


The other ways to find out the error log file location is using xp_readerrorlog and from registry keys. The below is the T SQL can be used.

EXEC master.dbo.xp_readerrorlog 0, 1, 'Logging SQL Server messages in file'