Missing index

New SQL DMV in SQL server 2019

— Selectivity from mssqltips.com

 

Check the SQL Server version

There are always some new features in the database server, which has SQL version checking requirements. For example: GRANT VIEW DATABASE PERFORMANCE STATE TO [user] can run, if your server at least SQL Server 2022.

In this case if you don’t want to see error in an older version , you have to check it:

 

 

DateTime calculator to UTC to Local Server time to a specific TimeZone

In SQL server you can get the local datetime UTC time . Convert it to different TimeZone:

 

Convert a local datetime or the server local time to different timezone:

Convert  UTC datetime or the server  UTC time to different timezone:

Continue reading “DateTime calculator to UTC to Local Server time to a specific TimeZone”

Install Oracle in docker

Install Oracle express

docker command in windows powershell (WSL installed):

download oracle sqldeveloper Windows 64-bit with JDK 11 included:

https://www.oracle.com/database/sqldeveloper/technologies/download/

Add read rights to all existing and new user databases

 

The following script add read user rights for every user databases and  system model databases for the new databases to readeruser  login.

 

Resolve SID to domain account

There are reasons you need to resolve SID. You can do it by powershell:

 

 

DBATools Get-DbaDatabase] Failure | The certificate chain was issued by an authority that is not trusted.

If  you get the error:

Get-DbaDatabase] Failure | The certificate chain was issued by an authority that is not trusted.

You can set in dbatools:

 

or

 

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

Docker build

 

Some usefull  docker command  in powershell windows :

Prerequisite: Visual Studio Code Remote Development Extension Pack

 

VS Code and Git and Docker

  1. Download a git project from github.
  2. Create Visual Studio project workspae
  3. Build containers

Commands in powershell (in the new empty project folder):

Docker Visual Studio Code
Docker Visual Studio Code