Category: DBA Worries Continued

  • Important SQL Server Scripts…

    Restore Progress Check… ========================================================================== DECLARE @DBName VARCHAR(64) = ‘ODS’ DECLARE @ErrorLog AS TABLE([LogDate] CHAR(24), [ProcessInfo] VARCHAR(64), [TEXT] VARCHAR(MAX)) INSERT INTO @ErrorLog EXEC master..sp_readerrorlog 0, 1, ‘Recovery of database’, @DBName INSERT INTO @ErrorLog EXEC master..sp_readerrorlog 0, 1, ‘Recovery completed’, @DBName SELECT TOP 1     @DBName AS [DBName]    ,[LogDate]    ,CASE       WHEN…

  • Cache Memory

    Hey guys, In this blog I am going to explain you about Cache Memory Cache is a small amount of high-speed random-access memory (RAM) built directly within the processor. It is used to temporarily hold data and instructions that the processor is likely to reuse. This allows for faster processing as the processor does not…

  • Database Transaction Log Full or Unable to write or Recovery Units belonging to database failed to generate a checkpoint

    Some time working as a DBA or support engineer you might have faced this issue that DB log file full or recovery unit failed to generate checkpoint. We might get error in SQL error log like below… Error: 9002, Severity: 17, State: 2. The transaction log for database ‘DB_Name’ is full due to ‘LOG_BACKUP’. Could…

  • Trigger Vs Stored Procedure in SQL Server

    Hey guys, in this blog we will learn about the differences between Triggers and Stored Procedures. Both perform a specified task but the major difference comes in the execution part. Triggers are called automatically while the stored procedures are invoked explicitly by the user. 1. Execution: We can execute a Stored Procedure whenever we want with…

  • Cursor In SQL Server

    Hello guys, In this blog, I am going to explain you about the Cursor and how to perform a cursor inside the database. Cursor- Cursor is a Temporary Memory or Temporary Work Station. It is Allocated by Database Server at the Time of Performing DML (Data Manipulation Language) operations on Table by User. Cursors are used…

  • Step by Step Implementation of Instant File Initialization

     Hello guys, In this blog, I will discuss about step by step implementation of “Instant File Initialization” in SQL Server STEP- 1: You must first open the instance in SSMS, then do the following query: Fig-1 This is the result of executing a query: Fig-2 You must update Y to N in the Instant _File Initialization…

  • Deterministic and Nondeterministic Functions

    Deterministic functions: Deterministic functions always result in the same output every time they are called with a fixed set of input values and given the same condition of the database.  For example, AVG() function always results the same result given the qualifications stated above. Nondeterministic functions: Nondeterministic functions result in different output each time they…

  • Fragmentation

     Hey guys, In this blog I am going to explain you about Fragmentation and its types and how to detect fragmentation and fix it. SQL Server index fragmentation is a common source of database performance degradation. Fragmentation occurs when there is a lot of empty space on a data page (internal fragmentation) or when the logical…

  • SQL Server Index Seek and Scan

    SQL Server Index Seek and Scan