Documentation
Getting Started
Data Grid
Modeling
Business Rules
Approvals
Users, Roles & Security
Administration
Integration & API
Installation
Migrating from MDS
Architecture
Create Database & Service Account
Create the database and the service account before you install Primentra. The installer needs a database to connect to during first-run setup.
What this step does
The script setup-db-and-user.sql creates an empty database, a dedicated login, and the permissions Primentra needs. The application never connects as sa. It uses a restricted account that can reach only its own database.
Run the script
- Open SQL Server Management Studio and connect as a
sysadminuser, for examplesa. - Open
setup-db-and-user.sql. Download it from primentra.com, or find it in thescriptsfolder of the installation directory after you install Primentra. - Replace the placeholder
CHANGE_THIS_PASSWORDin theCREATE LOGINstatement with a strong password. - Execute the script.
- Write down the database name, the user name, and the password. The setup wizard asks for all three.
Never run the script with the placeholder password. It ships as a placeholder, not as a usable secret.
What gets created
| Object | Name | Purpose |
|---|---|---|
| Database | Primentra | Empty at this point. Tables are created later during Setup Database |
| Login | primentra_svc | SQL Server authentication. The application's service account |
| Role | primentra_app | Holds every grant. primentra_svc is a member |
Permissions granted to `primentra_app`
SELECT,INSERT,UPDATE,DELETEandEXECUTEon thedboandmdmschemas — data access and stored procedures.REFERENCESon both schemas — foreign keys during schema setup.CREATE TABLE,CREATE PROCEDURE,CREATE VIEW,CREATE FUNCTION,CREATE SCHEMA— schema deployment and staging tables.ALTERon both schemas — migrations and integration views.- Membership of
db_ddladmin— Full-Text Search catalog and index creation.
SQL Server Agent access
The script also adds primentra_svc to the SQLAgentUserRole role in msdb. That is the least privilege that lets setup create the Primentra_Scheduler job, which runs staging batches and applies your retention settings.
Without this grant the schema still deploys, but the job is not created and you have to add it by hand. See Install Primentra.
Related
- Install SQL Server — the previous step
- Install Primentra — run the installer and connect to this database
- Three-Tier Design & Security — why the application has no raw SQL
- Troubleshooting — permission and login errors