Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 1234»»»

sql 2005 and logshipping Expand / Collapse
Author
Message
Posted Monday, August 06, 2012 2:44 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, August 16, 2012 7:55 AM
Points: 18, Visits: 44
hi,
I have a basic question since years ago now, I did not find any solution.

One database on one server name SQL1.
I active the logshipping on this database, witch forced me to pass the recovery model simple to full. (logshipping wont be active if I didnt made this change).

The secondary server witch will receive my logshipping database name SQL2.

All work perfectly, my logshipping is set up with no problem, and work very well.
But i have now a hudge problem... space disk probleme, because the .LDF of by database are now very big.

And all the option in SQL to stop the file grow break the logshipping, if I use it. Like "shrink or anything else".

Is there a solution to fixe that ? or it's a normal issu when we active the logshipping?



thanks for your help
Post #1340412
Posted Monday, August 06, 2012 2:53 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Thursday, August 22, 2013 9:13 AM
Points: 496, Visits: 601
The transaction log will be kept in check by a regular full backup schedule. If you're using a full recovery model, you should be prepared for a greater transaction log space requirement. Consider speaking to your SAN admin / person responsible for storage to get more disk space allocated to the LUN housing the transaction logs. Monitor your transaction log sizes before and after backups.

---

Note to developers:
CAST(SUBSTRING(CAST(FLOOR(NULLIF(ISNULL(COALESCE(1,NULL),NULL),NULL)) AS CHAR(1)),1,1) AS INT) == 1
So why complicate your code AND MAKE MY JOB HARDER??!

Want to get the best help? Click here http://www.sqlservercentral.com/articles/Best+Practices/61537/ (Jeff Moden)
My blog: http://uksqldba.blogspot.com
Visit http://www.DerekColley.co.uk to find out more about me.
Post #1340416
Posted Monday, August 06, 2012 2:54 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, August 28, 2013 2:37 AM
Points: 5,075, Visits: 4,834
This is standard behavour, the log will become larger than what you are used to as it is not marking the log as re-usable until a log backup occurs.

How often have you set logshipping up to backup the log?

Also check this link out on managing the transaction log http://www.sqlservercentral.com/articles/Administration/64582/




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1340418
Posted Monday, August 06, 2012 3:03 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, August 16, 2012 7:55 AM
Points: 18, Visits: 44
Hi Derek,

thanks for your reply.

But, every night we did a full backup this should free the transaction log space isnt it ? But unfortunatly in my case it wont... but maybe the full backup didnot free the transaction log and my knowless are wrong ?
We also once by week make a reorg index task.

no other solution to make more space? what happends in few years? For a little database 5 giga, I have 20giga of transation log... And what about in one years? 40 ? It's not for me a normal issu isnt' ?

Post #1340428
Posted Monday, August 06, 2012 3:06 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, August 28, 2013 2:37 AM
Points: 5,075, Visits: 4,834
Full backups do not do anything to the transaction log. Only a transaction log backup can mark the log as re-usable.

How often is the log backup taking place?




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1340435
Posted Monday, August 06, 2012 3:12 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, August 16, 2012 7:55 AM
Points: 18, Visits: 44
anthony.green (8/6/2012)
This is standard behavour, the log will become larger than what you are used to as it is not marking the log as re-usable until a log backup occurs.

How often have you set logshipping up to backup the log?

Also check this link out on managing the transaction log http://www.sqlservercentral.com/articles/Administration/64582/


thanks Anthony for your reply.

I'm not sure about the question of the backup log ? When I set up the logshipping It ask me When I want to delete the older filer (in my case we keep it 6hours)
And the 3 ls job (backup, copy and restore) are schedule every 30mn.
I know that the backup log are the best way to free the space, but it's not compatible with the logshipping. If I did a backup log with a tsql, the lsrestore will be break, with an error message like this : "Message
2012-06-21 16:50:26.66 *** Error: Could not apply log backup file 'E:\TRNSECONDAIRE\db_20120621144913.trn' to secondary database 'db_bis'.(Microsoft.SqlServer.Management.LogShipping) ***
2012-06-21 16:50:26.66 *** Error: This log cannot be restored because a gap in the log chain was created. Use more recent data backups to bridge the gap.
RESTORE LOG is terminating abnormally.(.Net SqlClient Data Provider) ***
"

I tried so many thing... every one break my logshipping...
Post #1340441
Posted Monday, August 06, 2012 3:17 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, August 28, 2013 2:37 AM
Points: 5,075, Visits: 4,834
If you have such a big log after 30 minutes, then change it to 15 minutes.

You can shrink the log in full recovery, but you will have to wait until the log reuse description is set to nothing, which in full recovery you have to be pretty quick.

select log_reuse_wait_desc from sys.databases where name = ''

You can also take a manual backup of the log in Logshipping, the ONLY caviat, is that the TRN file must go into the same directory which is used in logshipping so that it can be copied and restored as normal.




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1340445
Posted Monday, August 06, 2012 3:38 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, August 16, 2012 7:55 AM
Points: 18, Visits: 44
anthony.green (8/6/2012)
If you have such a big log after 30 minutes, then change it to 15 minutes.

You can shrink the log in full recovery, but you will have to wait until the log reuse description is set to nothing, which in full recovery you have to be pretty quick.

select log_reuse_wait_desc from sys.databases where name = ''

You can also take a manual backup of the log in Logshipping, the ONLY caviat, is that the TRN file must go into the same directory which is used in logshipping so that it can be copied and restored as normal.


"If you have such a big log after 30 minutes, then change it to 15 minutes."
I dont understand what you mean.
My ldf file are big, and I think it take bigger maybe everyweek, perhaps month ? It's no every 30mn when my logshipping running.
The shrink option have every time we tried with a lot of option "truncate, truncate only etc etc" break the logshipping sequence.

"You can also take a manual backup of the log in Logshipping, the ONLY caviat, is that the TRN file must go into the same directory which is used in logshipping so that it can be copied and restored as normal"
I tried also to made a manual backup of the log, and then it's the error message 2 post away. But I will tried to set up into the logshipping folder... maybe it's the issu!

I run to test it, and I come back here.
Post #1340464
Posted Monday, August 06, 2012 3:59 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, August 16, 2012 7:55 AM
Points: 18, Visits: 44
So on my sql test server,

I create a quick logshipping, with a data base witch have already a hudge LDF file.

I made a tsql backup log like that :

"BACKUP LOG database
TO DISK = 'E:\TRNLOCAL\test.trn'
GO"

Work fine, BUT the LDF file are still hudge. What shall I do now to down the file? Shrink it ? (pretty sure it's will break my logshipping ... ?)
Post #1340478
Posted Monday, August 06, 2012 4:01 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, August 28, 2013 2:37 AM
Points: 5,075, Visits: 4,834
Shrink the file, but dont use truncate only.

You will need to ensure that the reuse desc is set to nothing to shrink it down as low as possible, otherwise it will only shrink to the last active part of the log.

Remember, a backup be it a full / diff / log will not shrink a file, shrinking is an expensive process and causes lots of issues especially around index fragmentation in the MDF. The file has grown to that size as it needs to be that size to handle all the transactions you have within the 30 minute backup window.

If you set the log backups to 15 minutes, you will potentially end up with a smaller log, but all depends how big the file needs to be to handle 15 minutes of transactions.

Read the article on managing the transaction log, and size your log accordingly.




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1340479
« Prev Topic | Next Topic »

Add to briefcase 1234»»»

Permissions Expand / Collapse