Solved

bring a database size down (there is no data anymore)

Posted on 2011-03-10
12
272 Views
Last Modified: 2012-06-27
for business reasons, data from a database was totally truncated, but size was not altered. They want to just keep the schema for quick reference without data. How can I shrink the whole database size back down, since there is no more space required for data and index. So, basically, not wanting to drop the DB, but want to reclaim the space on disk, and satisfying only with the schema.

thanks
0
Comment
Question by:anushahanna
  • 5
  • 3
  • 3
  • +1
12 Comments
 
LVL 32

Accepted Solution

by:
ewangoya earned 84 total points
ID: 35101249

Do a backup of the database which should now be fast

From Management Studio, right click on database, go to Tasks->Shrink->Database

Taht should do the trick
0
 
LVL 9

Assisted Solution

by:AriMc
AriMc earned 83 total points
ID: 35101255
0
 
LVL 21

Assisted Solution

by:Jason Yousef, MS
Jason Yousef, MS earned 333 total points
ID: 35101579
I'm not really adding much but I've a screen shot that I would share.
 shrink
0
 
LVL 6

Author Comment

by:anushahanna
ID: 35103054
ok - great. why backup before shrink? does it help the shrink process better?
0
 
LVL 21

Assisted Solution

by:Jason Yousef, MS
Jason Yousef, MS earned 333 total points
ID: 35103148
A full backup doesn't truncate or shrink. Only a transaction log backup will truncate the log and allow shrinkage.

In full and bulk-logged recovery you need log backups to mark log space as reusable. In simple recovery a checkpoint is sufficient (which run automatically)
0
 
LVL 32

Expert Comment

by:ewangoya
ID: 35103254


Full backup will truncate the log, This  marks the virtual logs as inactive that do not hold any part of the logical log.
A shrink operation will then remove the inactive virtual logs
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 21

Assisted Solution

by:Jason Yousef, MS
Jason Yousef, MS earned 333 total points
ID: 35103316
Ewangoya: in respect to you and your Rank  and with no offense at all, we're all here to help and gain more knowledge.

but to what I know. Neither Full or Differential backups truncate the transaction log. During these backups enough of the log is backed up to provide a consistant backup. Transaction Log backups are the only backups that truncate the transaction log of commited transactions.

If you have the database using the Full Recovery model to allow for point in time recovery, you also need to implement transaction log backups between your full and/or differential backups.

http://technet.microsoft.com/en-us/library/ms189085.aspx
0
 
LVL 32

Expert Comment

by:ewangoya
ID: 35103596

My misquote
No offense taken, log is truncated when you backup the transaction log
0
 
LVL 21

Expert Comment

by:Jason Yousef, MS
ID: 35103677

@ewangoya: Cool :)

@anushahanna: if your question has been answered please award 'ewangoya' the points, he actually answered your question first.
0
 
LVL 6

Author Comment

by:anushahanna
ID: 35103780
Shrink->Database affects only the data files, right? not log files?
0
 
LVL 21

Assisted Solution

by:Jason Yousef, MS
Jason Yousef, MS earned 333 total points
ID: 35103876
Yep, when you need to shrink the LOG, you select "files" and then change it to LOG
loggg.jpg
0
 
LVL 6

Author Comment

by:anushahanna
ID: 35143766
thanks a lot for the pictures and explanations.
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

911 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

16 Experts available now in Live!

Get 1:1 Help Now