SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


sql 2005 and logshipping


sql 2005 and logshipping

Author
Message
didi77
didi77
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
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
derek.colley
derek.colley
SSCrazy
SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)

Group: General Forum Members
Points: 2004 Visits: 603
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??!Crazy

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.

anthony.green
anthony.green
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24790 Visits: 6519
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
When a question, really isn't a question - Jeff Smith
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


didi77
didi77
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
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' ?
anthony.green
anthony.green
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24790 Visits: 6519
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
When a question, really isn't a question - Jeff Smith
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


didi77
didi77
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
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...
anthony.green
anthony.green
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24790 Visits: 6519
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
When a question, really isn't a question - Jeff Smith
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


didi77
didi77
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
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.
didi77
didi77
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
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 ... ?)
anthony.green
anthony.green
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24790 Visits: 6519
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
When a question, really isn't a question - Jeff Smith
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


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search