Pages

Monday, April 15, 2019

Re-Create WSS_Logging Database in the Sharepoint 2013 Server

My WSS_Logging Database is corrupted then I want to create new database.

My Central Admin --> Monitorng --> Configure usage and health data collection settings do point to WSS_Logging too, but this DB is not present.

you can create manually re-create WSS_Logging DB using in the following powershell script.

Looks like it will work. you should first delete Service Application since it already existed, but than you could recreate it + it created database. No complaints in the event log so far.

Try using this PowerShell:

#Configuration Variables
$UsageSAName = "Usage and Health Data Collection Service"
$DatabaseName = "WSS_Logging"
$DatabaseServer="SPSQL Servername\Instance Name"
$UsageLogPath = "C:\UsageLogs\"
 
#Get the Usage Service Application Service Instance
$ServiceInstance = Get-SPUsageService
 
#Create new Usage Service application
New-SPUsageApplication -Name $UsageSAName -DatabaseServer $DatabaseServer -DatabaseName $DatabaseName -UsageService $ServiceInstance #> $null
 
#Create Service Application Proxy..." 
$proxy = Get-SPServiceApplicationProxy | where {$_.TypeName -eq "Usage and Health Data Collection Proxy"}
$proxy.Provision()