QPR ProcessAnalyzer Native App in Snowflake: Difference between revisions
Line 62: | Line 62: | ||
The owner role of the native app can take ''snapshots'' for backup purposes and restore them. | The owner role of the native app can take ''snapshots'' for backup purposes and restore them. | ||
=== Take | === Take snapshot === | ||
Following command takes a snapshot (with name MySnapshot and store it to database/schema QPRProcessAnalyzerBackups/Backups): | Following command takes a snapshot (with name MySnapshot and store it to database/schema QPRProcessAnalyzerBackups/Backups): | ||
<pre> | <pre> | ||
Line 70: | Line 70: | ||
INSTANCE 0; | INSTANCE 0; | ||
</pre> | </pre> | ||
Note that each | Note that each snapshot needs to have a unique name. | ||
=== Restore | === Restore snapshot === | ||
QPR ProcessAnalyzer Native App can be restored from a snapshot (with name | QPR ProcessAnalyzer Native App can be restored from a snapshot (with name MySnapshot) as follows: | ||
<pre> | <pre> | ||
ALTER SERVICE QPR_PROCESSANALYZER_APP.METADATA.QPR_PROCESSANALYZER_SERVICE SUSPEND; | ALTER SERVICE QPR_PROCESSANALYZER_APP.METADATA.QPR_PROCESSANALYZER_SERVICE SUSPEND; | ||
Line 84: | Line 84: | ||
Note that the service is suspended before the restore and resumed after snapshot is restored. | Note that the service is suspended before the restore and resumed after snapshot is restored. | ||
=== Show | === Show snapshots === | ||
Following command lists all snapshots (in database/schema QPRProcessAnalyzerBackups/Backups): | Following command lists all snapshots (in database/schema QPRProcessAnalyzerBackups/Backups): | ||
<pre> | <pre> | ||
Line 91: | Line 91: | ||
This command can be used to find the snapshot to be restored. | This command can be used to find the snapshot to be restored. | ||
=== Drop | === Drop snapshot === | ||
Following command drops a snapshot (with name | Following command drops a snapshot (with name MySnapshot): | ||
<pre> | <pre> | ||
DROP SNAPSHOT | DROP SNAPSHOT MySnapshot; | ||
</pre> | </pre> | ||
Revision as of 18:39, 20 February 2025
QPR ProcessAnalyzer can run as Snowflake Native App which allows process mining analyses for data in Snowflake Data Cloud. To get started, QPR ProcessAnalyzer Native App needs to be installed by following the Snowflake instructions:
Application access to data
QPR ProcessAnalyzer Native App needs an access to data in Snowflake tables, limited by permissions given to the QPR ProcessAnalyzer Native App. For example, following SQL commands grant permission to read a specific table in Snowflake:
GRANT USAGE ON DATABASE <database> TO APPLICATION QPR_PROCESSANALYZER; GRANT USAGE ON SCHEMA <database>.<schema> TO APPLICATION QPR_PROCESSANALYZER; GRANT SELECT ON TABLE <database>.<schema>.<table> TO APPLICATION QPR_PROCESSANALYZER;
Following example grants access to all tables in a specific schema:
GRANT USAGE ON DATABASE <database> TO APPLICATION QPR_PROCESSANALYZER; GRANT USAGE ON SCHEMA <database>.<schema> TO APPLICATION QPR_PROCESSANALYZER; GRANT SELECT ON ALL TABLES IN SCHEMA <database>.<schema> TO APPLICATION QPR_PROCESSANALYZER;
If you also want to modify data using QPR ProcessAnalyzer (e.g., import CSV files), following privileges are needed:
GRANT USAGE ON DATABASE <database> TO APPLICATION QPR_PROCESSANALYZER; GRANT USAGE ON SCHEMA <database>.<schema> TO APPLICATION QPR_PROCESSANALYZER; GRANT SELECT,UPDATE,INSERT,DELETE,TRUNCATE ON ALL TABLES IN SCHEMA <database>.<schema> TO APPLICATION QPR_PROCESSANALYZER;
If you already have the data, see how to create datatables and model (PDF).
User access to application
You can give access to the QPR ProcessAnalyzer Native App by clicking the Manage access button in the app page and add roles to the app users. The app users can use the QPR ProcessAnalyzer Native App and access Snowflake data through the application.
QPR ProcessAnalyzer has a separate User Management which is integrated into Snowflake user management. When QPR ProcessAnalyzer is installed, the Snowflake user who installed the application, is automatically created to QPR ProcessAnalyzer user management as system administrator. This user needs to open QPR ProcessAnalyzer, go to the User Management, and create other users. If you see the QPR ProcessAnalyzer login page when trying to access the QPR ProcessAnalyzer Native App, there is no user available in the QPR ProcessAnalyzer user management corresponding to your Snowflake user name.
QPR ProcessAnalyzer user management can be used to control access for different users.
Manage warehouse
QPR ProcessAnalyzer Native App includes an XS-size virtual warehouse by default named QPR_PROCESSANALYZER_WAREHOUSE. Its size and other settings can be changed in Snowsight (Admin -> Warehouses), like for any other warehouse. However, changing the default warehouse to another warehouse is not possible.
If you need to use several warehouses in the app, you can set project-specific connection strings.
Compute pool size
QPR ProcessAnalyzer Server runs as a Snowflake service in a compute pool. When the native app is installed, the compute pool is automatically created and it has one node with instance family CPU_X64_XS (1 vCPU and 6 GB memory). This is the smallest available instance size which is sufficient for small number of simultaneous users. If the QPR ProcessAnalyzer Server becomes a performance bottleneck, the instance size can be increased to CPU_X64_S (3 vCPU and 13 GB memory) or even CPU_X64_M (6 vCPU and 28 GB memory) as follows:
ALTER COMPUTE POOL QPR_PROCESSANALYZER_APP_COMPUTE_POOL SET INSTANCE_FAMILY = CPU_X64_S
Note that the QPR ProcessAnalyzer service can use only one node in the compute pool, so increasing the MAX_NODES setting doesn't affect performance.
More information about compute pool size: https://docs.snowflake.com/en/developer-guide/snowpark-container-services/working-with-compute-pool#creating-a-compute-pool
Quick start with example data
QPR ProcessAnalyzer Native App requires eventlog data extracted from source systems. Data in Snowflake need to be converted into the suitable eventlog format.
To get started, you can also import example eventlogs as follows:
- Create project in the Workspace.
- Go to the project and import model from sample eventlog files.
- Double-click the model to start Process Discovery or create dashboard.
Backup configuration data
QPR ProcessAnalyzer Native App stores its own configuration data which requires regular backups in case data or the entire native app is accidentally deleted. The configuration data is located in the container block storage of the native app, and it contains for example projects, dashboards, model settings, datatable settings, users and groups. Note that the eventlog data (cases and events) are located in Snowflake tables which don't require backups because they are protected by the Time Travel (https://docs.snowflake.com/en/user-guide/data-time-travel).
The owner role of the native app can take snapshots for backup purposes and restore them.
Take snapshot
Following command takes a snapshot (with name MySnapshot and store it to database/schema QPRProcessAnalyzerBackups/Backups):
CREATE SNAPSHOT QPRProcessAnalyzerBackups.Backups.MySnapshot FROM SERVICE QPR_PROCESSANALYZER_APP.METADATA.QPR_PROCESSANALYZER_SERVICE VOLUME "data" INSTANCE 0;
Note that each snapshot needs to have a unique name.
Restore snapshot
QPR ProcessAnalyzer Native App can be restored from a snapshot (with name MySnapshot) as follows:
ALTER SERVICE QPR_PROCESSANALYZER_APP.METADATA.QPR_PROCESSANALYZER_SERVICE SUSPEND; ALTER SERVICE QPR_PROCESSANALYZER_APP.METADATA.QPR_PROCESSANALYZER_SERVICE RESTORE VOLUME "data" INSTANCES 0 FROM SNAPSHOT QPRProcessAnalyzerBackups.Backups.MySnapshot; ALTER SERVICE QPR_PROCESSANALYZER_APP.METADATA.QPR_PROCESSANALYZER_SERVICE RESUME;
Note that the service is suspended before the restore and resumed after snapshot is restored.
Show snapshots
Following command lists all snapshots (in database/schema QPRProcessAnalyzerBackups/Backups):
SHOW SNAPSHOTS IN DATABASE QPRProcessAnalyzerBackups SCHEMA Backups;
This command can be used to find the snapshot to be restored.
Drop snapshot
Following command drops a snapshot (with name MySnapshot):
DROP SNAPSHOT MySnapshot;
More information:
- https://docs.snowflake.com/en/sql-reference/sql/alter-service
- https://docs.snowflake.com/en/sql-reference/sql/create-snapshot
- https://docs.snowflake.com/en/sql-reference/sql/show-snapshots
- https://docs.snowflake.com/en/sql-reference/sql/drop-snapshot
Additional notes
Queries done by QPR ProcessAnalyzer appear in the Snowsight Query History as user QPR_PROCESSANALYZER_SERVICE. The SQL text is not shown in the Query History for queries originating from QPR ProcessAnalyzer.
QPR ProcessAnalyzer Native App automatically starts up when a user logs in. QPR ProcessAnalyzer doesn't stop automatically, but it can be stopped manually if desired as follows:
ALTER COMPUTE POOL QPR_PROCESSANALYZER_APP_COMPUTE_POOL SUSPEND;
Snowflake has a one minute timeout for http requests, so long running operations may reach this timeout and fail. For example, importing large model from pacm or json file may encounter this situation. However, CSV data import doesn't have this issue.
QPR ProcessAnalyzer requires following account level privileges: BIND SERVER ENDPOINT, CREATE COMPUTE POOL, and CREATE WAREHOUSE. Granting these privileges is requested during the installation.
Following functionality is not available in the QPR ProcessAnalyzer Native App:
- In-memory models
- Datatables stored to SQL Server
- Connections to external sources, such as SAP, Salesforce, ODBC, and Web Service
- Scripts using SQL language
- AI Assistant
Uninstall
QPR ProcessAnalyzer Native App can be uninstalled by selecting Uninstall for the app. Note that if QPR ProcessAnalyzer is uninstalled, the configuration data contained by the application is lost (such as projects, models, dashboards and scripts). However, the eventlog data residing in Snowflake tables are preserved because they are located outside the app.