Hello, Today in this blog we are going to see Enabling and using Query runner, Inspector, Schema tools to troubleshoot database issues.
Explain about the query runner option in pega platform ?
What is the use of query Runner and how do we configure that query Runner option in Pega ?
1. So by default we don't have this option by default in Pega prpc in order to get this query Runner option in Pega platform.
2. Example now see here go to Configure > System > Database here there should be an option called it as a query runner, query inspector and schema tools by default you must have a schema change tracking , optimize schema , modify schema and column population jobs but you don't have an option schema tools query inspector and query runner.
3. So in order to get these options in your pega platform first you must add PegaRULES:DatabaseAdministrator access role to your current access group.
- You can directly run the SQL queries on the Pega Dev Studio.
- You no need to open that your PG admin tools or another database client tools.
- And also you know sometimes when you are using the Pega Cloud environments you may not have an option to connect it to the database and to trigger some SQL queries.
- So even if you want to troubleshoot because this is mainly useful for debugging and troubleshooting purposes.
9. Three Tabs [Query Runner, Query Inspector, Schema Tools]
Query Runner: If you want to troubleshoot something and if you want to verify what is the data is present in the appropriate database table you can write SQL queries and fetch the data.
Query Inspector: If you want to analyze the query, means if you run query how much time and resource is it taking & is there any improvement needs to be taken in query.
Schema Tools: In schema tools you see all tables and views related to the specific database.
10. Now let's execute our SQL query in the query runner - In Query Runner tab we have two sub tabs a.Query Entery b.History
Now in the Query entry we have to give SQL query to fetch records and it will fetch max 500 records.
As for testing we have records for [ ProductInfo ] in class Data-UIGallery-ProductInfo. So open this class in App Explorer and right click on class and click on the definition.
11. Now you can use this table name in Query Entry in Query runner. Select PegaDATA as database and paste the below SQL query and click on run button.
select * from data.pr_data_sample_shoppingcart
<Resource name="jdbc/PegaRULESReadOnly"auth="Container"factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"type="javax.sql.DataSource"maxTotal="100"maxIdle="10"driverClassName="org.postgresql.Driver"url="jdbc:postgresql://localhost:5432/postgres"username="postgres"/>
<env name="database/databases/PegaRULES/dataSourceReadOnly" value="java:comp/env/jdbc/PegaRULESReadOnly"/><env name="database/databases/PegaDATA/dataSourceReadOnly" value="java:comp/env/jdbc/PegaRULESReadOnly"/>
0 Comments