Search the Blog

Monday, April 25, 2022

SQL SERVER database TYPES

 

SYSTEM_DATABASESAll system databases (master, msdb, and model)
USER_DATABASESAll user databases
ALL_DATABASESAll databases
AVAILABILITY_GROUP_DATABASESAll databases in availability groups
USER_DATABASES, -AVAILABILITY_GROUP_DATABASESAll user databases that are not in availability groups
Db1The database Db1
Db1, Db2The databases Db1 and Db2
USER_DATABASES, -Db1All user databases, except Db1
%Db%All databases that have “Db” in the name
%Db%, -Db1All databases that have “Db” in the name, except Db1
ALL_DATABASES, -%Db%All databases that do not have “Db” in the name

SQL SERVER BACKUP SCRIPT ON LINUX

 BACKUP DATABASE [DMT] TO  

DISK = N'/var/opt/mssql/data/DMT.bak' 

WITH NOFORMAT, NOINIT,  NAME = N'DMT-

Full Database Backup', 

SKIP, NOREWIND, 

NOUNLOAD,  

STATS = 10

GO


SQL Server Performance Key Points

 

  • Application run slower
  • Long running queries
  • High CPU consumption
  • Inefficient memory consumption
  • Suddenly and abruptly getting slower queries
  • Lots of deadlocks
  • Frequent timeouts
  • Database log file growing continuously
  • Database backup slow or failing
  • Out of date index maintenance

Translate