This feature requires that certain objects exist on the server before you can use it. If they do not already exist, Toad prompts you to create them when you click .
Note: To remove the profiler objects, click the arrow next to and select Remove Profiler.
You must have the SYS.DBMS_PROFILER package to use the DBMS profiler.
To install the package
To use the hierarchical profiler, you must enable it in the Toad options. Select View | Toad Options | Execute/Compile and then select Use hierarchical profiler on Oracle 11g and newer.
You must also have the DBMS_HPROF package to use the hierarchical profiler, which is available in Oracle 11g and later.
To verify the package is installed
To use the hierarchical profiler, you must enable it in the Toad options.
To enable the hierarchical profiler
Select View | Toad Options | Execute/Compile and then select Use hierarchical profiler on Oracle 11g and newer.
To use a profiler
Click on the main Toad toolbar to turn on profiling.
Note: If the profiler is not set up, Toad notifies you. Set Up the Profiler
Complete the parameters and profiler settings.
Note: Be careful to not leave the profiler toggled on when you switch to other Toad windows. Otherwise, Toad collects profiler data from the queries performed to populate those windows.
Select Database | Optimize | Profiler Analysis. The Profiler Analysis window displays. View Profiler Results
Click the Profiler tab beneath the Editor. Editor Profiler Tab
The Profiler Analysis window provides data on profiler runs that is consistent with the data displayed in the Profiler tab of the Editor. Editor Profiler Tab
The top half of the window is a graph of the showing the percent of time required to run each component of the procedure.
Note: If you can see the pie chart labels but not the pie chart itself, resize the window horizontally to give it more space to draw.
To access the Profiler Analysis window
Select Database | Optimize | Profiler Analysis.
Opening a run: Selecting this displays the graph for all units within that run. Expanding a run in the tree view will list the details of the run including Unit Type, Owner, Unit Name, and Total Time to execute.
Opening a unit: You can also select a specific unit of the selected run.
When drilling down on a unit, we see the lines of code executed and profiled. The column headers include Line Number, Passes (how many times each line of code was executed), Total Time to execute the line, Min Time, Max Time, and the line of Code itself. The graph changes to display the information within that unit.
Displaying in Editor:If you select a valid unit in the tree view, right-click and select display in Editor, the Editor displays the selected unit.
Within the Editor, the Profiler tab displays profiler runs, as root nodes, and profiler units as child nodes. The latter are the actual code units that were executed during a profiler run. They can include anonymous blocks, procedures, functions, and packages executed while the profiler run data was being collected. In the line item profiler, child nodes contain the actual line data. In the hierarchical profiler, child nodes contain sub program calls.
This tab provides an overview of the data, but does not offer the graphs that the Profiler Analysis window does.
Selecting a line item within the nodes automatically opens the referenced SQL source and displays the line referenced by the profiler.
Note: Because each Editor tab is associated with a separate Profiler instance, navigating through your code this way may reset the node display in the Profiler tab.
To display the Profiler Analysis window for the current data
Executable Line Indicators
When you open a profiler run or unit into the Editor and have the option show executable line indicators in gutters selected, executable line indicators display as follows:
Blue dot with green square
Line was executed
Blue dot with red circle
Line was not executed
If Toad cannot determine when the unit was last executed, then the standard blue dot line indicators will display.
You can filter the results of your hierarchical profiling session. This can be useful in making sure that you only see the results that are useful for you.
Toad will automatically filter out the system information that is added when the profiler is active. You can manually turn these on if you want to see that information.
To create a filter
Note: If you do not see the filter option, make sure you are actually using the hierarchical profiler.