Install the PI AF SQL Server database
- Last UpdatedOct 02, 2024
- 5 minute read
- PI System
- PI Server 2018
- PI Server
Before you begin the installation, make sure to:
-
Review the SQL Server considerations for PI AF SQL Server database creation in Pre-installation requirements for PI AF.
-
Download the PI Server install kit onto the PI AF SQL Server computer, as described in Download the PI Server install kit.
-
The PI Server install kit checks for the presence of the .NET 4.8 framework, but will not continue if .NET 4.8 is not installed. See Create the PI AF SQL Server database manually.
-
Ensure that you have sysadmin privileges to install the PI AF SQL Server database on the SQL server if an SQL administrator is not available.
-
Ensure that the required network ports are open. See Port requirements for PI AF Server.
Follow these steps to install the PI AF SQL Server database.
Some organizations may not want to use an install kit to deploy the PI AF SQL Server database. For an alternative procedure, you can download, unzip, and execute SQL scripts to set up the PI AF SQL Server database without running the installer program. See Create the PI AF SQL Server database manually.
-
On the SQL Server computer, go to the directory where you downloaded the PI Server install kit and double-click the executable setup file to launch the installation.
The Welcome window appears.
-
Click Next.
The Feature Selection window appears.
-
Select the Individual Features tab.
The Individual Features tab appears.

-
Select AF SQL database scripts and AF SQL script execution only.
These selections will only install and execute the AF SQL scripts on the SQL Server computer, creating the PI AF SQL Server database.
-
Click Next.
The Feature Rules window appears.
-
Review all recommendation messages regarding the features you have selected.
A message on the Feature Rules window appears if you are installing and executing the AF SQL scripts without also installing the PI AF application service at the same time. The message states that remote script execution is now supported and is the preferred method to reduce downtime of the PI AF application service. However, a two-step installation may be unavoidable, and in such scenarios this message is not applicable.
-
Click Next to proceed with the setup.
The Remote AF Server window appears.
-
Specify the Active Directory accounts to add to the AFServers group and AFQueryEngines group.
The accounts added in these groups have access to the PI AF SQL Server database. The PI AF application service requires different permissions in the database, which is why there are two separate groups.
Note: Specify the Active Directory computer account corresponding to the domain or virtual account. This account is different than the accounts that are specified under the Service Accounts window, which specify the domain or virtual account used to run PI AF application service.
-
If you want to specify different accounts for the AFServers (PI AF application service) and AFQueryEngines groups, select Specify different accounts for the AFServers and AFQueryEngines group.
-
If the PI AF application service will run under a domain account, enter the domain and account name.
-
If you plan to run the PI AF application service under the default virtual account, enter the Active Directory account in the form DOMAIN\ComputerName. Virtual accounts connect as an Active Directory account corresponding to the computer on which they are running.
-
If you plan to run either of the services under a different account, specify the Active Directory account in the form DOMAIN\AccountName.
-
If the PI AF application service will run under a local account or you are unsure of the account you will use, leave the field blank and update the AFServers group with the appropriate membership after the installation is complete.
-
-
Click Next.
The installation verifies that you have specified a valid Active Directory account.
If you did not specify a remote PI AF application service and account information, the Remote AF Rules window appears.
-
Read the recommendation message and verify that you will add accounts to the AFServers group.
Note: If you did not specify an Active Directory account in the Remote AF Server window, you must manually add the appropriate accounts to the AFServers group (and optionally the AFQueryEngines group) before installing the PI AF application service. Otherwise, the PI AF server connection will not be possible even after the PI AF application service is installed. This is critical if you decide to install other services (such as the Notifications service and the Analysis service) at the same time as your PI AF application service because the installations of the Notifications and Analysis services require a PI AF server connection during the installation process itself.
-
Click Next to proceed with the setup.
The SQL Server Connection window appears.
-
Select or enter the Microsoft SQL Server name or named instance that will host the PI AF SQL Server database.
-
To select the default instance, select the machine name from the list.
-
To select a named instance, select the instance name from the list, or enter it in the following format: Server Name\Named Instance or .\Named Instance
-
To select a SQL Express instance, select the instance name from the list, or enter it in the following format: Server Name\SQLEXPRESS or .\SQLEXPRESS
When you specify the default instance, you can refer to it by the server name without a named instance. When specifying a non-default instance, specify the server name and named instance.
The install kit will validate the PI AF server. A connection is required to the PI AF server to complete the installation of any of the following features: PI Notifications Service or PI Analysis Service. For this reason, it is recommended you add additional features after the PI AF server has been fully set up.
-
-
Ensure that only AF SQL database scripts and AF SQL script execution are selected and click Next to proceed with the setup.
A check is performed to see if your user account has the requisite permissions on the SQL Server and whether a PI AF SQL Server database already exists. See SQL Server roles and permissions and PI AF.
-
If the installation detects an existing PI AF SQL Server database, the installation will prompt you with an option to back up the existing PI AF SQL Server database and then execute the AF SQL scripts to create the new PI AF SQL Server database. You can opt out of the backup process by deselecting the checkbox.
Note: Ensure you have enough disk space on your host computer to back up your PI AF SQL Server database.
-
Click Next.
The Summary window appears, listing the selected features and version numbers selected for the installation.
-
Click Install to install the PI AF SQL scripts and create the PI AF SQL Server database.
The Installation Progress window opens.
The Complete window opens when the installation is complete.
You are now ready to install the PI AF application service (see Install the PI AF application service).