Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics RMS (Archived)

Trouble deleting Journal to shrink database

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

My database is approaching the 4GB limit of SQL 2005 so I am trying to delete some of the journal. 

When I run the query "DELETE FROM JOURNAL WHERE TIME < '01/01/2012'" in RMS Administrator, the database stays the same size at approximately 39.5GB. The receipts for the period are deleted, but the LOG grows from 1MG to 2.3GB.   I'm working in a test environment, so it hasn't damaged the live database.

Does anyone have an idea why this isn't working? Any help would be greatly appreciated.

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Trouble deleting Journal to shrink database

    Mabuhay!

    Hi! On our part after we deleted some journal from the past year (we backup first the database and deleted the said squery) it runs smoothly and database has been reduced based on the rows weve deleted.

    We also run the truncate log file so we can avoid exceeding the database size limit on express.

    Chris

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Trouble deleting Journal to shrink database

    Thanks for the answer Michael. 3.95GB is correct. In looking at the "properties" in Administrator, the DB was actually at 100% already. I was able to delete some of the journal with a query that used Batch # instead of date. What you suggested is a much better long term solution.

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Trouble deleting Journal to shrink database

    You can use the dB Archive tool in the Retail Realm Utilities, or you can easily upgrade to a later version of the free SQL Server Express. 2008 was 10GB, and later versions added even more. You mean to say 3.95GB not 39.5, correct?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Trouble deleting Journal to shrink database

    The first time a tried, I did not get an error message. I tried again with a new backup and got this:

    An error occurred while executing query:

    Could not allocate space for object 'dbo.RecordDeletedLog'.'IX_TableName' in database 'TEST OLD BACK' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,431 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,503 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans