Log shipping deleting log files too soon.

  • jprovines (8/15/2011)


    backup_source_directory\\lap8db03\TransactionLogBackup

    backup_destination_directory\\lap8ea03\TransactionLogShippingTemp

    file_retention_period2880

    Are both of these folders being cleared after 2 days? If not which one is being cleared?

    Leo

    Leo
    Nothing in life is ever so complicated that with a little work it can't be made more complicated.

  • both

  • What time does the restore job run? At the same time as the backup job?

    It would be interesting to change the time and see if this changes the deleted files slightly. It may point to the destination process as being the problem. Also have you been through the job history to see what files are being deleted? You should see a list of files being deleted during each run.

    Also have you tried changing the destination restore time to 6 days to see if this affects the retention period?

    Cheers

    Leo

    Leo
    Nothing in life is ever so complicated that with a little work it can't be made more complicated.

  • I would expect this to be purged after 2 days

    backup_destination_directory\\lap8ea03\TransactionLogShippingTemp

    As this is set to 2 days

    file_retention_period2880

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Ahh, sorry guys, it was the mirror deleting the logs too soon. The principle was saying deleting old logs, but the mirror says deleting old logs and gives the file name. Can I just update the field "log_shipping_primary_databases.backup_retention_period" in the mirror to increase the retention time? I can't use the log shipping wizard because the mirror is not in full recovery. Or do i have to use the sp "sp_change_log_shipping_primary_database"?

  • jprovines (8/15/2011)


    Ahh, sorry guys, it was the mirror deleting the logs too soon. The principle was saying deleting old logs, but the mirror says deleting old logs and gives the file name. Can I just update the field "log_shipping_primary_databases.backup_retention_period" in the mirror to increase the retention time? I can't use the log shipping wizard because the mirror is not in full recovery. Or do i have to use the sp "sp_change_log_shipping_primary_database"?

    What do you mean by the "mirror" in this context? Are you also mirroring the database, or does this refer to the log shipping destination?

    Leo

    Leo
    Nothing in life is ever so complicated that with a little work it can't be made more complicated.

  • yes, database mirroring. Sorry, I thought I specified my setup. I knew that mirrored db's don't perform log shipping, but I didn't realize that they DO delete logs... My next step is to set the retention time for my mirrored database's logs, but I don't know the best way about it because I can't use the log shipping wizard on it...

  • jprovines (8/15/2011)


    Ahh, sorry guys, it was the mirror deleting the logs too soon. The principle was saying deleting old logs, but the mirror says deleting old logs and gives the file name. Can I just update the field "log_shipping_primary_databases.backup_retention_period" in the mirror to increase the retention time? I can't use the log shipping wizard because the mirror is not in full recovery. Or do i have to use the sp "sp_change_log_shipping_primary_database"?

    would have been helpful to know this before 😉

    Mirroring doesnt delete log files backups, are you saying that the jobs on the mirror\primary are deleting the log backups

    run this against the mirror\primary and post the results

    use master

    exec sp_help_log_shipping_primary_database @database = 'yourdb'

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Yeah, that would have saved some time, so sorry, I thought mentioned it. Here is the mirror/primary output. Is it safe to just manually update the backup_retention_period field? or would I need to fail-over my server and use the log shipping config wizard or use a log shipping sp to make this change?

    primary_id0B5E3EB5-4F06-454F-B3C9-E19ADF2E147E

    primary_databaseMainDb

    backup_directory\\lap8db03\TransactionLogBackup

    backup_share\\lap8db03\TransactionLogBackup

    backup_retention_period2880

    backup_compression2

    backup_job_id369B548D-2BA1-4666-9AF5-960DB29AF7F9

    monitor_serverLAP8DB03

    monitor_server_security_mode1

    backup_threshold60

    threshold_alert14420

    threshold_alert_enabled1

    last_backup_file**** The primary database is in either NORECOVERY mode or STANDBY mode. ****

    last_backup_date30:00.7

    last_backup_date_utc30:00.7

    history_retention_period5760

  • I would expect you to use sp_change_log_shipping_secondary_primary (http://msdn.microsoft.com/en-us/library/ms180034%28v=SQL.100%29.aspx) or sp_change_log_shipping_secondary_database (http://msdn.microsoft.com/en-us/library/ms177507%28v=SQL.100%29.aspx) to change the settings for the secondary server.

  • jprovines (8/16/2011)


    Is it safe to just manually update the backup_retention_period field?

    That's exactly how you do it!

    Use the following on the mirror\primary

    exec sp_change_log_shipping_primary_database @database = 'YourDB',

    @backup_retention_period = '8640'

    Only change the secondary if you want to change the retention period for the files kept on the secondary server.

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • and for the secondary server I would do this?

    exec sp_change_log_shipping_secondary_primary @database = 'MainDb',

    @ file_retention_period = '8640'

  • jpro1001 (8/16/2011)


    and for the secondary server I would do this?

    exec sp_change_log_shipping_secondary_primary @database = 'MainDb',

    @ file_retention_period = '8640'

    😉

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Thank you for all your help! In case anyone else wanted to know it's slightly different:

    exec sp_change_log_shipping_secondary_primary

    @primary_server = 'LAP8EA01',

    @primary_database = 'MainDb',

    @file_retention_period = '8640'

  • oops my bad, yes you need primary server too :blush:

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

Viewing 15 posts - 16 through 29 (of 29 total)

You must be logged in to reply to this topic. Login to reply