|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 5:46 AM
Points: 257,
Visits: 671
|
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 10:34 AM
Points: 47,
Visits: 747
|
|
Very nice! I would optimize some things in the coding for large installations with hundreds of backups going on every hour (logs etc..) though. Example would be to the exclusion table and the "AND d.name NOT IN (SELECT db_name FROM dbautility.dbo.db_exclude)". Could be replaced with a JOIN logic and get the NOT out of there.
All in all I enjoyed reading it and I can see this benefiting quite a few DBAs out there. Thanks!
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 1:23 PM
Points: 1,905,
Visits: 1,601
|
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Wednesday, March 06, 2013 8:29 AM
Points: 351,
Visits: 175
|
|
Good article, Backup Monitoring and Reporting
There is a mistake in it: msdb.baclkupset -> msdb.backupset
Thank You
http://www.arcns.no.sapo.pt
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, April 02, 2013 1:48 AM
Points: 1,252,
Visits: 3,367
|
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 3:19 AM
Points: 382,
Visits: 487
|
|
When I get execute the jobs I get the following error by starting the powershell script:
Exception calling "WriteToServer" with "1" argument(s): "Violation of PRIMARY K EY constraint 'PK_backupset_dim'. Cannot insert duplicate key in object 'dbo.ba ckupset_dim'. The statement has been terminated." At D:\CustomReports\backupAnalysis.ps1:59 char:28 + $bulkCopy.WriteToServer( <<<< $dataTable)Exception calling "WriteToServer" with "1" argument(s): "Violation of PRIMARY K EY constraint 'PK_backupset_dim'. Cannot insert duplicate key in object 'dbo.ba ckupset_dim'. The statement has been terminated." At D:\CustomReports\backupAnalysis.ps1:59 char:28 + $bulkCopy.WriteToServer( <<<< $dataTable). Process Exit Code 0. The step succeeded.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 5:46 AM
Points: 257,
Visits: 671
|
|
sanderstad (6/5/2009)
When I get execute the jobs I get the following error by starting the powershell script: Exception calling "WriteToServer" with "1" argument(s): "Violation of PRIMARY K EY constraint 'PK_backupset_dim'. Cannot insert duplicate key in object 'dbo.ba ckupset_dim'. The statement has been terminated." At D:\CustomReports\backupAnalysis.ps1:59 char:28 + $bulkCopy.WriteToServer( <<<< $dataTable)Exception calling "WriteToServer" with "1" argument(s): "Violation of PRIMARY K EY constraint 'PK_backupset_dim'. Cannot insert duplicate key in object 'dbo.ba ckupset_dim'. The statement has been terminated." At D:\CustomReports\backupAnalysis.ps1:59 char:28 + $bulkCopy.WriteToServer( <<<< $dataTable). Process Exit Code 0. The step succeeded.
Try running update_server_dim_sp this wil update the server_dim.max_backupset_id column. Also keep in mind the primary key is defined as server_name and backup_set_id. The server name value is obtained from @@servername, so its possible to have duplicate names of your SQL Servers in your environment. Check @@servername on all servers you are polling and verify there are no duplicates.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 5:46 AM
Points: 257,
Visits: 671
|
|
Rui Nogueira (6/4/2009) Good article, Backup Monitoring and Reporting
There is a mistake in it: msdb.baclkupset -> msdb.backupset
Thank You
Thanks -- I made a few spelling and grammar corrections, it might take a few days to show up.
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Friday, July 09, 2010 4:10 AM
Points: 70,
Visits: 117
|
|
| Really really helpful and well written - thank you very much.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, September 12, 2011 1:21 PM
Points: 3,
Visits: 83
|
|
|
|
|