Solved

Setting a SQL database size limit

Posted on 2010-11-23
5
686 Views
Last Modified: 2012-05-10
I am trying to set a database SIZE limit for a SQL database on my SQL 2005 Standard server.  I want a specific database (a SYSLOG database) to limit itself to (1) GB.  I have set the maximum database size for this database in the database properties in SQL Enterprise Manager and indeed, the database is NOT growing larger than 1GB.

However, I do see the APPLICATION LOG of the SQL server filling up with THOUSANDS of messages indicating that the database is full and unable to be written to.

What I WANT to happen is for 1GB of data to be retained, with NEWER data pushing OLDER data out.  I thought this is what would be happening when I set a database size limit, but looking at the APPLICATION log, it does not seem that this is the case.  Can anyone tell me if I misunderstood what LIMIT DATABASE SIZE meant, and if this is NOT what I've configured, can it be done?
0
Comment
Question by:jkeegan123
  • 3
  • 2
5 Comments
 
LVL 10

Expert Comment

by:Humpdy
ID: 34203092
Hi,

What you need here is an archival process.

What you're trying to do cannot be done as part of a standard sql configuration.
Setting the size limit of a database will not truncate out old data and push new data in, so the messages you are getting are correct.

You will need some type of script to push out data to an archived table or database. Probably based by date rather than size I'd image.
So maybe every day you could have a job to say copy rows from your table which are older than 30 days for example. Once the rows are copied, you can delete them from your original table.
0
 
LVL 5

Author Comment

by:jkeegan123
ID: 34206137
I opened up the one table in my database (SYSLOG table) and looked at the actual DATA in the database, and it really truly IS only recent data, with older data being pushed out, it seems.  It's hard to EXACTLY tell because it's 1GB of SYSLOG data (text) from a firewall, so the Query seemed to go on FOREVER.  Any idea on the best way to query this data to see if its actually doing this?  I'm thinking a query that would be:  The fist 20 rows and the last 20 rows of data displayed from that table.  How could I show that?  Looking at this report several times would be a good indicator as to whether what I INTENDED to happen is ACTUALLY happening.

If it IS happening, can I suppress that event from logging?  I don't mean filtering it out, I mean setting SQL server to not log that event?
0
 
LVL 10

Accepted Solution

by:
Humpdy earned 500 total points
ID: 34206190
Is there date column on the table, or an auto increment int.
you can do
select top 20 * from table order by column
select top 20 * from table order by column desc
0
 
LVL 5

Author Comment

by:jkeegan123
ID: 34258079
I can't seem to get the results to work on this query, how would I select the database in the query given that it's configured as :  SQL SERVER --> master,model,etc...MY DATABASE --> MY DATABASE --> TABLE (syslog) --> Data that's taking up 1 GB
0
 
LVL 5

Author Closing Comment

by:jkeegan123
ID: 34294835
Comment was accurate but answer to question was incorrect, as we do NOT need an archival process.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now