Debugging PL/SQL

Hi all

I am trying to debug a pl/sql code

so I have a function that calls another function within a packet,
function inside the packaging appealed to another procedure,

This workflow is in progress,

I wonder if there is a way to track process flow, also if anyone can share a good debugging stratergy in addition to dbms_out.print_line would be very useful.

As I tried to trace the session with dbms_system.set_sql_trace_in_session, which gives the result yet cedrick. and the rows returned by the function of high level.

Thank you very much
N

personally, I think that nothing beats a logging strategy good message - with each procedure/function output of debug messages if a switch is enabled for this session or something similar.

It's really only a step to the top of the good messages dbms_output.

Some IDE's like TOAD allow debugging where you can follow the variables and things like watching the fancy etc call stack. I used occasionally and found it very useful to leap into the snippets of code.

Tags: Database

Similar Questions

  • Debugging PL/SQL blocks in SQL Developer

    Is it possible to debug PL/SQL blocks in SQL Developer by setting breakpoints in the code? I use SQL Developer.

    I'm trying to debug some fairly complex PL/SQL blocks - they are not procedures or functions, and so I'm unable to run in debug mode.

    PS Apologies should have posted this in the forum of the database really.

    Published by: West Indies 10 Sep, 2008 01:12

    Hello

    Of course you can, take a look at the following two links-

    http://sueharper.blogspot.com/2006/07/remote-debugging-with-SQL-developer_13.html

    http://www.Oracle.com/technology/oramag/Oracle/08-may/o38browser.html

    Hope this helps,

    John.
    --------------------------------------------
    http://Jes.blogs.shellprompt.NET
    http://www.apex-evangelists.com

  • Need help debugging PL/SQL code

    Hi people,

    Can someone please look at the following code and let me know if they identify obvious errors.

    Oracle Version: 11.2.0.1

    Platform: Windows 7

    Code:

    Set serveroutput size unlimited

    game check

    declare

    cursor schema_name_cur is

    Select the user name

    from dba_users

    When the user name ('SYS', 'SYSTEM')

    and rownum < 2

    order by 1;

    -Declaring variables

    schema_name_rec schema_name_cur % rowtype;

    sql_stmt VARCHAR2 (100);

    total_start_time INTEGER.

    total_stop_time INTEGER.

    start_time INTEGER;

    stop_time INTEGER;

    Start

    total_start_time: = DBMS_UTILITY. GET_TIME;

    for schema_name_rec loop schema_name_cur

    sql_stmt: = ' dbms_stats.gather_schema_stats('''|| schema_name_rec.) UserName | " (', dbms_stats.auto_sample_size)';

    dbms_output.put_line (' collecting stats for ' | schema_name_rec.username |) "schema");

    start_time: = DBMS_UTILITY. GET_TIME;

    dbms_output.put_line (sql_stmt);

    run immediately sql_stmt;

    stop_time: = DBMS_UTILITY. GET_TIME;

    DBMS_OUTPUT. Put_line ('time to' | schema_name_rec.username |) ' : ' || To_char ((stop_time-start_time)/100) | "seconds");

    dbms_output.put_line('===');

    end loop;

    total_stop_time: = DBMS_UTILITY. GET_TIME;

    DBMS_OUTPUT. Put_line ('Total elapsed: ' |) To_char ((total_stop_time-total_start_time)/100) | "seconds");

    end;

    /


    Error message:

    Error on line 4

    ORA-00900: invalid SQL statement

    ORA-06512: at line 28

    I know this is the instruction to execute immediate that mistake, but I can't put my finger on the error.

    Thanks in advance

    rogers42

    Hello

    There is no reason to use dynamic SQL statements in this case.

    ...

    for schema_name_rec loop schema_name_cur
    dbms_output.put_line (' collecting stats for ' | schema_name_rec.username |) "schema");
    start_time: = DBMS_UTILITY. GET_TIME;
    dbms_output.put_line (sql_stmt);

    DBMS_STATS.gather_schema_stats (schema_name_rec.username, dbms_stats.auto_sample_size);

    stop_time: = DBMS_UTILITY. GET_TIME;

    DBMS_OUTPUT. Put_line ('time to' | schema_name_rec.username |) ' : ' || To_char ((stop_time-start_time)/100) | "seconds");

    dbms_output.put_line('===');

    end loop;
    ...

  • How to debug PL/SQL packages?

    Hi all

    We have two packages with thousands of lines of code using global temporary tables. The package execution returned the KEY UNIQUE constraint violation.

    What is the best method to capture where the problem exactly is?

    Can anyone provide the docs of the sample or samples on how to debug packages

    -Thank you,

    rcc50886 wrote:

    We have two packages with thousands of lines of code using global temporary tables. The package execution returned the KEY UNIQUE constraint violation.

    What is the best method to capture where the problem exactly is?

    Delete all the WHEN of OTHER exceptions masking of the code.

  • Debug pl/sql script

    I am new to Oracle sql. But there is always something wrong.
    Would you please help me do the following sql code well work?

    create table temp (id integer intvalue varchar (20));
    ENGAGE
    I declare integer: = 1;
    while I < 100
    loop
    Insert values (id, intvalue) temp (i, to_char (i));
    i: = i + 1;
    end loop;
    Select * from temp

    Welcome to the forum.

    You can do this in SQL more, try:

    create table temp(id integer, intvalue varchar(20));
    insert into temp(id, intvalue)
    select level
    ,      to_char(level)
    from   dual
    connect by level <= 100;
    select * from temp;
    

    You can find many examples of PL/SQL and explanations in navigation/search the Oracle Documentation Online @ http://www.oracle.com/pls/db112/homepage

  • Debugging pl/sql and validations

    Hello

    Using oracle 11.2.03. and have a package called other packages as part of a series.

    Deliberately no commit every package must complete before agrees to end of any string such that if necessary re - run can without results being dubbed etc.

    Find out exactly where the is not in the code.

    What is the code is build an array more than 100 temporary table files, and then try to write the results of the present in the main table.

    It is can not see the contents of this table when fails so can't say wrong area.

    Ideally, I'd like to copy the contents of this table to another debug_table without committing...

    Had thought of autonoumous transaction but this not visible table for that content.

    Tried to run immediately to create another debug_table but this commit has implied that the end of it, it seems.

    What is recommended for us to view the contents of the temporary table without validation.

    Thank you

    If you are connected, you should have selections relatively USEFUL and the ANSWER for each of the responses in the thread.

  • problem running the session of remote debugging for specific oracle sql developer

    I have a problem running the session of remote debugging of sql server specific oracle developer.
    I get the following error:
    Connection to the database mmgrep - INNA.
    PL/SQL execution: ALTER SESSION SET PLSQL_DEBUG = TRUE
    Running PL/SQL: CALL the DBMS_DEBUG_JDWP. CONNECT_TCP ('inna.followap.com', '4029')
    ORA-30683: failure connecting to debugger
    ORA-12535: TNS:operation expired
    ORA-06512: at "SYS." DBMS_DEBUG_JDWP', line 68
    ORA-06512: at line 1
    Process is complete.


    I understand that Oracle is unable to connect to my PC.
    I have 2 different oracle servers to work with the sql developer. With one I can run debugger, with another - the errow above.
    I need to change to be able to start debugging with second oracle server.

    In tools | Preferences | ebugger, you can specify a range of ports for the debugger to use so you can limit it to those that are open on the firewall.

    And just to check, is the ip address that is displayed in the CONNECT_TCP call the right one for your PC?

  • PL/SQL, debugging via Eclipse

    Hi all

    I'm developing an application JSP in Eclipse (3.3.0) and SQL Developer (1.2.1), which interacts with an Oracle database operations that write in the DB are all stored in stored procedures and called from the Java Code.

    What I'm trying to do, it's remotely debug PL/SQL code - when you debug Eclipse Java code, so I can trace the whole process, otherwise I do not see what is happening in the stored procedures.

    How can do remote debugging of Eclipse?

    Thanks, Leonard

    Published by: user8324848 on 05.09.2008 05:30

    call is a SQL * more of the customer's order and the braces are not part of pl/sql.

    TO call a procedure of JDBC, you run a pl/sql block.

    stmt = "start; fasi_lob.debugOn; end; « ;

  • In MS SQL Server Management Studio, cannot add a port to the Windows Firewall exceptions list.

    I am trying to debug a sql script in the debugger to MS SQL Server 2008 and I received a message saying 'could not configure the Windows Firewall. Cannot add a port to the Windows Firewall exceptions list. "Use the Panle controls to manually configure Windows Firewall.

    Hi GusGomez,

    The question you have posted is related to the server and would be better suited in the Technet forums. Please visit the link below to find a community that will support what ask you
     
    Hope this information helps.
  • Debug/run procedures within the package

    Debugging with SQL Developer was generally very nice and I have come to rely on these tools. Today, I've written a procedure in a package and I want to debug this process, but I don't see it in the list of targets. It seems that I see only functions in the target list. I understand that the procedures need not have the same kind of output in function, but sometimes I like to create procedures that have multiple SETTINGS, especially when it comes to an exit very closely related.

    The interesting thing is that I can create this same procedure as a stand-alone procedure and the run/debug works great. Apparently I'm missing something obvious in SQL Developer somewhere I thought it was there all the time (I guess for a while since I've written a procedure with OUT parameters) but maybe I'm wrong. Any ideas or help someone?

    Earl

    It should work.

    Is that you can create a package of simple heel with just a function procedure that is a NULL; and use it as a test?

    If this does not work there either, please send a screenshot so we can see what you see in the debugging with the missing procedure dialog box.

  • SQL Developer debugger does not start

    I found a strange behaviour, while debugging PL/SQL stored procedures using SQL Developer version 4.1.0.19 on Ubunto 12.04 LTS. The debugger works fine for all the bases of my company, except one. When I start a debugging session in this database, the debbuger let go forever and never debug dialog box open. When I use another IDE, for example, PL/SQL Developer of AllroundAutomations on Windows 7, the debugger works very well. I used the same user database with all necessary Preobrajensky. First I thought it was a bad configuration of the database, but as I could start with another IDE debugging sessions, I think that this is not the case. So, I would like to know if someone could help me understand what is happening.

    Captura de tela de 2015-05-12 17:09:15.png

    We opened a request for support at Oracle and they offer us to turn on an earlier version of the debugger to work around the problem:

    Add at the end of the file line-by-line ide.properties:

    DatabaseDebuggerDisableJDWP=true


    The ide.properties file can be found here (on Windows XP):

    C:\Documents and Settings\\Application Data\SQL Developer\system${VERSION} \o.sqldeveloper${SYSTEM_VERSION}


    or here (on Windows 7):

    C:\Users\\AppData\Roaming\SQL Developer\system${VERSION} \o.sqldeveloper.${SYSTEM_VERSION}

    for Linux users:

    $HOME/.sqldeveloper/system${VERSION}/o.sqldeveloper.${SYSTEM_VERSION}/ide.properties

    It works!

  • Table external slow access of compiled PL/SQL, quick of SQLPLUS

    I'm under Oracle Standard Edition One 12.1.0.1.0 Windows x 64.  Small and simple external table queries since met PL/SQL are run very slowly with a second 18 delay, but the same sqlplus queries run very fast, both on the same instance.  I ran Profiler DBMS and debugged PL/SQL to confirm that it takes 18 seconds to query the file header record in an external table in PL/SQL, but the same exact sqlplus query runs in 0.07 seconds.

    This seems very odd.  I searched online and OTN, but I can find no example of why this would happen between the two access methods in the same instance.  Something is suspended until the execution of the external PL/SQL table compiled very hurt to be 18 seconds vs 0.07 seconds of sqlplus.  Before you buy the license Oracle I tried the table external access on trial Enterprise Edition on a laptop Windows x 64 where approaches both the PL/SQL and SQL executed just as fast (0.07 seconds in this case).  The main difference now is Standard Edition and Enterprise and production running on a Windows x 64 server.  I have no parallel enabled in the environment.

    The log file of external table displays this information message:

    KUP-05004: WARNING: disabled source Intra concurrency because select parallel is not sought.

    I think it's just because I'm not under parallel access on the external table.  The message is the same if the questioning of PL/SQL or sqlplus.

    It seems to be something coherent overall of all external PL/SQL tables in this case, because I studied 3 external tables and they all almost exactly 18 seconds later to PL/SQL vs sqlplus, even if number of rows of tables outside and requests files access to them are different.

    How can I know which slows down access PL/SQL method and correct to my production programs?  I created a test case and ran to share results:

    I create an external table of test:

    -Create table

    create the table TEMP_EXT

    (

    Field1 VARCHAR2 (10),

    VARCHAR2 (10) Field2.

    field3 VARCHAR2 (10)

    )

    external organization

    (

    type ORACLE_LOADER

    STRATESIS_DATA_DIR default directory

    access settings

    (

    RECORDS DELIMITED BY '\n '.

    BADFILE STRATESIS_LOG_DIR: 'temp.bad'

    STRATESIS_LOG_DIR LOG file: 'temp.log'

    NODISCARDFILE

    FIELDS TERMINATED BY ', '.

    SURROUNDED OF POSSIBLY "" "

    MISSING FIELD VALUES ARE NULL

    (Field1, Field2, field3)

    )

    location (STRATESIS_DATA_DIR: 'temp.txt')

    )

    reject the limit 0.

    I already have the directories above put in place in the database.

    I create a file temp.txt in the above data directory. It has two rows:

    Field1, Field2, field3

    2field1, 2field2, 2field3

    I create an autonomous PL/SQL procedure (not in a package, but I get the same result if I put it in a package):

    create or replace procedure tryplsql is

    l_field1 temp_ext.field1%TYPE;

    l_field2 temp_ext.field2%TYPE;

    l_field3 temp_ext.field3%TYPE;

    BEGIN

    SELECT field1, Field2, field3

    IN l_field1, l_field2, l_field3

    OF temp_ext

    WHERE field1 = "field1";

    Dbms_output.put_line(l_field1 ||) ',' || l_field2 | ',' || l_field3);

    end tryplsql;

    I run as a sqlplus pl/sql procedure:

    SQL > exec tryplsql

    Field1, Field2, field3

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:17.68

    SQL > spool off;

    It takes almost 18 seconds?

    I performed the simple query of sqlplus and it's quick:

    SQL > select Field1, Field2, field3 from temp_ext where field1 = "field1";

    FIELD1 FIELD2 FIELD3

    ---------- ---------- ----------

    Field1 Field2 field3

    Elapsed time: 00:00:00.01

    SQL > spool off;

    Very fast 0.01 second.

    I run the following block of sqlplus:

    SQL > DECLARE

    l_field1 2 temp_ext.field1%TYPE;

    3 l_field2 temp_ext.field2%TYPE;

    4 l_field3 temp_ext.field3%TYPE;

    5

    6 BEGIN

    7 SELECT field1, Field2, field3

    8 l_field1, l_field2, l_field3

    9 FROM temp_ext

    10. WHERE field1 = "field1";

    11

    12 DBMS_OUTPUT.put_line(l_field1 ||) ',' || l_field2 | ',' || l_field3);

    13

    14 END;

    15.

    Field1, Field2, field3

    PL/SQL procedure successfully completed

    Elapsed time: 00:00:00.01

    SQL > spool off

    It is also very fast.  In SQL, and even a PL/SQL block sqlplus are fast, but a procedure have complied is slow?

    I have a lot of packages, procedures, functions, etc., running very fast in the DB as long as there are no external table access (no time 18 seconds).  I ran DBMS Profiler on several sections of code - in all cases, that the call to the external tables takes 18 seconds.  I tried to debug PL/SQL and again the request to the external tables takes 18 seconds every time.

    Probably something obvious I'm missing, but I am confused.  Any help is appreciated.

    Support of Oracle has identified the issue as a known bug in 12.1.0.1.   Bug #18824125

    The workaround until patched is drop the PL/SQL as sys (not a good option), or to grant any directory of the user who executes the PL/SQL will be launched.  It worked.

  • Debugging on a database that is not localhost

    Hello

    I have a XE 11 g and SQL Dev 3.1 EA3. The XE is on Oracle Linux 5. Listener is in 1521.

    I'm trying to debug my SQL Dev client procedure.

    In preferences, I updated the ports 4000-4999

    When I try to turn on debugging, this is the response:
    Connecting to the database ONLINE MST.
    Executing PL/SQL: ALTER SESSION SET PLSQL_DEBUG=TRUE
    Executing PL/SQL: CALL DBMS_DEBUG_JDWP.CONNECT_TCP( 'xx.xx.xx.xx', '4000' )
    ORA-30683: failure establishing connection to debugger
    ORA-12541: TNS:no listener
    ORA-06512: at "SYS.DBMS_DEBUG_JDWP", line 68
    ORA-06512: at line 1
    Process exited.
    Disconnecting from the database ONLINE MST.
    Well... I then change the port 1521 where the listener is:
    Connecting to the database ONLINE MST.
    Executing PL/SQL: ALTER SESSION SET PLSQL_DEBUG=TRUE
    Executing PL/SQL: CALL DBMS_DEBUG_JDWP.CONNECT_TCP( 'xx.xx.xx.xx', '1521' )
    ORA-30683: failure establishing connection to debugger
    ORA-12537: TNS:connection closed
    ORA-06512: at "SYS.DBMS_DEBUG_JDWP", line 68
    ORA-06512: at line 1
    Process exited.
    Disconnecting from the database ONLINE MST.
    I tried Google - but without much success. It is perhaps obvious, but what I have to activate?

    concerning
    Mette

    What is "xx.xx.xx.xx? This should be your client sqldev. If it is bad, use preferences - Debugger - guest for the debugger host. Once it works, I think you can disable it again.

    Hope that helps,
    K.

  • Debug procedure trigger or a database stored by Forms 10 g

    Hello
    I want to debug my level trigger table (on the update for each line), I'm updating this table of forms. When I debug this form I can't watch the debug database.

    Please help me about the database trigger/function/procedure debugging of applications.

    not possible through forms

    You can debug on SQL Developer using INSERT updated manual controls

  • Error: "the instruction at 0x010acd0c referenced memory is not able to be read. "SQLDUMPER library not initiation" to start Windows XP.

    Original title: SQLDUMPER library initiation.

    From the start of my computer, I get the following error message:

    "The instruction at 0x010acd0c referenced memory is not able to be read. "SQLDUMPER library not initiation.

    What can be done to perfect this problem?

    Dump SQL program is a program that helps you to debug the SQL database on your system crashes.

    If you don't have SQL Server installed on your system or don't know what it means, that the software SQL debugging could subsist a trial version of the software you installed and uninstalled then more late leaving the program SQL dump and now he doesn't know what to do with himself.

    Take a look in Add/Remove programs to something like this:

    Microsoft SQL Server VSS Writer

    If find you it and know that you are not using SQL Server, uninstall Microsoft SQL Server VSS Writer, restart and see what things look like.

Maybe you are looking for