Category: SQL Server

  • Delete vs Truncate

    Its a common interview question which people like to ask to know your understanding on RDMS concepts. I too few times encountered the question in interviews. Pleases don’t ask me interview result. Haha ha… DELETE: 1. DELETE is a DML Command.  2. DELETE statement is executed using a row lock, each row in the table…

  • DBCC IND

    The DBCC IND statement takes three parameters like this: DBCC IND(0,’dbo.SalesOrderDetailList’,1); First parameter is the database id. If you pass in 0 here, the current database is used. Second parameter is the table name in quotes. You can also pass in the object_id of the table instead of the quoted name like this: DBCC IND(0,1797581442,1); Third parameter is the index_id. There is an optional fourth parameter that…

  • SQL Server 2016 SP2 CU12 Upgrade Issue.

    Few days back my patching team was doing security upgrade on one of customer production server. After their patching SQL Server has not came up. That was the issue. Earlier SQL Server patch level: SQL Server 2016 Standard Edition with SP2 with CU11Current SQL Server patch level: SQL Server 2016 Standard Edition with SP2 with CU12…

  • Full Database Backup Restore

    Working as DBA or developer, restoring a database is the request which we get regularly. Restoring a database is easy task if our back file is healthy. Restore a Full Database Backup Below is script which we can use for restore a database from full backup… ——————————————————————–  RESTORE DATABASE DB_Name FROM DISK = ‘Location of DB backup file path’  ——————————————————————– But…

  • Differential Database Backup Restore

    If we want to restore database with differential backup then first we need to restore associated fill backup with NORECOVERY option.Below is example… ——————————————————————– RESTORE DATABASE AdventureWorks FROM DISK = ‘C:\AdventureWorks.BAK’ WITH NORECOVERY ——————————————————————– Only after that we can apply Differential backup on the database… Below is the example…——————————————————————– RESTORE DATABASE AdventureWorks FROM DISK = ‘C:\AdventureWorks_Diff.BAK’ ——————————————————————–

  • Managing Database Transaction Log File

    Hey guys, In this blog I am going to explain you about “How to manage Database Transaction Log File” This is the very common task which any DBA does regularly. Reason behind doing Transaction-Log file shrink… 1. Some time because of low disk space on T-log disk.2. Log-backup job issue. Sometime what happen because of log backup…

  • High VLF Count in Database Log File

    High VLF count can create a performance problem in huge OLTP SQL Server system. Every 10 GB of T-Log file, VLF count should not more than 50 VLFs. For example, if Database transaction log file size is 50 GB then as per recommendation, lets calculate optimum value for this much size of log file… First…

  • Pages in Database

    Boot Page Every DB has only one boot page. Boot page stores DB configuration information. It can find in page # 9 of the first DB data file. Bulk Changed Map (BCM) Page BCM page keep track of the extends which has modified by bulked-logged operations. Log backup thread reads this page and get the extends…

  • Wait Types in SQL Server