Debug option invalid in sql developer tool - oracle

I having a procedure, which output doesn't show in output variable tab in sql developer.
Actually i have to validate the data in the table used inside the procedure. So i used inbulit debugging option in sql developer tool. But i shows below error message
Executing PL/SQL: ALTER SESSION SET PLSQL_DEBUG=TRUE
Executing PL/SQL: CALL DBMS_DEBUG_JDWP.CONNECT_TCP( '192.168.7.129', '56229' )
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.
I know we can debug using
dbms_output.put_line();
Dbms_utility.format_error_backtrace;
But above two takes a lot time and irritation while debug.
If anyone know an effevtive way of debugging using sql developer, Please let me know.

I have tried to cover everything you need to know here.
Privs Required
ACL for JDWP
DBMS_DEBUG Alternative
How to start the debugger
Watches, Breakpoints, Stepping Into other units
I even have slides and a YouTube tutorial.
This is of course in ADDITION to our docs on the debugger feature in SQL Developer.

Related

ORA-00942: table or view does not exist (ColdFusion application)

I have a ColdFusion 10 application with an Oracle 11g backend.
The Production version works fine. Recently, I had the Oracle DBAs refresh the Test database from Production. Now, I receive the ORA-00942: table or view does not exist error.
All the tables are there when I use SQLPlus and the queries run fine. I am at a loss as to what to check now. The trace sends me to the query that is running fine in SQLPlus. What have I missed?
Update - 17 October 2014
I don't know if it makes any difference, but the line throwing the code is the 1st one here:
`<cfquery name="getWebMaster" datasource="xxxxtest">
select * from users where secureuserid in (select secureuserid from hd_role where webmaster='Yes')
and userstatus='Active' and UserLevel='XXX/XXIT'
</cfquery>`
That means that the entire cfquery section is the error, or just the 1st line? BTW, I think I've figured out how to imbed code. Thanx!
There is only one thing I can think of. The user that you used to run the application/script in your testing environment, and the permission that particular user has - it missed some privileges, so it can not see certain things even though they are there.

SQL Developer : Unable to gather system statistics : insufficient privileges

I was trying to gather system statistics to get the report information.
I tried the same via SQL developer and found some privillage issues and I referred this link for the solution,
GRANT CREATE session TO TEST_DB;
GRANT GATHER_SYSTEM_STATISTICS TO TEST_DB;
GRANT CONNECT TO TEST_DB;
All grant succeeded.But,
execute dbms_stats.gather_system_stats ('START');
gave me the error
ORA-20000: Unable to gather system statistics : insufficient privileges
ORA-06512: at "SYS.DBMS_STATS", line 23190
Finally, I tried with command line and finished the things without any issues,
PL/SQL procedure successfully completed.
why it was showing insufficient privileges issue in SQL developer ?
Role privileges like GATHER_SYSTEM_STATISTICS (as opposed to sys privileges, like CREATE TABLE) don't take effect immediately; they only take effect at the next logon (presumably because Oracle does some kind of caching internally).
So if you'd logged off and on in SQL Developer, it would have worked, as well.

Debug SQL queries in SQuirrel-sql

How do I go about debugging a SQL statement in SQuirrel-sql?
I keep getting "unhelpful" errors like:
Error: [SQL0104] Token , was not valid. Valid tokens: ) OR.
SQLState: 42601
ErrorCode: -104
I would love to be able to see the line number where I made the error, or some other way of guiding me to where the problem is.
I am working with the JDBC driver on a IBMi DB2 database.
You can add the "errors=full" property for more detailed error messages although it will still require some interpretation to locate the precise syntax issue.
See the IBM Toolbox for Java JDBC properties for more information.
As Tracy mentioned if you want interactive syntax checking you will have to use one of the native SQL interfaces such as the green screen Start SQL Interactive Session (STRSQL) command or the IBM i Access Run SQL scripts tool.
For such errors where the problem isn't obvious, I like to copy and paste the SQL into the AS/400's green screen interactive SQL tool. (I'm assuming your database server is an AS/400 based on your tag and the mention of IBMi DB2.) The command is STRSQL. When there's an error, it will put your cursor right where the problem is. Or, more specifically, where it thinks the problem is. It does require green screen access to the AS/400.

TOAD Scheme browser error when executing a package

I am getting an error
ORA-01086: Savepoint 'somesavepoint' never established
ORA-06512: at MyPackage, line 500
ORA-01002: fetch out of sequence
ORA-06512: at MyPackage, line 650
ORA-06512: at line2
Only happening when I execute the package from the schema browser of TOAD.
Doesn't happen when I execute it from editor
EXEC MyPackage.Procedure
Is anyone aware of any problems related to this? How can this be solved?
ORA-01086 occurs when you commit and then ask to rollback to your savepoint. So when you use TOAD schema browser, there must have been an open bug at that moment to apply a commit or perform a DDL within the session. If you would have had two different TOAD sessions then this should not happen.
Try to have two different sessions
One with Schema Browser
Another with normal Editor
This should be resolving the issue. Else check for quest website for open bugs on your TOAD version.

Invalid privilege error?

Two related applications use a function in a package in several queries to return some data as CSV. The column being selected and concatenated is a CLOB field and can contain HTML, special characters, etc. The applications have few users and so are not heavily used. One is a Flex application that consumes Oracle HTTP services, and the other is an ASP.NET application that uses ODP.NET. The applications are really one integrated application with hyperlinks to each other.
Yesterday, I received several notifications of a strange error:
ORA-01031: insufficient privileges ORA-06512
The line number in the package in the error details indicates that the error was caused by the function being used in the select clause. It would occur when called by either application about 75% of the time.
Am I correct that an ORA-06512 occurred in the function that then caused an ORA-01031 insufficient privilege error? Unfortunately, ORA-06512 is a very generic error and doesn't tell me anything. And why would it cause an invalid privilege error? The Oracle user accounts being used by both applications have the execute privilege on the package that contains the function.
Regarding the function... it has been used for about 2 years in production without any issue. Also, when I imported the data to QA yesterday and tested it, no error would occur, no matter how many times I hammered the server with requests. But in production, the error would occur about 75% of the time with exactly the same parameters.
The DBA tried to help me with a trace, but we could not find the error message in the trace files.
Today, everything is back to normal in production. Even if I hammer the server with requests the error will stubbornly refuse to occur.
What caused this very strange behaviour yesterday? Do any of the gurus here have any ideas?
EDIT: I just realized one important detail. The column in the table that is being selected and concatenated into CSV by the function is a CLOB.
If the client applications were running "SELECT clob_to_csv(clob_col) FROM ..." and it returned an invalid privilege SOMETIMES, then it is probably something the function is trying to do, rather than the select statement not having sufficient privilege to execute the function.
Not quite clear on what it might do that may require a privilege. Does it use a file (UTL_FILE) or network connection / web service ?
Could be some sort of odd data (a very large clob perhaps).

Resources