Security requirements for SQL Server maintenance jobs
- Last UpdatedJun 04, 2025
- 1 minute read
- PI System
- PI Server 2018
- PI Server
Before attempting the following PI AF SQL Server maintenance job tasks, consider the following security requirements:
-
The account under which either job is edited must have the sysadmin server role. If you have a need to allow a non-sysadmin user the ability to create/manage SQL Server jobs, refer to the following Microsoft article: Configure a User to Create and Manage SQL Server Agent Jobs.
-
The account under which the step in the PI Backup job runs must have the sysadmin server role.
-
The account under which the step in the PI AF Maintenance job runs must have the db_owner role in the SQL Server database. The Updates Statistics stored procedure, which is called out from Maintenance Job stored procedure, will be skipped without error unless the account under which the job is run is the owner of the database or has the sysadmin server role.
Note: By default, maintenance jobs are created and owned by the user that ran the setup jobs that created the SQL Server database. If you used a temporary account with elevated privileges to set up the SQL Server database, you must change the owner of any maintenance job to ensure it has sufficient privileges to run.