Solved

Is there a way to shrink an sql database that has already reached the maximum size?

Posted on 2011-09-19
7
430 Views
Last Modified: 2012-05-12
is there a way to forcefully shrink a database that has already reached the maximum size of 4gb?
0
Comment
Question by:Petersennik
7 Comments
 
LVL 25

Expert Comment

by:Lee Savidge
Comment Utility
Im guessing this is SQL 2005 Express. SQL 2008 Express allows for a 10gb database. Failing that, I would try using DBCC SHRINKFILE. That's about you're only option short of deleting records.
0
 
LVL 3

Expert Comment

by:chandrasekar1
Comment Utility
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
shrinking will only work if you can shrink (aka if there is unused space)

for data files, this means you would need to delete data from the tables
for log files, this means that you need to have regulare transaction log backup in place (presuming the db is in the FULL recovery mode)
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 5

Expert Comment

by:AlokJain0412
Comment Utility


Go to The Query Analyzer and Put Following command



1.

DBCC SHRINKDATABASE ('Your Database Name','Shrink Precentage in number)
Example
DBCC SHRINKDATABASE (UserDB, 10)

Or

2 The following example shrinks the data files in the database to the last allocated extent.
DBCC SHRINKDATABASE (UserDB, TRUNCATEONLY)


Go to Enterprise manager & make sure you restrict the file size of the database

if not solve then let me know again  Where you are getting message



0
 

Author Comment

by:Petersennik
Comment Utility
i cant do a shrink as there isn't any unused space left in the database. I cant delete anything because the database is for my anti-virus which i now cant log into due to the database having reached maximum capacity
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
then you have to upgrade the edition of the sql server.
0
 
LVL 5

Accepted Solution

by:
AlokJain0412 earned 500 total points
Comment Utility
You hv to upgrade sql server

10GB is the Limit for SQL Server 2008 R2 Express and 4GB is the limit for the Express 2008.

You can try following  

Create disk space by deleting
unneeded files,
 dropping objects

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SQL Server DeDupe Table 3 29
SQL Server agent & maintenance task issue ? 8 53
SQL help 5 46
Stored procedure 4 26
I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 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

11 Experts available now in Live!

Get 1:1 Help Now