Getting Error stopping profiler: Result = 2 when running the profiler in PLSQL developer

114 Views Asked by At

I have get below error when running below code block in the PLSQL developer after enabling the profiler. Do you know the reason for it. Below I have attached the Query I have used. Below query I have get from an AWR report.

DECLARE
    return_array_ Post_Imported_Obj_Trans_Handling_SVC.Number_Arr;
    cursor_ SYS_REFCURSOR;
BEGIN
    return_array_ := Post_Imported_Obj_Trans_Handling_SVC.Do_Make_Accnt_Import_Trans(:1 ,  :2 ,  :3 ,  :4 ,  :5 ,  :6 ,  :7 ,  unbound## => '');
    OPEN cursor_ FOR SELECT * FROM TABLE(return_array_);
    :8  := cursor_;
END;

The error image I have attached below

enter image description here

1

There are 1 best solutions below

0
Jon Heller On

You can fix this error by dropping and recreating the relevant profiler tables.

PL/SQL Developer normally detects if the necessary profiling tables are missing, and it will prompt you to create them. This error implies that maybe just one of the tables is missing, or maybe some of the columns are unexpected. Perhaps you created the profiling tables a long time ago on an older version of Oracle or PL/SQL Developer, and some newly required columns are missing.

First, drop these three tables from the schema that runs the profiler:

drop table PLSQL_PROFILER_DATA;
drop table PLSQL_PROFILER_UNITS;
drop table PLSQL_PROFILER_RUNS;

Next, open a new Test Window, and click on the button to "Create Profiler report":

enter image description here

That will open up a new dialog that asks to create the relevant tables. Click "Yes":

enter image description here

Now you should be able to run the profiler.