Dbatools: Databases with same name on multiple instances

Created on 22 Aug 2018  Â·  8Comments  Â·  Source: sqlcollaborative/dbatools

Steps to Reproduce

  • 2 SQL Server instances (non related, different systems/servers) – inst1 e inst2;
  • Both instances have SharePoint BD’s, thus you have BD’s with common names (i.e.: SharePoint_Config, WSS_Logging, WSS_Content, etc.)

powershell

#Backup history timeline:
Get-DbaBackupHistory -SqlInstance 'SQL01','SQL02' -Since '2018-08-18 00:00' | ConvertTo-DbaTimeline | Out-File C:\temp\Get-DbaBackupHistory.html -Encoding ascii 

Expected Behavior

The expected behavior should be a timeline for each database, with no aggregation by database name or an added column to the results with the servername/instancename to separate the databases.

Actual Behavior

Has you can see, looking at the chart it seems that WSS_Logging database had 2 Full Backup on the same day at different hours. The reality is that both SQL Server instances have a WSS_Logging database and different schedules for the Full Backup on the same weekday.

image

Final Notes

GREAT WORK!!!!! Kudos for this... 🥇

bugs_life

All 8 comments

Thank you for the bug report @pmsousa !

@marcingminski can you please take a look? also, i'll be sending you an invite to the sqlcollab so that you can be assigned 😅

Hi, yes, for some reason this had skipped my radar. It was only brought to my attention couple of days ago on slack. Technically not a bug as it wasn’t designed to handle multi server and it only groups by database name. Since dbatools however have multisever at heart, I will make this work but looking for some input how you guys want it to work:

  • I can make server name and database name into a composite key and everything will be shown on same chart. The name will be SEREVERNAME - DATABASENAME

  • I can make chart per server. Then the format will not change but there will be repeated charts for each server.

Or maybe I’ll do both cos I don’t like compromises.

LOL, either way you choose works for me. all options seem reasonable. Thanks so much!

Hi @marcingminski,
I can relate to that, it also skipped my first tests on Dev Environments but when I started using dbatools on more and more envs, this issue popped-up. SharePoint developers tend to leave the defaults for database names and when you have more that one server of these... :)

From both proposed solution, I think the best approach is the first. If we wanted separate charts, then we just add to run the cmdlet one instance at a time and get separate graphs. If I run the cmdlet for multiple SQL instances, one should assume that I want an overview of all those instances in just one graph. So the composite key and one chart seems the best solution.

What do you think? Makes sense?

Yep. I was thinking multiple charts but on the same page. It may be easier to read that’s all but happy to experiment and see what works. Don’t think it’s a big change anyway.

This issue has been automatically marked as stale because it has not had recent activity. If you would like this issue to remain open:

  • Verify that you can still reproduce the issue in the latest version of dbatools
  • Comment that the issue is still reproducible and include:

    • What version of dbatools you reproduced the issue on

    • What OS and version you reproduced the issue on

    • What steps you followed to reproduce the issue

This issue has been automatically closed because it has not had activity in the last three months. If this issue is still valid, please add a comment

Bad bot.
Apologies I completely forgot about it. I’ll add it to my task list.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

llmuculusll picture llmuculusll  Â·  4Comments

DiHo78 picture DiHo78  Â·  4Comments

MikeyBronowski picture MikeyBronowski  Â·  3Comments

habibhammy picture habibhammy  Â·  9Comments

emilvissing picture emilvissing  Â·  7Comments