Solved

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

Posted on 2011-09-19
7
434 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
ID: 36558988
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
ID: 36558996
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 36559050
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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 5

Expert Comment

by:AlokJain0412
ID: 36559053


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
ID: 36559494
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]
ID: 36559716
then you have to upgrade the edition of the sql server.
0
 
LVL 5

Accepted Solution

by:
AlokJain0412 earned 500 total points
ID: 36559961
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
index  - last use and update 8 56
Compare data between two databases 16 95
how many extra RAM for SQL server is needed 22 34
Query to Add Late Tolerance 10 59
Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

937 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

7 Experts available now in Live!

Get 1:1 Help Now