What are the challenges you face when working across database platforms? Take the survey
Options

Need command line to change OPTION setting

mdgravesmdgraves Posts: 53
edited October 26, 2007 2:45PM in SQL Backup Previous Versions
I need to change the number of days of backup logs we retain, across all my instances. Can you provide the command line to change that value (I can run in batch mode) vs me logging onto my many client instances manually?

Comments

  • Options
    If you are referring to the text logs stored in Documents and Settings, you can do the following:

    1) Create a registry (.reg) file, with the following contents (%instance_name% is the name of the instance, ??? denotes the number of hours to wait, 24 for a day, 120 for 5 days, 240 for 10 days and so on...:

    [HKEY_LOCAL_MACHINE\Software\Red Gate\SQL Backup\BackupSettingsGlobal\%instance_name%]
    LogDeleteHours=???

    If using a 64-bit machine, this would be the following:

    [HKEY_LOCAL_MACHINE\Software\Wow6432Node\Red Gate\SQL Backup\BackupSettingsGlobal\%instance_name%]
    LogDeleteHours=???

    Then, to update; use the following command:

    regedit /s <filename>

    If you have more than one instance on a machine, you will need to modify/adapt this for each instance's name, but at least that's a lot quicker than doing every step by hand.

    Hope that helps,
    Jason
  • Options
    This leads me in direction I needed.

    Thanks again.
Sign In or Register to comment.