What we need is to generate traces automatically for the entire website (like adding ?p_trace=YES in all the url pages but automatically).
Our solution is to create a new process (on load - before header) in the home of our website. This process executes:
execute immediate 'alter session set sql_trace=true';To create the process the steps are:
- In apex, go to the Edit page of the page that will execute the process
- In the Processes section, click the Create new Process icon.
- Select PL/SQL and click next
- Type the name of the process and select "On Load - Before Header" in the Point LOV and click next.
- Type: execute immediate 'alter session set sql_trace=true';
- Click Create Process
We need to grant to the parsing schema of our application the privilege to alter the session with the following command:
grant alter session to parsing_schema
You can find the parsing schema your application is using in apex:
Home > Application Builder > Application number > Shared Components > Edit Security Attributes