Search notes:
SQL Server instance
A computer (or generally an
SQL Server installation) can have zero, one or more
instances of
SQL Server installed.
An instance consists of one or more
databases .
A database contains one or more logical file groups .
The data files physically store the
data that is in entrusted to SQL Server.
Components
An instance consists of one or more components:
It seems that with SQL Server 2017, Reporting Services has become an SQL Server independent component.
Database Engine Server
A
Database Engine Server consists of one or more
databases where the actual data is stored.
System level information about an instance is recorded in the
master system database .
Instance names
At most one of the installed instances is a default instance . The other instances are identified by an instance name .
When a client tries to connect to a computer without specifying an instance name, it will be connected to the default instance.
The default instance is sometimes also referred to by a simple dot (for example in the
-S
option of
sqlcmd.exe
).
Instance IDs
Instance IDs are required to locate instance-dependent data in the
registry and the
file system . These Instance IDs are created for each
component (Database Engine Server, Analysis Services, …) when a new instance is created with
SQL Server Setup (
setup.exe
).
The (default) instance ID consists of
ID Prefix (that identifies the component),
a two digit version code,
an optional underscore and minor version,
a dot (.
)
an instance name (which is MSSQLSERVER
for default instances).
SQL Server 2016, for example, comes with the following three component prefixes:
Component ID Prefix
Database Engine MSSQL
Analysis Services MSAS
Reporting Services MSRS
Examples IDs:
MSSQL14.MSSQLSERVER
is the default instance id of unnamed SQL Server 2017 instance
MSSQL14.TQ84
is the instance id of SQL Server 2017 Database Engine whose instance name is TQ84
MSAS14.TQ84
is the instance id of Analysis Services 2017 whose instance name is TQ84
Service names
An SQL server instance is tied to a
service .
An unnamed instance's service name is MSSQLSERVER
.
A named instance's service name is MSSQL*instancename
.
Connecting to another instance with sqlcmd
The
-S
flag of
sqlcmd allows to specify the instance to which one wants to connect
c:\> sqlcmd -S Hostname/InstanceName
Identifying process of an instance
Account under which the instance (process) is running
By default, the process sqlservr.exe
runs under the account NT Service\MSSQLServer .
This can be verified, for example, by having the instance execute
whoami.exe
:
exec xp_cmdshell 'whoami'
output
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
nt service\mssqlserver
NULL
(2 rows affected)