• Your article mentions

    distas


    Here is important point in regards to DBCC SHRINKFILE not to be misinterpreted: DBCC SHRINKFILE (<Transaction_LogFile_LogicalName>, TRUNCATEONLY) does truncate a transaction log file, i.e. breaks the LSN - Log Sequence Number. This will result in inability to restore database up to the point of failure, if the full or differential database backup is not taken right after and database ...oops... fails after this transaction log file truncation operation.

    But I think you have misinterpreted, this command (which is no longer available in SQL Server) will truncate the log and break LSNs

    BACKUP LOG ... WITH NO_LOG or TRUNCATE_ONLY

    The options TRUNCATEONLY and NOTRUNCATE for DBCC SHRINKFILE do not apply to transaction log files, they are applicable to data files only.

    This link details the following

    Books Online


    NOTRUNCATE

    Moves allocated pages from the end of a data file to unallocated pages in the front of the file with or without specifying target_percent. The free space at the end of the file is not returned to the operating system, and the physical size of the file does not change. Therefore, when NOTRUNCATE is specified, the file appears not to shrink.

    NOTRUNCATE is applicable only to data files. The log files are not affected.

    TRUNCATEONLY

    Releases all free space at the end of the file to the operating system but does not perform any page movement inside the file. The data file is shrunk only to the last allocated extent.

    target_size is ignored if specified with TRUNCATEONLY.

    TRUNCATEONLY is applicable only to data files.

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉