Posts

Showing posts from July, 2023

dbatools, The certificate chain was issued by an authority that is not trusted

Image
Recently I have installed latest dbatools module 2.0.4 and  I started encountering error below whenever I try to connect to the sql server instance. And below commands fix the issue. Set-DbatoolsConfig -FullName sql.connection.trustcert -Value $true -Register Set-DbatoolsConfig -FullName sql.connection.encrypt -Value $false -Register Below is the image

DBCC CHECKDB,REPAIR_REBUILD,REPAIR_ALLOW_DATA_LOSS

The below piece of code is providing your the DBCC CHECKDB commands. USE master GO ALTER DATABASE AdventureWorksDW2017 SET SINGLE_USER WITH ROLLBACK IMMEDIATE DBCC CHECKDB( 'AdventureWorksDW2017' ,REPAIR_REBUILD) ALTER DATABASE AdventureWorksDW2017 SET MULTI_USER ---------------------------------------------------------------- USE master GO ALTER DATABASE AdventureWorksDW2017 SET SINGLE_USER WITH ROLLBACK IMMEDIATE DBCC CHECKDB( 'AdventureWorksDW2017' ,REPAIR_ALLOW_DATA_LOSS) ALTER DATABASE AdventureWorksDW2017 SET MULTI_USER