Category Archives: Troubleshooting

Cursor Dynamic SQL

Today was working on SQL Server cursor standard cursor deification would be like this: sqlcursor from (Azure Data Studio) ———————————————————————————————————————– — Declare a cursor for a Table or a View ‘TableOrViewName’ in schema ‘dbo’ DECLARE @ColumnName1 NVARCHAR(50), @ColumnName2 NVARCHAR(50) DECLARE db_cursor CURSOR FOR SELECT name FROM dbo.TableOrViewName OPEN db_cursor FETCH NEXT FROM db_cursor INTO @ColumnName1, @ColumnName2 WHILE @@FETCH_STATUS = 0 BEGIN     — add instructions to be executed for every rows SELECT @db_nm     FETCH NEXT FROM db_cursor INTO Sys.Databases END CLOSE db_cursor DEALLOCATE db_cursor GO   … Continue reading

Posted in Others, Troubleshooting, What I learned today | Tagged | Leave a comment

Smart Tlog Bkp

another great new feature for SQL Server 2017 is a smart backup with dmv sys.dm_db_log_space_usage this DMV provide log usage information using this we can plan to initiate the tlog backup and ensure to have tlog backup consistency and same … Continue reading

Posted in Backup and Restore, Others, SQL Server 2017, Transaction Log, Troubleshooting, Whats New | Tagged , , , | Leave a comment

Error 9002

This is very important error whenever you see this error it is clear that your database has “TLOG FILE FULL” and this could result into maintenance job  failed or you system not respond properly. for update stats you get so … Continue reading

Posted in Error Log, Others, Transaction Log, Troubleshooting | Tagged , , | Leave a comment

MSDB Size growing

msdb is growing due to queue. their is a great blog to help to reduce this How to reduce MSDB size from 42Gb to 200Mb query to get object size: USE msdb GO SELECT TOP(10) o.[object_id] , obj = SCHEMA_NAME(o.[schema_id]) … Continue reading

Posted in Experts, Others, Performance Tuning, Troubleshooting | Tagged | Leave a comment

Always On: Troubleshooting Consolidated

Working on Always On and configuration/setup of AG we have observed many errors. especially when configuration listener with following error 19471 or AG could not configure: Creating availability group listener resulted in an error. ADDITIONAL INFORMATION: Create failed for Availability … Continue reading

Posted in Disaster Recovery, High Avaliability, Installation, Others, Troubleshooting, What I learned today | Tagged , , | Leave a comment

Day 15 Server Logs

There are 6 types of logs available for MySQL environment, Logs are important information for DBA to troubleshoot or understand the system. MySQL track the information in those logs. Following are the list of logs: Error Log (– start/stop/errors) Query … Continue reading

Posted in Error Log, MySQL, Others, Performance Tuning, Transaction Log, Troubleshooting | Tagged , , | Leave a comment

SQL Server 2005 – Failed Maintenance Job

I Know SQL Server 2005 is no longer in support by Microsoft, but Want to provide a solution for those who have legacy system and come across a issue where maintenance job failed in jobs and on maintenance plan history … Continue reading

Posted in Bug, Error Log, Limitation, Others, Troubleshooting, What I learned today | Tagged , , | Leave a comment

Index Rebuild VS Reorganize

Posted in Basic, Index, Others, Troubleshooting | Tagged | Leave a comment

Re-initialize replication not working

For someone re-initialization is very simple, just go to publisher and right click and select re-initiallize and it will ask for- do you want to generate snapshot now, if you say “yes” it will create a metadata of the articles … Continue reading

Posted in Add/remove, High Avaliability, Replication, Troubleshooting | 1 Comment

TempDB Contention 2.1.%

Problem: When you are performing many DML operations and makes tempdb contesnion on it, You may get wait_resource of  2.1.103 check perfomance counter: Temp Tables Creation Rate Temp Tables For Destruction When you are performing many DML operations and makes … Continue reading

Posted in DB Design, DMV, Internal, Lock/Blocking, Performance Tuning, TempDB, Troubleshooting | Leave a comment