Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 17659
  • Last Modified:

how to debugging a package in PL/SQL developer

how to debugging a package in PL/SQL developer;how to set break points;how to stop debugging.
0
chaitu chaitu
Asked:
chaitu chaitu
  • 12
  • 7
  • 2
1 Solution
 
chaitu chaituAuthor Commented:
ORA-01031: insufficient privileges
ORA-06512: at "SYS.DBMS_DEBUG_JDWP", line 68
ORA-06512: at line 1
This session requires DEBUG CONNECT SESSION and DEBUG ANY PROCEDURE user privileges.
Process exited.

3. If not already done, a DBA user needs to unlock the schema to provide access. This can be done with the following commands:

ALTER USER hr UNLOCK ACCOUNT;
ALTER USER hr IDENTIFIED BY hr;


 
4. For the PL/SQL debugging portion of this tutorial, the HR user needs a few additional privileges. Grant the privileges using the following commands:

GRANT debug any procedure, debug connect session TO hr;
 


what is hr here???
0
 
actonwangCommented:
hr is a test user in oracle database if you install example schemas.

you need to replace hr by your current username.
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
chaitu chaituAuthor Commented:
i think i dont have enough privelages to run that procedure in jdeveloper;so i try to debug same procedure in PL/SQL IDE.how to debug procedure in that IDE
0
 
chaitu chaituAuthor Commented:
in which window i mean (program window/test window/sql window) i can debug in allroundautomations pl/sql developer;i want to debug package.where should i put breakpoints;
0
 
primusmagestriCommented:
1.right click on the package you want to debug, hit edit spec&body
2.dbl click on the function/procedure you want to debug - this gets you to the start of the method
3.on the immediate left side of the method text, near the beginning of the method, click once to put a breakpoint - a small red circle with an X over it should appear
4.right click the method and hit test it - another dialog appears
5.click the left most icon in this dialog and you're ready to begin
6.hit the run icon to run the method and it should stop on the breakpoint
7. now ctrl+o for step over, ctrl+n for step in, ctrl+r to run free :)
0
 
chaitu chaituAuthor Commented:
i put the some breakpoints at procedure starting point.
when i hit run icon method i am getting one alert box saying that

"Error setting at line no:191"

Illegal line

but it stopped there where i put break points.

No Debug Information is coming when i hover on certain variables.
0
 
chaitu chaituAuthor Commented:
while debbuging in the bottom window

variable and values are not coming...
0
 
primusmagestriCommented:
for that you need to first hit F8 (compile) immediately after the step 1 - this will offer debug information. don't forget to also compile the eventual objects invalidated after compiling this particular package (menu Tools->Compile invalid objects->F8) - objects that depend on another always get invalidated when their dependant changes at least one bit.
0
 
chaitu chaituAuthor Commented:
as u said i hit F8 immediately after the step 1;

"dont forget to also compile the eventual objects invalidated after compiling this particular package "

menu Tools->Compile invalid objects->F8

what will it do???


0
 
chaitu chaituAuthor Commented:
menu Tools->Compile invalid objects->F8

when i run this its taking so much .(i think because there r so many packages in my DB ;it is invalidating objects in all packages.)
0
 
primusmagestriCommented:
well, you cannot avoid that... if the package you're trying to debug is a commonly used one and lots of other objects use it, this is it... they get invalidated and sometimes takes a lot to recompile
but, you could try this: copy the contents of this package to a new one so no other already existing object depends on what you're trying to debug. then it would be easier.
0
 
chaitu chaituAuthor Commented:
"copy the contents of this package to a new one so no other already existing object"

I didnt get this;

can u tell me the steps??
0
 
primusmagestriCommented:
ok. so you opened the package in edit mode (step 1.)
a)press CTRL+S to save it to some location (see that you use .sql extension or you'll have to change it afterwards).
b)open the saved file and, say that yor package name is PACK_NAME, change all the appearances of this exact name with something else, PACK_NAME2 for example.
c)then get back to PL/SQL Developer and say NO when you are asked to reload the contents of the current package; close the edit package window
d)open a command window (File->New->Command window) and enter in the prompt:
@<path_where_you_saved_the_package_contents>\PACK_NAME.SQL
and hit enter to execute it
e)your package copy will be created, just refresh the packages tree and you'll see it; do the same things, open for edit and F8 to compile it and get the debug info. this time, nothing else will be invalidated
0
 
chaitu chaituAuthor Commented:
I did what u said above;but when i  put  breakpoints in package body its not stopping there;


0
 
primusmagestriCommented:
are you sure you put breakpoints and not bookmarks?
0
 
chaitu chaituAuthor Commented:
i think when u follow this approach (package copy) no need to do this thing; menu Tools->Compile invalid objects->F8
0
 
primusmagestriCommented:
>>i think when u follow this approach (package copy) no need to do this thing; menu Tools->Compile invalid objects->F8
and what did I say?

>> this time, nothing else will be invalidated

the F8 i mentioned on e) was for debug info in your new (copied) package
0
 
chaitu chaituAuthor Commented:
for new (copied) package should i do execute this menu Tools->Compile invalid objects??

I think F8 will execute the package or compile the package.
0
 
chaitu chaituAuthor Commented:
THANKS for ur help;u didnt answer my above Q
0
 
primusmagestriCommented:
well, let's get something straight:
1.when you open a package for edit pressing F8 will compile the package
2.when you open Tools->Compile invalid objects and press F8 those invalid objects (if any) will be compiled.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 12
  • 7
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now