dataplat / dbatools

🚀 SQL Server automation and instance migrations have never been safer, faster or freer
https://dbatools.io
MIT License
2.43k stars 794 forks source link

[BUG] New files with SQL 2019 installer #6396

Closed gbargsley closed 1 year ago

gbargsley commented 4 years ago

Environmental information

#### PowerShell version:

Name                           Value                                                                                  
----                           -----                                                                                  
PSVersion                      5.1.18362.145                                                                          
PSEdition                      Desktop                                                                                
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                
BuildVersion                   10.0.18362.145                                                                         
CLRVersion                     4.0.30319.42000                                                                        
WSManStackVersion              3.0                                                                                    
PSRemotingProtocolVersion      2.3                                                                                    
SerializationVersion           1.1.0.1                                                                                

#### dbatools Module version:

Name    : dbatools
Path    : C:\Program Files\WindowsPowerShell\Modules\dbatools\1.0.100\dbatools.psd1
Version : 1.0.100

Name    : dbatools
Path    : C:\Program Files\WindowsPowerShell\Modules\dbatools\1.0.83\dbatools.psd1
Version : 1.0.83

Name    : dbatools
Path    : C:\Program Files\WindowsPowerShell\Modules\dbatools\1.0.9\dbatools.psd1
Version : 1.0.9

#### SQL Server: 
<!-- Paste output of `SELECT @@VERSION` -->
```sql
Microsoft SQL Server 2019 (RTM-CU2) (KB4536075) - 15.0.4013.40 (X64)   Feb  3 2020 16:40:57   Copyright (C) 2019 Microsoft Corporation  Developer Edition (64-bit) on Windows Server 2016 Datacenter 10.0 <X64> (Build 14393: ) (Hypervisor) 

Report

With the SQL 2019 installation the following four files are now being dropped in the DATA folder by default.

model_msdbdata.mdf model_msdblog.ldf model_replicatedmaster.ldf model_replicatedmaster.mdf

The current version of the function identifies these as orphaned because they are not hosted by SQL Server, but I believe they are there for AG replication of system files or for some other SQL related feature. I would not recommend displaying these as orphaned as deleting them might break the SQL 2019 instance.

#### Host used - [ ] powershell.exe - [ ] ISE - [ ] VS Code - [ ] Other (please specify) If anything other than powershell.exe was used, please confirm that you can duplicate the issue with powershell.exe - [ ] Still buggy in powershell.exe #### Errors Received

Steps to Reproduce

Expected Behavior

Actual Behavior

wsmelton commented 4 years ago

So you have a vanilla installation of SQL Server 2019 and found those files there?

gbargsley commented 4 years ago

Yes on multiple boxes. I cannot find it in any MS docs, but it seems related to a feature.

wsmelton commented 4 years ago

What method did you use to install it?

gbargsley commented 4 years ago

Engine only with all the defaults.

krahi600 commented 2 years ago

I just installed SQL Server 2019 enterprise edition and encountered the same thing. I have 4 extra model db files in the default directory.

model_msdbdata.mdf model_msdblog.ldf model_replicatedmaster.ldf model_replicatedmaster.mdf

Dean-McMillan commented 2 years ago

I can confirm this is an issue with 2019 installs. Have encountered it with Developer Edition and Standard Edition.

potatoqualitee commented 2 years ago

are yall running Find-DbaDbOrphanFile?

Kevin-S-Lewis commented 2 years ago

Those files are listed here with a now retired feature: https://docs.microsoft.com/en-us/sql/big-data-cluster/deployment-high-availability?view=sql-server-ver16.

Shame I was looking forward to maybe having an MSDB and aspects of the master database that could be more AG aware.

andreasjordan commented 1 year ago

Fixed with https://github.com/dataplat/dbatools/pull/6395.