What is Work (.wrk) file in SQL Server




       I cant consider this as an interview question until some one is asking for SME level candidate. Else you are hiring some one who reads more than he works.

     This is one of rare files DBA encounter. I encounter this couple of days back when one of my junior was asking same in interview to a 2 years experience and guess what interviewee knows this and i felt dumbfounded because i never heard in my decade long career. So for curiosity i searched on google and here what i found. 
             
              When the transaction log backup files are copied from the primary server to the secondary server the file is named as a work file (.wrk) till the copy operation is completed. This will ensure that the restore job in the secondary will not pick the file and try a restore. Once the file is completely copied, then it will be named as .trn, the one which is very familiar to us. Normally when the log backups are very small you won’t really observe the .wrk file. In a flash they are converted to a .trn file. When the log backups are relatively bigger, then you can see .wrk file available in the copy folder for a longer period of time.

So i realize this is very good mechanism to stop SQL server to process some log backup file which is already in copy other wise we might see lot of restore failures in SQL server.

But this is definitely not a interview question for L1 or L2 DBA

A quick screenshot from blog of Anup Warrier 



3 comments:
Write comments

Please do not enter spam links

Meet US

Services

More Services