We have a SQL 2005 server running the following backup job:
<font face="Courier New" size="2"><br><f ont color="blue">/* Created by
<a href="http://www.wangz.net/gsqlparser/sqlpp/sqlformat.htm"> free
online sql formatter</a*/</font><br><br>
<font color = "blue">EXEC UTE</font> <fon t color =
"maroon">master </font><font color = "silver">.</font><font color =
"maroon">db o</font><font color = "silver">.</font><font color =
"#8000FF">xp_cr eate_subdir</font>
<br>   ; <font color = "red">N'\\Serve r\Backups
\DBServerName\\ DB_Name__METABA SE'</font>
<br><br>
<font color = "blue">GO</font>
<br><br>
<font color = "blue">EXEC UTE</font> <fon t color =
"maroon">master </font><font color = "silver">.</font><font color =
"maroon">db o</font><font color = "silver">.</font><font color =
"#8000FF">xp_cr eate_subdir</font>
<br>   ; <font color = "red">N'\\serve r\Backups
\DBServerName\\ DB_Name__MSCRM' </font>
<br><br>
<font color = "blue">GO</font>
<br><br>
<font color = "blue">BACK UP</font> <fon t color = "blue">DATABASE </
font> <fon t color = "maroon">[db_name__metaba se]</
font> <fon t color = "blue">TO</font> <fon t color =
"maroon">di sk</font> <fon t color = "silver">=</font> <fon t
color = "red">N'\\serve r\Backups\DBSer verName\\DB_Nam e__METABASE
\DB_Name__METAB ASE_backup_2006 10261158.bak'</font> <fon t color =
"blue">WITH </font> <fon t color = "maroon">differ ential</
font> <fon t color = "silver">,</font> <fon t color =
"maroon">noform at</font> <fon t color = "silver">,</
font> <fon t color = "maroon">noinit </font> <fon t color =
"silver">,</font> <fon t color = "maroon">na me</font> <fon t
color = "silver">=</font> <fon t color =
"red">N'DB_Name __METABASE_back up_200610261158 39'</font> <fon t
color = "silver">,</font> <fon t color = "maroon">sk ip</
font> <fon t color = "silver">,</font> <fon t color =
"maroon">rewind </font> <fon t color = "silver">,</font> <fon t
color = "maroon">nounlo ad</font> <fon t color = "silver">,</
font> <fon t color = "maroon">st ats</font> <fon t color =
"silver">=</font> <fon t color = "black">10</font>
<br><br>
<font color = "blue">GO</font>
<br><br>
<font color = "blue">DECL ARE</font> &nbs p;<font color =
"#8000FF">@back upSetId</font> &nbs p;<font color = "blue">AS</
font> <fon t color = "black">INT </font>
<br><br>
<font color = "blue">SELE CT</font> <fon t color =
"#8000FF">@back upSetId</font> <fon t color = "silver">=</
font> <fon t color = "maroon">positi on</font>
<br><font color = "blue">FROM </font> &nbs p; <font color =
"maroon">ms db</font><font color = "silver">.</font><font color =
"silver">.</font><font color = "maroon">backup set</font>
<br><font color = "blue">WHER E</font> &nbs p;<font color =
"maroon">databa se_name</font> <fon t color = "silver">=</
font> <fon t color = "red">N'DB_Name __METABASE'</font>
<br>   ; &n bsp;   ;<font color =
"blue">AND</font> <fon t color = "maroon">backup _set_id</
font> <fon t color = "silver">=</font> <fon t color =
"silver">(</font><font color = "blue">SELE CT</font> <fon t color =
"fuchsia"><b>MA X</font></b><font color = "silver">(</font><font color
= "maroon">backup _set_id</font><font color = "silver">)</font>
<br>   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; <font
color = "blue">FROM </font> &nbs p; <font color =
"maroon">ms db</font><font color = "silver">.</font><font color =
"silver">.</font><font color = "maroon">backup set</font>
<br>   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; <font
color = "blue">WHER E</font> &nbs p;<font color =
"maroon">databa se_name</font> <fon t color = "silver">=</
font> <fon t color = "red">N'DB_Name __METABASE'</font><font color
= "silver">)</font>
<br><br>
<font color = "blue">IF</font> <fon t color =
"#8000FF">@back upSetId</font> <fon t color = "blue">IS</
font> <fon t color = "blue">NULL </font>
<br>   ;<font color = "blue">BEGI N</font>
<br>   ; <f ont color = "blue">RAISERRO R</
font> <fon t color = "silver">(</font><font color =
"red">N'Verify& nbsp;failed.&nb sp;Backup information&nbs p;for data base ''DB_ Name__METABASE' ' not  ;found.'</
font><font color = "silver">,</font><font color = "black">16</
font><font color = "silver">,</font><font color = "black">1</
font><font color = "silver">)</font>
<br>   ;<font color = "blue">END</font>
<br><br>
<font color = "blue">REST ORE</font> <fon t color =
"maroon">verify only</font> <fon t color = "blue">FROM </
font> <fon t color = "maroon">di sk</font> <fon t color =
"silver">=</font> <fon t color = "red">N'\\serve r\Backups
\DBServerName\\ DB_Name__METABA SE
\DB_Name__METAB ASE_backup_2006 10261158.bak'</font> <fon t color =
"blue">WITH </font> <fon t color = "blue">FILE </font> <fon t
color = "silver">=</font> <fon t color = "#8000FF">@back upSetId</
font> <fon t color = "silver">,</font> <fon t color =
"maroon">nounlo ad</font> <fon t color = "silver">,</
font> <fon t color = "maroon">norewi nd</font>
<br><br>
<font color = "blue">GO</font>
<br><br>
<font color = "blue">BACK UP</font> <fon t color = "blue">DATABASE </
font> <fon t color = "maroon">[db_name__mscrm]</font> <fon t
color = "blue">TO</font> <fon t color = "maroon">di sk</
font> <fon t color = "silver">=</font> <fon t color = "red">N'\
\server\Backups \DBServerName\\ DB_Name__MSCRM
\DB_Name__MSCRM _backup_2006102 61158.bak'</font> <fon t color =
"blue">WITH </font> <fon t color = "maroon">differ ential</
font> <fon t color = "silver">,</font> <fon t color =
"maroon">noform at</font> <fon t color = "silver">,</
font> <fon t color = "maroon">noinit </font> <fon t color =
"silver">,</font> <fon t color = "maroon">na me</font> <fon t
color = "silver">=</font> <fon t color =
"red">N'DB_Name __MSCRM_backup_ 20061026115839' </font> <fon t color
= "silver">,</font> <fon t color = "maroon">sk ip</font> <fon t
color = "silver">,</font> <fon t color = "maroon">rewind </
font> <fon t color = "silver">,</font> <fon t color =
"maroon">nounlo ad</font> <fon t color = "silver">,</
font> <fon t color = "maroon">st ats</font> <fon t color =
"silver">=</font> <fon t color = "black">10</font>
<br><br>
<font color = "blue">GO</font>
<br><br>
<font color = "blue">DECL ARE</font> &nbs p;<font color =
"#8000FF">@back upSetId</font> &nbs p;<font color = "blue">AS</
font> <fon t color = "black">INT </font>
<br><br>
<font color = "blue">SELE CT</font> <fon t color =
"#8000FF">@back upSetId</font> <fon t color = "silver">=</
font> <fon t color = "maroon">positi on</font>
<br><font color = "blue">FROM </font> &nbs p; <font color =
"maroon">ms db</font><font color = "silver">.</font><font color =
"silver">.</font><font color = "maroon">backup set</font>
<br><font color = "blue">WHER E</font> &nbs p;<font color =
"maroon">databa se_name</font> <fon t color = "silver">=</
font> <fon t color = "red">N'DB_Name __MSCRM'</font>
<br>   ; &n bsp;   ;<font color =
"blue">AND</font> <fon t color = "maroon">backup _set_id</
font> <fon t color = "silver">=</font> <fon t color =
"silver">(</font><font color = "blue">SELE CT</font> <fon t color =
"fuchsia"><b>MA X</font></b><font color = "silver">(</font><font color
= "maroon">backup _set_id</font><font color = "silver">)</font>
<br>   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; <font
color = "blue">FROM </font> &nbs p; <font color =
"maroon">ms db</font><font color = "silver">.</font><font color =
"silver">.</font><font color = "maroon">backup set</font>
<br>   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; <font
color = "blue">WHER E</font> &nbs p;<font color =
"maroon">databa se_name</font> <fon t color = "silver">=</
font> <fon t color = "red">N'DB_Name __MSCRM'</font><font color =
"silver">)</font>
<br><br>
<font color = "blue">IF</font> <fon t color =
"#8000FF">@back upSetId</font> <fon t color = "blue">IS</
font> <fon t color = "blue">NULL </font>
<br>   ;<font color = "blue">BEGI N</font>
<br>   ; <f ont color = "blue">RAISERRO R</
font> <fon t color = "silver">(</font><font color =
"red">N'Verify& nbsp;failed.&nb sp;Backup information&nbs p;for data base ''DB_ Name__MSCRM''&n bsp;not fo und.'</
font><font color = "silver">,</font><font color = "black">16</
font><font color = "silver">,</font><font color = "black">1</
font><font color = "silver">)</font>
<br>   ;<font color = "blue">END</font>
<br><br>
<font color = "blue">REST ORE</font> <fon t color =
"maroon">verify only</font> <fon t color = "blue">FROM </
font> <fon t color = "maroon">di sk</font> <fon t color =
"silver">=</font> <fon t color = "red">N'\\serve r\Backups
\DBServerName\\ DB_Name__MSCRM\ DB_Name__MSCRM_ backup_20061026 1158.bak'</
font> <fon t color = "blue">WITH </font> <fon t color =
"blue">FILE </font> <fon t color = "silver">=</font> <fon t
color = "#8000FF">@back upSetId</font> <fon t color = "silver">,</
font> <fon t color = "maroon">nounlo ad</font> <fon t color =
"silver">,</font> <fon t color = "maroon">norewi nd</font>
</font>
This job was set up long before i started here and the problem is that
the backup file itself has grown to be over 230 GB. It does not
appear that the backup job is pruning the file. is there a way to
view the contents of this file and then prune it so we keep no more
then two weeks worth of data.
Thanks
<font face="Courier New" size="2"><br><f ont color="blue">/* Created by
<a href="http://www.wangz.net/gsqlparser/sqlpp/sqlformat.htm"> free
online sql formatter</a*/</font><br><br>
<font color = "blue">EXEC UTE</font> <fon t color =
"maroon">master </font><font color = "silver">.</font><font color =
"maroon">db o</font><font color = "silver">.</font><font color =
"#8000FF">xp_cr eate_subdir</font>
<br>   ; <font color = "red">N'\\Serve r\Backups
\DBServerName\\ DB_Name__METABA SE'</font>
<br><br>
<font color = "blue">GO</font>
<br><br>
<font color = "blue">EXEC UTE</font> <fon t color =
"maroon">master </font><font color = "silver">.</font><font color =
"maroon">db o</font><font color = "silver">.</font><font color =
"#8000FF">xp_cr eate_subdir</font>
<br>   ; <font color = "red">N'\\serve r\Backups
\DBServerName\\ DB_Name__MSCRM' </font>
<br><br>
<font color = "blue">GO</font>
<br><br>
<font color = "blue">BACK UP</font> <fon t color = "blue">DATABASE </
font> <fon t color = "maroon">[db_name__metaba se]</
font> <fon t color = "blue">TO</font> <fon t color =
"maroon">di sk</font> <fon t color = "silver">=</font> <fon t
color = "red">N'\\serve r\Backups\DBSer verName\\DB_Nam e__METABASE
\DB_Name__METAB ASE_backup_2006 10261158.bak'</font> <fon t color =
"blue">WITH </font> <fon t color = "maroon">differ ential</
font> <fon t color = "silver">,</font> <fon t color =
"maroon">noform at</font> <fon t color = "silver">,</
font> <fon t color = "maroon">noinit </font> <fon t color =
"silver">,</font> <fon t color = "maroon">na me</font> <fon t
color = "silver">=</font> <fon t color =
"red">N'DB_Name __METABASE_back up_200610261158 39'</font> <fon t
color = "silver">,</font> <fon t color = "maroon">sk ip</
font> <fon t color = "silver">,</font> <fon t color =
"maroon">rewind </font> <fon t color = "silver">,</font> <fon t
color = "maroon">nounlo ad</font> <fon t color = "silver">,</
font> <fon t color = "maroon">st ats</font> <fon t color =
"silver">=</font> <fon t color = "black">10</font>
<br><br>
<font color = "blue">GO</font>
<br><br>
<font color = "blue">DECL ARE</font> &nbs p;<font color =
"#8000FF">@back upSetId</font> &nbs p;<font color = "blue">AS</
font> <fon t color = "black">INT </font>
<br><br>
<font color = "blue">SELE CT</font> <fon t color =
"#8000FF">@back upSetId</font> <fon t color = "silver">=</
font> <fon t color = "maroon">positi on</font>
<br><font color = "blue">FROM </font> &nbs p; <font color =
"maroon">ms db</font><font color = "silver">.</font><font color =
"silver">.</font><font color = "maroon">backup set</font>
<br><font color = "blue">WHER E</font> &nbs p;<font color =
"maroon">databa se_name</font> <fon t color = "silver">=</
font> <fon t color = "red">N'DB_Name __METABASE'</font>
<br>   ; &n bsp;   ;<font color =
"blue">AND</font> <fon t color = "maroon">backup _set_id</
font> <fon t color = "silver">=</font> <fon t color =
"silver">(</font><font color = "blue">SELE CT</font> <fon t color =
"fuchsia"><b>MA X</font></b><font color = "silver">(</font><font color
= "maroon">backup _set_id</font><font color = "silver">)</font>
<br>   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; <font
color = "blue">FROM </font> &nbs p; <font color =
"maroon">ms db</font><font color = "silver">.</font><font color =
"silver">.</font><font color = "maroon">backup set</font>
<br>   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; <font
color = "blue">WHER E</font> &nbs p;<font color =
"maroon">databa se_name</font> <fon t color = "silver">=</
font> <fon t color = "red">N'DB_Name __METABASE'</font><font color
= "silver">)</font>
<br><br>
<font color = "blue">IF</font> <fon t color =
"#8000FF">@back upSetId</font> <fon t color = "blue">IS</
font> <fon t color = "blue">NULL </font>
<br>   ;<font color = "blue">BEGI N</font>
<br>   ; <f ont color = "blue">RAISERRO R</
font> <fon t color = "silver">(</font><font color =
"red">N'Verify& nbsp;failed.&nb sp;Backup information&nbs p;for data base ''DB_ Name__METABASE' ' not  ;found.'</
font><font color = "silver">,</font><font color = "black">16</
font><font color = "silver">,</font><font color = "black">1</
font><font color = "silver">)</font>
<br>   ;<font color = "blue">END</font>
<br><br>
<font color = "blue">REST ORE</font> <fon t color =
"maroon">verify only</font> <fon t color = "blue">FROM </
font> <fon t color = "maroon">di sk</font> <fon t color =
"silver">=</font> <fon t color = "red">N'\\serve r\Backups
\DBServerName\\ DB_Name__METABA SE
\DB_Name__METAB ASE_backup_2006 10261158.bak'</font> <fon t color =
"blue">WITH </font> <fon t color = "blue">FILE </font> <fon t
color = "silver">=</font> <fon t color = "#8000FF">@back upSetId</
font> <fon t color = "silver">,</font> <fon t color =
"maroon">nounlo ad</font> <fon t color = "silver">,</
font> <fon t color = "maroon">norewi nd</font>
<br><br>
<font color = "blue">GO</font>
<br><br>
<font color = "blue">BACK UP</font> <fon t color = "blue">DATABASE </
font> <fon t color = "maroon">[db_name__mscrm]</font> <fon t
color = "blue">TO</font> <fon t color = "maroon">di sk</
font> <fon t color = "silver">=</font> <fon t color = "red">N'\
\server\Backups \DBServerName\\ DB_Name__MSCRM
\DB_Name__MSCRM _backup_2006102 61158.bak'</font> <fon t color =
"blue">WITH </font> <fon t color = "maroon">differ ential</
font> <fon t color = "silver">,</font> <fon t color =
"maroon">noform at</font> <fon t color = "silver">,</
font> <fon t color = "maroon">noinit </font> <fon t color =
"silver">,</font> <fon t color = "maroon">na me</font> <fon t
color = "silver">=</font> <fon t color =
"red">N'DB_Name __MSCRM_backup_ 20061026115839' </font> <fon t color
= "silver">,</font> <fon t color = "maroon">sk ip</font> <fon t
color = "silver">,</font> <fon t color = "maroon">rewind </
font> <fon t color = "silver">,</font> <fon t color =
"maroon">nounlo ad</font> <fon t color = "silver">,</
font> <fon t color = "maroon">st ats</font> <fon t color =
"silver">=</font> <fon t color = "black">10</font>
<br><br>
<font color = "blue">GO</font>
<br><br>
<font color = "blue">DECL ARE</font> &nbs p;<font color =
"#8000FF">@back upSetId</font> &nbs p;<font color = "blue">AS</
font> <fon t color = "black">INT </font>
<br><br>
<font color = "blue">SELE CT</font> <fon t color =
"#8000FF">@back upSetId</font> <fon t color = "silver">=</
font> <fon t color = "maroon">positi on</font>
<br><font color = "blue">FROM </font> &nbs p; <font color =
"maroon">ms db</font><font color = "silver">.</font><font color =
"silver">.</font><font color = "maroon">backup set</font>
<br><font color = "blue">WHER E</font> &nbs p;<font color =
"maroon">databa se_name</font> <fon t color = "silver">=</
font> <fon t color = "red">N'DB_Name __MSCRM'</font>
<br>   ; &n bsp;   ;<font color =
"blue">AND</font> <fon t color = "maroon">backup _set_id</
font> <fon t color = "silver">=</font> <fon t color =
"silver">(</font><font color = "blue">SELE CT</font> <fon t color =
"fuchsia"><b>MA X</font></b><font color = "silver">(</font><font color
= "maroon">backup _set_id</font><font color = "silver">)</font>
<br>   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; <font
color = "blue">FROM </font> &nbs p; <font color =
"maroon">ms db</font><font color = "silver">.</font><font color =
"silver">.</font><font color = "maroon">backup set</font>
<br>   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; &n bsp;   ; <font
color = "blue">WHER E</font> &nbs p;<font color =
"maroon">databa se_name</font> <fon t color = "silver">=</
font> <fon t color = "red">N'DB_Name __MSCRM'</font><font color =
"silver">)</font>
<br><br>
<font color = "blue">IF</font> <fon t color =
"#8000FF">@back upSetId</font> <fon t color = "blue">IS</
font> <fon t color = "blue">NULL </font>
<br>   ;<font color = "blue">BEGI N</font>
<br>   ; <f ont color = "blue">RAISERRO R</
font> <fon t color = "silver">(</font><font color =
"red">N'Verify& nbsp;failed.&nb sp;Backup information&nbs p;for data base ''DB_ Name__MSCRM''&n bsp;not fo und.'</
font><font color = "silver">,</font><font color = "black">16</
font><font color = "silver">,</font><font color = "black">1</
font><font color = "silver">)</font>
<br>   ;<font color = "blue">END</font>
<br><br>
<font color = "blue">REST ORE</font> <fon t color =
"maroon">verify only</font> <fon t color = "blue">FROM </
font> <fon t color = "maroon">di sk</font> <fon t color =
"silver">=</font> <fon t color = "red">N'\\serve r\Backups
\DBServerName\\ DB_Name__MSCRM\ DB_Name__MSCRM_ backup_20061026 1158.bak'</
font> <fon t color = "blue">WITH </font> <fon t color =
"blue">FILE </font> <fon t color = "silver">=</font> <fon t
color = "#8000FF">@back upSetId</font> <fon t color = "silver">,</
font> <fon t color = "maroon">nounlo ad</font> <fon t color =
"silver">,</font> <fon t color = "maroon">norewi nd</font>
</font>
This job was set up long before i started here and the problem is that
the backup file itself has grown to be over 230 GB. It does not
appear that the backup job is pruning the file. is there a way to
view the contents of this file and then prune it so we keep no more
then two weeks worth of data.
Thanks
Comment