473,666 Members | 2,449 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What shrinks when shrinking

A huge (and never used) database log was taking up about 4 GB of HD
space. We want the data for historical capacity, however, don't care
about the transactions log.

After a bit of research I ran the script on:
http://support.microsoft.com/default...NoWebContent=1

(which works just fine on Sql Server 2k)

And then

DBCC SHRINKFILE(Ramd omDataData_Log, 2)

This shrank the log file from 4ish gigs to 2 MB.

Of course my boss did backflips and wanted me to do it to *all* the
databases. I told him that it was probably a bad idea since we do want
the transaction logs incase something crashes, we can recreate the DB
from (for example) a week ago's DB backup.

So my question is this: When I shrink it to 2mb (or 200 MB as I am
suggesting) what are we actually "losing" and "keeping" does it keep
the most recent transactions (in which case I need to figure how much
we add each day) or earliest records, or random ones, or are they all
just "compressed ?"

I don't weant to lost the transaction logs for the last week or two,
but now that this shrinking has become the holy grail I need to show
there will be bad things happening if I just make these logs all reset
to the size of a floppy disk on a regular basis.
Jul 20 '05 #1
1 2009

"John Mosey" <jm****@cayen.n et> wrote in message
news:9e******** *************** ***@posting.goo gle.com...
A huge (and never used) database log was taking up about 4 GB of HD
space. We want the data for historical capacity, however, don't care
about the transactions log.
This conflicts with what you say below.

Essentially it comes down to, "what do you need to recover."

If you can do a full backup once a day and don't care if you lose up to 24
hours worth of data, then set the db to simple recovery and ignore your
transaction logs.

If you need to recover up to the minute, or at least up to the point of the
last transaction log, then you need to keep them and do backups every so
often.

If you do a transaction log backup say every hour, your transaction log file
won't grow very large. You just need space to preserve all those logs.

Keep in mind that to recover, you need to apply the latest backup and ALL
transaction logs since then, not just the most recent.

Generally I'd recommend keeping at least two full backups, possibly more and
ALL transaction logs since the oldest full backup.


After a bit of research I ran the script on:
http://support.microsoft.com/default...NoWebContent=1
(which works just fine on Sql Server 2k)

And then

DBCC SHRINKFILE(Ramd omDataData_Log, 2)

This shrank the log file from 4ish gigs to 2 MB.

Of course my boss did backflips and wanted me to do it to *all* the
databases. I told him that it was probably a bad idea since we do want
the transaction logs incase something crashes, we can recreate the DB
from (for example) a week ago's DB backup.

So my question is this: When I shrink it to 2mb (or 200 MB as I am
suggesting) what are we actually "losing" and "keeping" does it keep
the most recent transactions (in which case I need to figure how much
we add each day) or earliest records, or random ones, or are they all
just "compressed ?"

The transaction log is basically a roadmap. It shows how to get from the
most recent full backup (or differential, but let's ignore those for now) to
the most recent state of the database.

So each transaction backup along the way is a snapshot of that roadmap.
I don't weant to lost the transaction logs for the last week or two,
but now that this shrinking has become the holy grail I need to show
there will be bad things happening if I just make these logs all reset
to the size of a floppy disk on a regular basis.


Well, it depends on your needs.

In our development environment, we just do backups, have the DB's in simple
recovery mode and don't worry about the transaction logs. If we lose a
database, we just restore the backup and move on. Not a big deal.

In our production environment, several key databases have a nightly backup
to disk (on a different device, never do disk backups to the same device as
your databases if you can help it) and transaction backups every hour.
(Except for one DB server where we do those every 15 minutes)

The subscriber database we don't bother to back up at all since we can
fairly easily recreate them from the publisher. So those are simple
recovery mode.

So, it basically comes down to, "what are your needs?"

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3974
by: Lyn | last post by:
Hi, I have a form which is opened from a button on another form. The form is used to display a list of records from a recordset in Continuous Mode. It is sized vertically to display about 25 rows and has a vertical scrollbar. This form has been working perfectly for weeks. However, I must have done something recently because now the detail section displays only one row at a time. That is, the form has shrunk vertically to about 3 cm...
3
5664
by: Tim Bücker | last post by:
Hello. The MeasureString method is quite slow so I am wondering how one can efficently draw a string in a growing or shrinking rectangle. In other words; having a huge rectangle the font size should be for example 100; having a small rectangle the font size should be 8. Any ideas? Thanks and greetings, Tim.
1
1755
by: Keith | last post by:
I have just tried form inheritance for the first time and I am having trouble with the controls shrinking each I build the project on my home computer and growing each time I build on my work computer. I had found that the AutoScaleBaseSize setting was inconsistent on some of the inherited forms and changing that stabilized the forms at home. But at work all the control widths are growing 28% on each build and all the control heights...
6
1032
by: CMM | last post by:
Does anyone know why the Description box at the bottom of the Properties toolbox is always shrinking? Every time I open up Visual Studio it's slightly smaller and smaller. This happened in VS2003 and now I realize it happesn in VS2005 as well. It's highly annoying. -- -C. Moya www.cmoya.com
6
1314
by: egpo | last post by:
Hi, I have a DB where I would like to maintain a fixed size and control it by myslef. I do not have the options: "Auto-Grow" and "Auto-Shrink" enabled. >From time to time, without a notice, or any logging, the database files gets shrinker and this causes a database full error. As I wrote, I would like to maintain the size of the database by myself and not automatioc by the DB server.
4
5086
by: Philip Nelson | last post by:
Folks, I've got a database and tablespaces "managed by automatic storage". I've deleted a lot of data from some tables. I've then reorged them. But the tablespaces don't appear to shrink in size (they just have lots of free space). How can I get DB2 to give the space back ?
1
1884
by: TomT | last post by:
I am having a difficult time solving a problem. Whenever I use :hover in a certain <div> the page shrinks in IE6. Of course, this problem does not exist with other browsers. It is even more vexing because this only happens in the <div> with the main content, not the <div> that contains the navigator with links to the content. Below I will append the pared down code. Briefy, I want to create a page that has a very long article. That article...
31
12754
by: banansol | last post by:
Hi, I just want to get this right. A call to realloc() will return NULL on error and the original memory is left untouched, both when requesting a larger or a smaller size that the original, right? But a call to realloc() with size set to zero is equivalent to free(), with returns void. Does that mean that a call to realloc() can fail when shinking memory except when
0
1712
by: Jerry Mcnealy | last post by:
There is an interesting article on java.net about SOA reusability, Shrinking the Lag between Business and IT: http://today.java.net/pub/a/today/2007/07/24/soa-reusability-shrinking-lag-time.html Blessings from business owners are important in all SOA implementations. This article articulates the vision of reusability with a different spin around the business users, the ultimate end users of SOA.
0
8440
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8352
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8863
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8780
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8636
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6189
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2005
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1763
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.