简体   繁体   English

SQL Server 事务日志 ldf 文件

[英]SQL Server transaction log ldf file

How can I delete the data in the log file ( .ldf )?如何删除日志文件 ( .ldf ) 中的数据? I've already tried a backup, compact, but stellarinfo software retrieves deleted records.我已经尝试过备份,紧凑,但 stellarinfo 软件会检索已删除的记录。

You said你说

software retrieves deleted records软件检索已删除的记录

If you can query "deleted" records, it means they were not deleted.如果您可以查询“已删除”的记录,则表示它们没有被删除。 The data is still there数据还在

The transation log does not store any data, it basically stored a record of what happened so it can be replayed or rolled back.事务日志不存储任何数据,它基本上存储了发生的事情的记录,以便可以重放或回滚。 You can't "delete data" from the transation log (ldf) file.您不能从交易日志 (ldf) 文件中“删除数据”。

It is that simple就是这么简单

Except MDF file SQL Server also maintain the records in .ldf file which keeps the data in a form of transaction log.除了 MDF 文件,SQL Server 还维护 .ldf 文件中的记录,该文件以事务日志的形式保存数据。 which a database user cannot view or edit directly.数据库用户不能直接查看或编辑。 each time you Insert, Update, delete records in SQL Server, these transactions maintained in .ldf file on the basis of LSNs for future use.每次在 SQL Server 中插入、更新、删除记录时,这些事务都会在LSN的基础上维护在 .ldf 文件中以备将来使用。
However, you can use fn_dblog() function to read SQL Server transaction log or use a third party tool better understand the .ldf file and read SQL Server transaction logs.但是,您可以使用fn_dblog()函数读取 SQL Server 事务日志或使用第三方工具更好地了解 .ldf 文件并读取 SQL Server 事务日志。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM