How to Delete an SSAS .ABF File from HDD

  • Hello, I have a SQL Server 2016 on a Windows Server 2012, and have made a number of SSAS tabular cube backups, the .abf file, and they are on a local to the server share drive. What method is used to delete these as they are outside of a backup script that runs. With File Explorer and delete, or is there a way through SSMS? I only see Backup and Restore, but no way to delete. Thanks

  • quinn.jay - Tuesday, May 9, 2017 11:44 AM

    Hello, I have a SQL Server 2016 on a Windows Server 2012, and have made a number of SSAS tabular cube backups, the .abf file, and they are on a local to the server share drive. What method is used to delete these as they are outside of a backup script that runs. With File Explorer and delete, or is there a way through SSMS? I only see Backup and Restore, but no way to delete. Thanks

    You can do it manually with File Explorer. I've usually seen it done with something like Powershell or xp_cmdshell
    This has a couple of basic Powershell samples to backup and delete older abf files:
    Backup SSAS with PowerShell

    Sue

  • Like Sue suggested, i use Powershell, as a scheduled job step to remove any abf files older than x number of days.
    not sure how you are backing up, in my case i have a different job that dynamically generates the XMLA query. let me know if you want an example of that.

    here's the very simple powershell that deletes any *.abf files older than x days.
    [
    $limit = (Get-Date).AddDays(-20)
    Get-ChildItem -Path "\\myServerbk01\SQLBackUps\" -include *.abf -Recurse -Force | Where-Object { !$_.PSIsContainer -and $_.CreationTime -lt $limit } | Remove-Item -Force #-ErrorAction SilentlyContinue

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply