473,320 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Shrinking database log used for mirroring

Can anyone offer some advice on how to reduce the size of a database
log. The database is mirrored on another server using the logs. Thanks

Nov 22 '06 #1
5 6201
(d.******@gmail.com) writes:
Can anyone offer some advice on how to reduce the size of a database
log. The database is mirrored on another server using the logs. Thanks
Read http://www.karaszi.com/SQLServer/info_dont_shrink.asp to find out
why you maybe shouldn't.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Nov 22 '06 #2
Thanks, the article makes some good points, however the log file is
over 30 times bigger than the database and 94% empty, hence the need to
shrink.

Erland Sommarskog wrote:
(d.******@gmail.com) writes:
Can anyone offer some advice on how to reduce the size of a database
log. The database is mirrored on another server using the logs. Thanks

Read http://www.karaszi.com/SQLServer/info_dont_shrink.asp to find out
why you maybe shouldn't.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Nov 22 '06 #3
(d.******@gmail.com) writes:
Thanks, the article makes some good points, however the log file is
over 30 times bigger than the database and 94% empty, hence the need to
shrink.
Only if there is good reason to believe that it will not grow again. 94%
empty is the current state of affairs, but if you regularly run a large
operation, it will grow again.

DBCC SHRINKFILE is what you use to shrink, but I don't know if there are
any special considerations when mirroring is involved.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Nov 22 '06 #4
I've been trying with:

BACKUP LOG dbname WITH TRUNCATE_ONLY
DBCC SHRINKFILE (dbname)

but the query cannot execute because of the mirroring
Erland Sommarskog wrote:
(d.******@gmail.com) writes:
Thanks, the article makes some good points, however the log file is
over 30 times bigger than the database and 94% empty, hence the need to
shrink.

Only if there is good reason to believe that it will not grow again. 94%
empty is the current state of affairs, but if you regularly run a large
operation, it will grow again.

DBCC SHRINKFILE is what you use to shrink, but I don't know if there are
any special considerations when mirroring is involved.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Nov 22 '06 #5
(d.******@gmail.com) writes:
I've been trying with:

BACKUP LOG dbname WITH TRUNCATE_ONLY
DBCC SHRINKFILE (dbname)

but the query cannot execute because of the mirroring
Which of them? Certainly, I can imagine that BACKUP LOG WITH TRUNCATE_ONLY
is not permitted when you have mirroring. Then again, why would you
want to truncate the log? Just back it up to remove the active portion.

It may still be that you cannot shrink a log when you have mirroring
active. In such case, you will have to make the choice of smashing the
mirror to be able to shrink the log, or remember the old proverb "disk
is cheap".

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Nov 22 '06 #6

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

Similar topics

1
by: John Mosey | last post by:
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...
5
by: Ryan | last post by:
I'm devlving into 2005 and specifically mirroring. Having read the following article ( http://www.microsoft.com/technet/prodtechnol/sql/2005/dbmirror.mspx ), is mirroring a sensible option as it...
1
by: Calculated | last post by:
We have a number of databases mirrored including the ASPState session database used by the websites. However the connection string to the ASPState database does not allow you to include the...
2
by: William | last post by:
I've been tasked with taking over the support for a client's SQL Server database. I'm not a DBA by profession, I'm a software developer who uses SQL Server as a database designer. The clients...
0
by: serge | last post by:
I have 2 SQL Enterprise Editions running SP2 and same collation. When i try to start database mirroring I get the following error message: "The remote copy of database "ABC" has not been...
0
by: umeshpotdar | last post by:
i am doing mirroring on the data base i have done every step but i got problem below "Database Mirroring Transport is disabled in the endpoint configuration." this problem occured when i...
5
by: bosko19 | last post by:
We have recently set up two SQL Server 2005 Standard Edition servers with database mirroring. The mirrors function and fail over without a problem, but the Database Mirroring Monitor Job fails...
0
by: vishnutd4u | last post by:
Hi friends, This is vishnu.Here in our company we have decided to implement database mirroring in mysql.Database mirroring means just when one database server is down the backup database server...
0
by: kazper | last post by:
Good day, I have some problems regarding my Hard disk space for my logs in SQL Server 2005. When I try shrinking the database it returns an error not letting me to do anything about the size of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.