Showing posts with label errors. Show all posts
Showing posts with label errors. Show all posts

Friday, March 30, 2012

Need to check a table for errors

Hi - please excuse my newness to this. I have a database with several tables and one of them is causing my application to lag really bad. I figure there is either not enough space or something is just wrong in general and i don't know what. Does SQL Server have a shortcut or easy way to test a table in the database?

Thanks =)If it is only giving performance troubles, I bet it is a large table (either many columns, many rows, or both). Look into the index tuning wizard in Enterprise Manager.|||Originally posted by Avernus
Hi - please excuse my newness to this. I have a database with several tables and one of them is causing my application to lag really bad. I figure there is either not enough space or something is just wrong in general and i don't know what. Does SQL Server have a shortcut or easy way to test a table in the database?

Thanks =)

dbcc checktable(yourtable)?|||Originally posted by snail
dbcc checktable(yourtable)?

Ok will try that.

I also forgot to mention that it has worked fine for a year and all the sudden is causing literally 5 minute lag periods.

Thanks =)|||Originally posted by Avernus
Ok will try that.

I also forgot to mention that it has worked fine for a year and all the sudden is causing literally 5 minute lag periods.

Thanks =)

Also you could check for fragmentation (it is good idea to do this sometimes):

DBCC SHOWCONTIG|||In Query Analyzer execute one of the queries your app issues after setting Show Execution Plan to ON (Ctrl+K.) The corresponding pane will show you how the Optimizer processed the request. Pay close attention to anything in RED there, as well as table/index scans.|||"Also you could check for fragmentation (it is good idea to do this sometimes):

DBCC SHOWCONTIG"

I get an error trying to run this alone. I read something about having to include an Object ID with this command. Can you show me an example of how that looks written out for one table? Thanks, I appreciate this bigtime =)

Monday, March 19, 2012

need script to monitor os free space & errors

I am looking for a script to check the os free space and email if getting below a threshold.
Additionally, I am looking for another script to read the sql server log for errors and to email if error (or a string) is found.
MikeYou can take help of ALERTS in SQL server for free space threshold, refer to books online for more information.

Also can take help of Notification services or third party tools like BMC Patrol to alert if any error occurs in SQL error log/|||Procedure for extracting error from Errorlog and send email:

1) Open a notepad, cut and paste the following sample of errors
that you would like to find:

Error: 3414
Error: 3437
Error: 3619
Error: 8651
Error: 9002
BACKUP failed to complete
consistency errors
Exception Access Violation
.
.
.

and save it as "search_list.txt"

2) Open another notepad, cut & paste the below sample to
extract the error and output to a file (C:\List_error.txt) if
any error in the Errorlog is matched with the "Search_list.txt"
provided above:

IF EXIST DEL C:\List_errorlog.txt
Findstr /i /g:C:\Search_List.txt D\MSSQL\LOG\errorlog >
C:\List_errorlog.txt

osql -Sservername -E -Q"xp_sendmail @.recipients = 'DBA_on_call@.yahoo.com', @.message = 'See attached file for error',@.attachments = 'H:\MSSQL\LOG\List_errorlog.txt', @.subject = 'SQL Server Errorlog'"

save it as a command file like "Search_error.cmd"

3) start the Enterprise Manager and schedule a job that run the
"Search_error.cmd" for every 10 min or whenever...

Goodluck

SVT