Journal table in database

Mar 03, 2007 6 Replies

Anyone know what data the Journal table stores. I gather its either all the transaction data or a "picture of the receipt" The journal table is taking up 1.8GB of the total 2.6GB database. If the journal table is just a picture of the receipt, is there anyway I can just keep them if they are less than 30 days old, as I've never looked in the journal for something more than a few days old.



Cheers



Thanks for the help guys

Each night I have a batch file that runs a couple of queries through sqlcmd, so basically all I have to do is add (make a backup before trying)

DELETE MyDatabaseName.dbo.Journal where time < getdate()-30

I remember reading somewhere that its not a good idea to run delete queries, because it doesn't perform the checks like RMS does. Would this be the case in this situation?

Cheers

Ran the query on my test database, which worked fine. However, it made the database size nearly triple what it was before.

I then ran

DBCC SHRINKDATABASE (MyDatabaseName, 10) GO

And it went back to roughly the same size again

What the? I must be doing something here (maybe I need something to do with the truncate part in dbcc shrink?)

Cheers

it might be something related to the recovery model, try to backup the transaction log then shrink the log file

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required