Solved

Setting a SQL database size limit

Posted on 2010-11-23
5
691 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Server Results to Excel File 18 73
How to manage Hyper-V 2016 from Windows 7 Pro 2 45
selective rebuild of SQL Tables in scheduled job 10 37
SQL- GROUP BY 4 21
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.

735 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