topic hubPlatform, DevOps & Performanceofficial - Microsoftreviewed - checked by Opus

Database

Database deployment for Business Central on-premises: creating and altering application and tenant databases, SQL Server authentication, SQL Server installation considerations, moving to Azure SQL Database, controlling database size, and fixing SQL connection problems.

Path: Business Central on-premises > Deployment > Database · tier official · system platform · narrative reviewed (checked by Opus)

Overview

This section covers the database side of an on-premises Business Central deployment. It explains how to create application and tenant databases for single-tenant and multitenant setups with PowerShell cmdlets, and how to configure SQL Server authentication, including encryption key setup, so server instances can connect.

Further pages cover SQL Server installation choices (disk partitioning, virus scanning, TempDB, MAXDOP, full-text search, statistics), running the database on Azure SQL Database through a BACPAC export and import, and keeping database size under the limit with company deletion, retention policies and compression. A troubleshooting page covers connection failures.

Start with creating the databases, then configure authentication. Read the SQL Server installation page when planning the server. Use the size and troubleshooting pages when operating an existing deployment.

Key points

  • Databases are created as application and tenant databases, using cmdlets such as New-NAVApplicationDatabase, Mount-NAVTenant and Sync-NAVTenant; after creation, publish extensions and add companies.
  • Database authentication uses SQL Server authentication with an encryption key, configured on the database and the server instance, for single-tenant and multitenant deployments.
  • SQL Server installation guidance covers disk partitioning, virus scanning, memory, TempDB, full-text search, MAXDOP, statistics management and high availability, for on-premises and Azure.
  • Azure SQL Database deployment involves preparing the database, exporting a BACPAC, importing it to Azure, configuring the firewall and setting server instance authentication.
  • Ways to reduce database size: delete unused companies, delete documents, apply retention policies, and enable data compression (CompressionType property).
  • For connection problems, enable Named Pipes and TCP/IP in SQL Server Configuration Manager, allow SQL Server through Windows Firewall, and start SQL Browser Service for named instances.

Learn pages

  • Configure Business Central Database Authentication: This article describes how to configure SQL Server authentication between the Dynamics Business Central instance and a database.
    • Business Central supports Windows authentication and SQL Server authentication for database access.
    • Windows authentication is configured by default on server instance and database.
    • SQL Server authentication requires an encryption key to protect credentials.
    • Step: Create encryption key using New-NAVEncryptionKey cmdlet in admin shell.
    • Step: Import encryption key using Import-NAVEncryptionKey cmdlet on server instance and database.
    • Step: Configure SQL Server instance to mixed authentication mode to support SQL authentication.
    • Step: Create SQL login and map to database user with relevant privileges.
    • Encryption key file is stored in ProgramData with filename serverinstance.key.
  • Creating and altering Business Central databases: Create a new database by using the New-NAVDatabase cmdlet in the Administration Shell.
  • Installation considerations for Microsoft SQL Server and Business Central: Learn about the requirements for installing and configuring Microsoft SQL Server to work with Business Central.
  • Keeping Database Size Under the Limit: Learn about the best ways to reduce data stored in Business Central databases.
    • Reducing database size prevents reaching size limits in Business Central online, improves runtime performance, and simplifies backup and restore processes.
    • Step: Delete unused companies such as test or demo companies to reduce stored data.
    • Step: Delete historical documents no longer needed like invoiced purchase orders.
    • Step: Set up retention policies to automatically delete outdated data in log and archived record tables.
    • Business Central online automatically enables page-level data compression on tables unless CompressionType property is set to None.
    • Step: Enable data compression on tables using CompressionType property or Start-NAVDatabaseCompression cmdlet for on-premises 2020 release wave 1 and later.
  • Running a Business Central Database to Azure SQL Database: Learn how to deploy a Business Central database to Azure SQL Database
  • Troubleshooting: SQL Server Connection Problems: Learn how to configure and troubleshoot SQL Server connections to Business Central.
    • The Business Central server requires Named Pipes and TCP/IP protocols to be enabled in SQL Server Configuration Manager for proper database connectivity.
    • Step: In SQL Server Configuration Manager, expand the SQL Server Network Configuration node and select Protocols for MSSQLSERVER to verify or enable Named Pipes and TCP/IP.
    • Step: If a protocol is disabled, right-click it and select Enable, then restart the Business Central server.
    • Windows Firewall must explicitly allow the SQL Server executable file sqlservr.exe as an exception to permit connections.
    • Step: In Windows Firewall exceptions, add the SQL Server executable at C:\Program Files\Microsoft SQL Server\MSSQL*\MSSQL\Binn\sqlservr.exe.
    • When using a named database instance with the server and SQL Server on separate computers, the SQL Browser Service must be running on the SQL Server.

Key facts from Microsoft Learn (CC BY 4.0), in our own words (D106); open the page for the full text.

Source: Microsoft Learn (CC BY 4.0). Descriptions are Learn’s own.

What Learn documents here 6 Learn pages