Upgrade PI AF SQL database on the active node using Manual SQL Script Execution
- Last UpdatedOct 10, 2024
- 2 minute read
- PI System
- PI Server 2024 R2
- PI Server
Before you begin, make sure that:
-
You have the db_owner privilege to upgrade the PI AF SQL Server database.
Note: To run the necessary scripts from the command line, you must first install the sqlcmd utility, available with SQL Server. For information about installing sqlcmd, see the Microsoft topic sqlcmd Utility.
-
Verify that the PI AF Application Service resource is offline. See Take PI AF server offline before the upgrade.
You do not need to run the PI Server install kit to install the PI AF SQL Server database. You can instead download the SQL Scripts from the Customer Portal and manually execute these scripts to create the PI AF SQL Server database.
To upgrade the PI AF SQL Server database, execute the AF SQL scripts against the active node only.
Note: The SQL scripts for PI AF must be run manually to upgrade the PI AF SQL Server database on the active node of the SQL Cluster.
-
On the active SQL Server Cluster node only, open a command prompt window using the Run as administrator option.
-
Change the directory to the folder that holds the SQL scripts. By default, the scripts are located in the %PIHOME64%\AF folder (for example, cd C:\Program Files\PIPC\AF\SQL).
-
Use the following syntax to execute the SQL scripts found in the SQL folder:
GO.bat "<SQLClusterName>[\<SQLInstanceName>][,<Port>]" <PIFD> [<SQLUserName> <SQLUserPassword>]
where:
-
<SQLClusterName> is the name of the SQL Server Cluster node for the PI AF SQL Server database.
-
is the SQL Server instance. This value is only necessary if the SQL Server you are accessing is a non-default (or "named") instance. For example: .
-
specifies a port number. If you are specifying a port number, enclose the entire string in double quotes. For example: or .
-
is the name of the PI AF SQL database. By default the name is PIFD, but starting with release 2018 SP2, you can assign any name during a manual installation or upgrade.
-
<SQLUserName> and <SQLUserPassword> are only needed if mixed mode authentication is required to connect to the SQL Server cluster. Omit these to use Windows authentication. Typically, mixed mode authentication is required when the PI AF SQL Server database and PI AF Application Service are on different, non-trusted domains.
-
When the process is complete, a message line displays in the command prompt window indicating the SQL script execution is complete. The message includes the location of the SQL Script execution log file.