Add debug information for stored procedures in PL/SQL developer
Http://space.itpub.net/13129975/viewspace-626245
If you use PL/SQL developer to select a stored procedure debug, but debug does not go in!
To solve this problem, you only need to select the stored procedure to debug in PL/SQL developer, right-click, select "add debug information" in the pop-up menu and re-open a new window to start debug.
The key issues are:When you select"Add debug information,PL/SQL developerWhat have you done? InPL/SQL developerIf a stored procedure can beDebugRight-click the stored procedure and select"Add debug information"There is a small check mark in front,PL/SQL developerWhere can I find out whether this tick should be checked?
The answer to the first question is that PL/SQL developer actually runsAlter procedureowner. procedurename compile debug.
The entire process of my research on the above issues is as follows:
Open a PL/SQL developer and query the SID of the main session of PL/SQL developer. The result is 421.
Then open anotherSQLPlus window, execute the following statement in sequence:
SQL> select P. PID, P. spid, S. Sid from V $ PROCESS p, V $ session s where S. paddr = P. ADDR and S. Sid = 421;
PID spid Sid
--------------------------------
28241816421
SQL> oradebug setospid 241816
OraclePID: 28, Unix process PID: 241816, image: Oracle @ p690ca
SQL> oradebug unlimit
Processed statements
SQL> oradebug event 10046 trace name context forever, Level 12
Processed statements
After completing the preceding steps, return to the original PL/SQL developer, select the Stored Procedure a_testingforjobmanager, right-click it, and select "add debug information" from the pop-up menu ".
Return to the sqlplus window and execute the following statement in sequence:
SQL> oradebug tracefile_name
/U01/APP/Oracle/admin/ipratest/udump/ipratest_ora_241816.trc
SQL> oradebug event 10046 trace name context off
Processed statements
Go to the preceding trace file, which contains the following section:
Parsing in cursor #9 Len = 60 Dep = 0 uid = 55 Ct = 25 lid = 55 Tim = 18452123749141 HV = 884574241 ad = 'a2ac0198'
Alter procedure caipra. a_testingforjobmanager compile debug
End of stmt
Parse #9: C = 0, E = 641, P = 0, Cr = 0, Cu = 0, MIS = 1, r = 0, DEP = 0, OG = 1, tim = 18452123749137
Binds #9:
You can select another stored procedure that the debug program does not enter and manually execute the preceding SQL statement. You will find that after the preceding SQL statement is executed manually, the stored procedure that is not used by debug can now be used by debug.
Now, I have answered the first question. Now let's answer the second question.:
For example, you can easily see that PL/SQL developer uses the viewSYS. all_probe_objectsFields inDebuginfoTo determine whether a "add debug information" option of a stored procedure should be checked.
When debuginfo is T, there will be a small tick.
When debuginfo is F, there is no small check mark.
The following are all the stored procedures that IPRA users in ipradev cannot Debug. When debugging, note the following:
SQL> select object_name from SYS. all_probe_objects t where wner = 'ipa' and object_type = 'processed' and debuginfo = 'F ';
Object_name
------------------------------
P_sfinddiff
P_satgenerateauditinterface
P_sat_getsatdatfromsaldat
P_sat_getdatafromsal_1
P_iupdatewiv_nc
P_ipaccheck
P_satbatchinterface_nc
P_ipactowiv_nc
P_ycallwrtlog
9 rows selected
In addition, you can use the following command to easily convert between "debug" and "debug". Here, the stored procedure p_adcgetagtforalarm in caipratest is used as an example:
SQL> select T. debuginfo from SYS. all_probe_objects t where object_name = 'P _ adcgetagtforalarm ';
Debuginfo
---------
F
SQL>Alter procedure p_adcgetagtforalarm compile debug;
Procedure altered
SQL> select T. debuginfo from SYS. all_probe_objects t where object_name = 'P _ adcgetagtforalarm ';
Debuginfo
---------
T
SQL>Alter procedure p_adcgetagtforalarm compile;
Procedure altered
SQL> select T. debuginfo from SYS. all_probe_objects t where object_name = 'P _ adcgetagtforalarm ';
Debuginfo
---------
F