SQL Server linux : transaction still work ever ldf is removed

sakuraime 2,326 Reputation points
2020-11-07T10:18:10.697+00:00

I am doing the following .
I create a db , and I remove the ldf from Linux os using rm -f db.ldf

but in the sql server , it still can do insert/update/delete to the DB .... WHY ??? isn't it terrible ?

I believe in windows , we definitely can't do this

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,669 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Dan Guzman 9,236 Reputation points
    2020-11-07T13:09:55.19+00:00

    Linux allows one to delete files while, even if they are in use, as long as one has permissions to do so. Files is not actually deleted until processes using them (SQL Server in this case) terminate. This behavior is different from Windows, where in use files cannot be deleted.

    Yes, it is bad to delete database files on any platform except for specialized cases. File/directory permissions prevent accidental deletion. One needs to do so from an elevated session on Windows (and when the file is not being used) or by changing the user context on Linux,. Only administrators, who should understand the implications, can do that.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.