This article covers details about configuring SQL Server on a Server Core installation.
Configure and Manage Server Core on Windows Server
The section provides references to the articles that help configure and manage a Server Core installation.
Not all features of SQL Server are supported in Server Core mode. Some of these features can be installed on a client computer or a different server that is not running Server Core, and connected to the Database Engine services installed on Server Core.
For more information about configuring and managing a Server Core installation remotely, see the following articles:
This section provides information about installing updates for SQL Server on a Windows Server Core machine. We recommend that customers evaluate and install latest SQL Server updates in a timely manner to make sure that systems are up to date with the most recent security updates. For more information about installing SQL Server on a Windows Server Core machine, see Install SQL Server on Server Core.
The following are the two scenarios for installing product updates:
SQL Server setup integrates the latest product updates with the main product installation so that the main product and its applicable updates are installed at the same time.
After Setup finds the latest versions of the applicable updates, it downloads and integrates them with the current SQL Server setup process. Product Update can pull in a cumulative update, service pack, or service pack plus cumulative update.
Specify the UpdateEnabled, and UpdateSource parameters to include the latest product updates with the main product installation. Refer the following example to enable product updates during the SQL Server Setup:
Beginning with SQL Server 2022 (16.x), read the Microsoft SQL Server Software License Terms at aka.ms/useterms.
Installing Updates for SQL Server After It Has Been Installed
On an installed instance of SQL Server, we recommend that you apply the latest security updates and critical updates including General Distribution Releases (GDRs), and Service Packs (SPs). Individual Cumulative updates and security updates should be adopted on a case-by-case, "as-needed" basis. Evaluate the update; if it's needed, then apply it.
Apply an update at a command prompt, replacing <package_name> with the name of your update package:
Update a single instance of SQL Server and all shared components. You can specify the instance either by using the InstanceName parameter or the InstanceID parameter.
The sqlservr Application application starts, stops, pauses, and continues an instance of SQL Server from a command prompt.
You can also use Net services to start and stop the SQL Server services.
Enable Always On availability groups
Being enabled for Always On Availability Groups is a prerequisite for a server instance to use availability groups as a high availability and disaster recovery solution. For more information about managing the Always On availability groups, see Enable and Disable Always On Availability Groups (SQL Server).
Using SQL Server Configuration Manager Remotely
These steps are meant to be performed on a PC running the client edition of Windows, or Windows Server that has the Server Graphical Shell installed.
Open Computer Management. To open Computer Management, select Start, type compmgmt.msc, and then select OK.
In the console tree, right-click Computer Management, and then select Connect to another computer....
In the Select Computer dialog box, type the name of the Server Core machine that you want to manage, or select Browse to find it, and then select OK.
In the console tree, under Computer Management of the Server Core machine, select Services and Applications.
Double-click SQL Server Configuration Manager.
In SQL Server Configuration Manager, select SQL Server Services, right-click SQL Server (<instance name>), where <instance name> is the name of a local server instance for which you want to enable Always On Availability Groups, and select Properties.
Select the Always On High Availability tab.
Verify that Windows failover cluster name field contains the name of the local failover cluster node. If this field is blank, this server instance currently does not support Always On Availability Groups. Either the local computer is not a cluster node, the WSFC cluster has been shut down, or this edition of SQL Server does not support Always On Availability Groups.
Select the Enable Always On Availability Groups check box, and select OK.
SQL Server Configuration Manager saves your change. Then, you must manually restart the SQL Server service. This enables you to choose a restart time that is best for your business requirements. When the SQL Server service restarts, availability groups will be enabled, and the IsHadrEnabled server property will be set to 1.
Note
You must have the appropriate user rights or you must have been delegated the appropriate authority on the target computer to connect to that computer.
The name of the computer that you are managing appears in parentheses next to Computer Management in the console tree.
Using PowerShell Cmdlets to Enable Always On Availability Groups
The PowerShell Cmdlet Enable-SqlAlwaysOn is used to enable Always On Availability Group on an instance of SQL Server. If the Always On Availability Groups feature is enabled while the SQL Server service is running, the Database Engine service must be restarted for the change to complete. Unless you specify the -Force parameter, the cmdlet prompts you to ask whether you wish to restart the service; if canceled, no operation occurs.
You must have Administrator permissions to execute this cmdlet.
You can use one of the following syntaxes to enable Always On Availability Groups for an instance of SQL Server:
Configuring Remote Access of SQL Server Running on Server Core
Perform the actions described below to configure remote access of a SQL Server instance that is running on Windows Server Core.
Enable remote connections on the instance of SQL Server
To enable remote connections, use SQLCMD.exe locally and execute the following statements against the Server Core instance:
EXEC sys.sp_configure N'remote access', N'1'
GO
RECONFIGURE WITH OVERRIDE
GO
Enable and start the SQL Server Browser service
By default, the Browser service is disabled. If it is disabled on an instance of SQL Server running on Server Core, run the following command from the command prompt to enable it:
sc config SQLBROWSER start= auto
After it is enabled, run the following command from the command prompt to start the service:
The TCP/IP protocol can be enabled through Windows PowerShell for an instance of SQL Server on Server Core. Follow these steps:
On the computer that is running Windows Server Core, launch Task Manager.
On the Applications tab, select New Task.
In the Create New Task dialog box, type sqlps.exe in the Open field and then select OK. This opens the Microsoft SQL Server Powershell window.
In the Microsoft SQL Server Powershell window, run the following script to enable the TCP/IP protocol:
PowerShell
$smo = 'Microsoft.SqlServer.Management.Smo.'$wmi = new-object ($smo + 'Wmi.ManagedComputer')
# Enable the TCP protocol on the default instance. If the instance is named, replace MSSQLSERVER with the instance name in the following line. $uri = "ManagedComputer[@Name='" + (get-item env:\computername).Value + "']/ServerInstance[@Name='MSSQLSERVER']/ServerProtocol[@Name='Tcp']"$Tcp = $wmi.GetSmoObject($uri)
$Tcp.IsEnabled = $true$Tcp.Alter()
$Tcp
SQL Server Profiler
On a remote machine, start SQL Server Profiler and select New Trace from the File menu, the application displays a Connect to Server dialog box where you can specify the SQL Server instance, residing on the Server Core machine, to which you want to connect. For more information, see Start SQL Server Profiler.
You can use SQL Server Management Studio or Transact-SQL remotely to define an audit. After the audit is created and enabled, the target will receive entries. For more information about creating and managing SQL Server audits, see SQL Server Audit (Database Engine).
Command Prompt Utilities
You can use the following command prompt utilities that enable you to script SQL Server operations on a Server Core machine. The following table contains a list of command prompt utilities that ship with SQL Server for Server Core:
You can use SQLdiag Utility to collect logs and data files from SQL Server and other types of servers, and use it to monitor your servers over time or troubleshoot specific problems with your servers. SQLdiag is intended to expedite and simplify diagnostic information gathering for Microsoft Customer Support Services.
You can launch the utility on the administrator command prompt on the Server Core, using the syntax specified in the article: SQLdiag Utility.
Administer an SQL Server database infrastructure for cloud, on-premises and hybrid relational databases using the Microsoft PaaS relational database offerings.