Plsql_optimize_level = 3 and native compilation in SQL Developer?

SQL Developer: Version 3.1.06 (Build MAIN-06.82)
Oracle: 11gR2
OS: Ubuntu 10.10
Whenever I compile a PL/SQL unit in SQL Developer (using 'Compile' button) it is compiled with the following settings:
PLSQL_OPTIMIZE_LEVEL = 2
PLSQL_CODE_TYPE = 'INTERPRETED'
However, if I issue the following commands in an SQL Worksheet:
ALTER SESSION SET plsql_optimize_level = 3;
ALTER PACKAGE PACKAGE_NAME COMPILE PLSQL_CODE_TYPE = NATIVE;
the query SELECT PLSQL_OPTIMIZE_LEVEL, PLSQL_CODE_TYPE FROM ALL_PLSQL_OBJECT_SETTINGS WHERE NAME = 'PACKAGE_NAME'; resullts in
PLSQL_OPTIMIZE_LEVEL     PLSQL_CODE_TYPE
3     NATIVE
3     NATIVE
Is it possible to make SQL Developer to use these settings by default?
P.S. It seems that Tools > Preferences > Database > PL/SQL Compiler menu section is missing the options I need (Optimization level drop-down menu have numbers 0-2, but not 3). Are there any plans to support these features in the future releases?
Edited by: Ravshan Abbasov on Feb 6, 2012 6:28 AM

Hi Ravshan,
I thought a workaround would be to create a sql script like the following:
alter session set plsql_code_type=native;
alter session set plsql_optimize_level=3;  then point to it in the setting for Tools|Preferences|Database|Filename for connection startup script. That doesn't work however, as the other preference setting for plsql_optimize_level overrides the session value of 3 during compilation from the UI.
According to Oracle documentation, level 3 was added for Oracle 11g. Prior to that, the same effect could be achieved by level 2 in conjunction with the INLINE pragma in the PL/SQL code.
You might want to make a feature request for this on the SQL Developer Exchange so the community can vote and comment.
Regards,
Gary
SQL Developer Team
Edited by: Gary Graham on Feb 6, 2012 2:32 PM
And, of course, Compile for Debug does not work with the 'native' setting.

Similar Messages

  • Code runs correctly when compiled by SQL developer but not SQL Plus

    I have a rather large package body I need to deploy and compile ... It's big and complex (I inherited the project). Our it dept is huge and scripts are deployed by the dba team and they seem to only use sql plus. My code deploys and runs fine when compiled in sql developer. Once I compile it from SQL plus it stops working. It runs and using debug statements I can see the values are correct but it no longer inserts the data into the proper tables. I get ZERO errors or warnings when this is compiled in SQL Plus and no errors are generated from the code at run time. I've diffed the extracts of the code from the DB after each deployment and the only difference is the blank lines which SQL Plus strips out when you load the file. Has anyone run into anything remotely similar and if so how did you solve it? I've tried modifying the code to no avail, adding in comments to preserve the white space makes no difference. The thing that really kills me is that there is no error at all.

    Ok this is the problem area.... vReplyMessage is a clob. I've replaced it in this section of processing with a varchar2(32000). And now it works. I still would like to know why though. Nothing is changed when I load it though sqlplus or sql developer but this line " update swn_recip_response_t set SWN_RECIP_RESPONSE = vTextReply where notification_id = v_notification_id; " would never execute with the clob. Logging showed that the clob had the correct value though. I am puzzled.
    begin
    call_SWNPost('http://www.sendwordnow.com/usps/getNotificationResults',vMessageText, vReplyMessage, v_status_code, v_status_phrase, '');
    exception
    when others then
    raise eJavaException;
    end;
    vTextReply := dbms_lob.substr( vReplyMessage, 32000, 1 );
    if (vDebug) then
    update PEMS_PROD_2.SWN_POST_LOG set response = 'notif_id == '|| v_notification_id || 'status code == '|| v_status_code|| ' '||vTextReply where log_pk = vLogPK;
    commit;
    end if;
    IF v_status_code = 200 then
    v_has_error := 'N';
    ELSE
    v_has_error := 'Y';
    END IF;
    -- we handle all exceptions below in case something goes wrong here.
    -- this area can die silently.
    vTextReply := replace(vTextReply,'<getNotificationResultsResponse xmlns="http://www.sendwordnow.com/usps">', '<getNotificationResultsResponse xmlns:xyz="http://www.sendwordnow.com/usps">');
    begin
    insert into swn_recip_response_t(notification_id) values (v_notification_id);
    exception
    when others then
    if (vDebug) then
    err_num := SQLCODE;
    err_msg := SUBSTR(SQLERRM, 1, 100);
    insert into PEMS_PROD_2.SWN_POST_LOG (LOG_PK, create_date, REQUEST, notification_id) values(pems_prod_2.swn_post_log_seq.nextval,sysdate,
    'err_num - '||to_char(err_num)|| ' error_msg - '|| err_msg, v_notification_id);
    commit;
    else
    null;
    end if;
    end;
    commit;
    begin
    update swn_recip_response_t
    set SWN_RECIP_RESPONSE = vTextReply
    where notification_id = v_notification_id;
    exception
    when others then
    if (vDebug) then
    err_num := SQLCODE;
    err_msg := SUBSTR(SQLERRM, 1, 100);
    insert into PEMS_PROD_2.SWN_POST_LOG (log_pk, create_date, REQUEST, notification_id) values(pems_prod_2.swn_post_log_seq.nextval,sysdate,
    'err_num - '||to_char(err_num)|| ' error_msg - '|| err_msg, v_notification_id);
    commit;
    else
    null;
    end if;
    end;
    commit;
    -- parse through the XML document and update the notification and recipient records
    -- parse the clob into an xml dom object
    begin
    vReplyMessage := vTextReply;
    ...

  • Native Compiled PL/SQL - Missing ORAPLS9.LIB (9i Release 2)

    In configuring the Natively Compiled PL/SQL feature of Oracle 9i, the library file ORAPLS9.LIB file can't be found. I tried generating it with:
    LIB /DEF:ORAPLS9.DLL
    but got the following warnings which didn't quite look right, and the resultant orapls9.lib file is rather small and doesn't work (unresolved externals).
    Is the ORAPLS9.LIB file supposed to be installed with 9i Release 2 for Windows 2000, or am I generating it incorrectly?
    BTW, the snpc_makefile.mk file is installed with 9i Release 2 for Windows, but not with 9i Release 1 for Windows.
    Thanks,
    Kevin Runner
    [email protected]
    Runner Technologies, Inc.
    561-395-9322
    OUTPUT
    E:\oracle\ora92\bin>lib /def:orapls9.dll
    Microsoft (R) Library Manager Version 6.00.8447
    Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
    LIB : warning LNK4068: /MACHINE not specified; defaulting to IX86
    orapls9.dll : warning LNK4017: MZI statement not supported for the target platform; ignored
    orapls9.dll : warning LNK4017: $ statement not supported for the target platform; ignored
    orapls9.dll : warning LNK4017: &&`j statement not supported for the target platform; ignored
    orapls9.dll : warning LNK4017: -? statement not supported for the target platform; ignored
    orapls9.dll : warning LNK4017: &E&#9658; statement not supported for the target platform; ignored
    orapls9.dll : warning LNK4017: -jF&#9668;oC&#9830;&#9829;-^kC&#9830;[os]+IIIIIIIIIIIUo8b8&#8593;oM6SVoG7 Wu&#9827;o~Hd6weI statement not supported for the target platfo
    rm; ignored
    orapls9.dll : warning LNK4017: jK&#9668;[]IIIIIIIIUo8So]&#9792;VWoC&#9830;o&#8252;o+-?&#9829;t statement not supported for the target platform; ignored
    Creating library orapls9.lib and object orapls9.exp

    Have you managed to resolve this problem?
    I'm having exactly the same experience (it's very frustrating, as I'm trying to run a benchmark at the moment).
    Hope to hear.
    Regards,
    T.
    Message was edited by:
    terenceo

  • Native Compiled PL/SQL on WindowsXP (Visual Studio)

    Has anyone tried to native compile PL/SQL packages on Windows XP using Visual Studio?
    Please give me your values for PLSQL* initialization parameters and a makefile that works.
    /Hakan

    Hi,
    Sorry to bump this thread, but I would like to validate something.
    Is it possible, or does it make sens, to have a database that has both native and interpreted?
    Our PLSQL_CODE_TYPE is set to interpreted but everthing else is configured for native.
    When i do the bellow query:
    select type, plsql_code_type, count(*)
    from dba_plsql_object_settings
    where plsql_code_type is not null
    group by type, plsql_code_type
    order by type, plsql_code_type
    We have bunch of functions in native/interpreted, same thing for package, package body, procedure, trigger, type, type body.
    Thank you,
    Felix

  • Manage and control tablespace on SQL Developer

    Hi all.
    I have downloaded SQL Developer Early adopter 4.0.
    I want to know if it is possible to control and check properties of tablespace of my user on DB.
    Thanks all for collaboration,
    Fabrizio

    Under DBA Panel, then Memory and then Tablespace. I double click on tablespace icon and then I receive this error:
    I translate from italian:
    ORA-00942: table o view does not exist
    Fabrizio

  • AIX 5L 64 bits + Native compiled PL/SQL

    Hi Gurus,
    Question for you. I'm tryng to find documentation/procedure on how to switch from native to interpreted pl/sql for AIX 5L 64 bits.
    Anyone could point me to some documentation on how to go from Interpreted to Native and vice-versa? Also, documentation about IBM C compiler/ GCC could be usefull too.
    Thank you,
    Felix

    Hi,
    Sorry to bump this thread, but I would like to validate something.
    Is it possible, or does it make sens, to have a database that has both native and interpreted?
    Our PLSQL_CODE_TYPE is set to interpreted but everthing else is configured for native.
    When i do the bellow query:
    select type, plsql_code_type, count(*)
    from dba_plsql_object_settings
    where plsql_code_type is not null
    group by type, plsql_code_type
    order by type, plsql_code_type
    We have bunch of functions in native/interpreted, same thing for package, package body, procedure, trigger, type, type body.
    Thank you,
    Felix

  • To view database Java Source and Class code in SQL Developer - Do this...

    I've wanted something like this for a while.. Hope this helps someone else...
    Make a master detail report...
    1. Click the reports tab.
    2. Right click on "user defined reports" and select "add report"
    3. Type "Java Source Object and Class Code" into the name field.
    4. Make sure "Style" is set to "Table".
    5. Paste this code into the "SQL" window.
    select OBJECT_NAME, OBJECT_TYPE, to_char(created,'DD-MON-YYYY HH24:MI:SS') Created, to_char(LAST_DDL_TIME,'DD-MON-YYYY HH24:MI:SS') "Last DDL", STATUS
         from user_objects
        where object_type in ('JAVA SOURCE')
        order by object_name6. Click "Add child"
    7. Make sure "Style" is set to "Code" in the child.
    8. Paste the following code into the SQL window of the child.
    select text from user_source where name = :OBJECT_NAME order by line9. Click Apply..
    10. Enjoy...
    no semicolons after the sql....
    Message was edited by:
    slugo

    Mark,
    Thanks Check this out people can now subscribe to the public reports out no the exchange.
    http://krisrice.blogspot.com/2007/10/marks-post-on-forums-got-me-to-do.html
    -kris

  • Missing ladybug and run icons in SQL Developer

    When I open a package body in the editor, I´m missing the green arrow icon and the ladybug icon. SQLDev was installed as part of the Ora11g client. I found no other way to generate the "run" anonymous block.
    Any ideas? Is there somewhere I can enable the icons?

    1) I'd recommend downloading SQLDeveloper 1.5.5 as the version bundled with 11g is very old (1.2).
    2) Are you sure you are in an editor and not a 'viewer'? If you have a 'pencil and paper' icon, you are in a viewer. Click on it to open an editor.
    3) Try running sqldeveloper from <sqldev>\sqldeveloper\bin\sqldeveloper.exe and see it there are any errors in the console when you open a procedure.

  • Please explian what is native compilation and how to use it

    hi all.
    please explian what is native compilation and how to use it
    regards

    It's explained well in the PL/SQL User's Guide and Reference
    Compiling PL/SQL Code for Native Execution
    http://download-uk.oracle.com/docs/cd/B10501_01/appdev.920/a96624/12_tune.htm#48419

  • SQL Developer version 3.2.20.09 and Oracle Diff

        It is my understanding that from this version onwards this functionality would be available without licensing but it is not available for use actually, maybe I am doing something wrong or just "bad info" ?
    I downloaded jre version 32 bits.
    Thanks!

        It is my understanding that from this version onwards this functionality would be available without licensing but it is not available for use actually, maybe I am doing something wrong or just "bad info" ?
    You need to provide more information than that.
    1. How did you come by this 'understanding'?
    2. What does 'not available for use' mean? It is available to me.
    3. We have no idea if you are "doing something wrong" since you didn't bother to post WHAT you are doing or HOW you are doing it.  You do realize that you have to have at least two DIFFERENT databases open don't you?. You can't do a 'diff' between databases if you don't have two databases open to 'diff'.
    4. As restated in the PL/SQL Packages and Types doc for the DBMS_METADATA_DIFF package
    http://docs.oracle.com/cd/E18283_01/appdev.112/e16760/d_metadiff.htm
    Use of the DBMS_METADATA_DIFF package requires a license to the Oracle Enterprise Manager Change Management option.
    Someone from the sql developer team will need to confirm whether the product uses that package and if the free sql developer application  waives or alters that license requirement. My own hypothesis would be that the product uses the package but does NOT waive or alter the license requirement.

  • Integration of  SQL Developer and Data Modelling - concerns.

    In aanother thread about OSDM connections, I commented that the development team for OSDM and the core product seem to separate and Sue responded.
    Sue Harper wrote:
    A clarification of the Data Modeling feedback application and this forum. The developers are part of the SQL Developer development team, but as for all our features, each developer has a focus area, so the Data Modeling developers will tend to answer those questions. The reason I said that they seem to be separate as that ODSM seems to be put together completely differently. I hit another example today. I downloaded a fresh copy of osdm without JDK. On starting it up, it complained it couldn't find a jre and quit. There was no prompt to specify the location as there is with SQLDevloper and there are no configuration files to edit.
    SQLDeveloper already has issues with different components doing the same differently. The number of problems has been reduced but it has taken some time and I am concerned that the introduction of a large body of new code will cause things to revert to the bad old days in terms of quality.
    I may or may not end up using OSDM, but I want to have the choice. I don't want components I don't use becoming part of the application and adding bloat. The migration components are a case in point. The "migration workbench" ought to be a completely separate add-in rather than a core component and I hope this is down with OSDM.

    Jim,
    "I don't want components I don't use becoming part of the application and adding bloat." Absolutely. and we agree. SQL Developer Data Modeling will be a separate standalone product so that users who don't want to use SQL Developer, but who do want to model will have that option. The nice thing about an integrated solution is that if you are doing database work and then want to do some modeling, you are in one tool. Our current plans are to release the standalone product in the initial production release and then follow that with the extension to SQL Developer depending on the customer demand. We do plan to release a read only viewer as part of SQL Developer 2.0. This will be an extension, which like the Migration extension, you can switch off. and from your note, you'd prefer the reverse, that these new extensions are pieces you choose to include and not choose to exclude.
    I'm not certain we'll get agreement on this, but I'll be interested. Just this morning I was updating a thread were the request was for all the pieces to be there working out of the box.
    Sue

  • SQL Developer and TOAD connection.

    Hi,
    I am able to see the DDL script for tables using TOAD, but NOT using SQL Developer (2.1.1). Same user, pass, and tnsname file.
    They use same tnsname.ora file on my computer. I set basic and TNS connection for SQL Developer.
    The connection is from my computer to the server (Oracle 11.1.0.7 EE).
    ORA-31603: object "ALARM_DEFINITION" of type TABLE not found in schema "AIRCOM"
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "SYS.DBMS_METADATA", line 3241
    ORA-06512: at "SYS.DBMS_METADATA", line 4812
    ORA-06512: at line 1
    It is same with packages. I cannot see package body.
    What is the different and which additional privileges I need to see the DDL script?
    Thanks in advance for your help!
    Konstantin

    I don't think it's a connection issue. There seem to be differences in how Oracle and Toad access system views to show objects. If you search the boards you see it has effected a couple of people. Sometimes they post what permissions they changed to get things to work for them.
    ie... Re: Issue with viewing Package Body  in SQL Developer 2.1 RC1
    I don't think I've seen any official documentation to indicate what privileges need to be granted in order to see them thought. And I think there is a bug that prevents generating DDL for tables owned by other users. I don't know if that extends to generating stored procedure code.

  • Small bug and fix starting SQL Developer on Mac OS X

    I couldn't find anyone else mentioning this so I'll write it in.
    If I started SQL Developer in one user I couldn't start it again in another user, even after quitting out of the first. I would double click the icon and it would do the animated "zoom" but then nothing.
    I tracked it down to a problem in SQLDeveloper.app/Contents/MacOS/sqldeveloper.sh. When it redirects the output of the call to the start scipt in the /sqldeveloper/bin directory it would fail because the /tmp/sqldeveloper-startup.log was owned by the first user to start the App (since the /tmp was cleared anyway). My umask didn't give it permission to start overwriting that file.
    To fix it I changed the last line in SQLDeveloper.app/Contents/MacOS/sqldeveloper.sh to:
    bash ./sqldeveloper >/tmp/sqldeveloper-startup.$$.log
    so that the PID was now part of the name and each initiation of SQL Developer would have its own.
    You could also change the last line to:
    bash ./sqldeveloper >$(mktemp /tmp/sqldeveloper-startup.log.XXXXX)
    which would guarantee more uniqueness but wouldn't let you know which process was using the file.
    Savvy Mac users can edit the script themselves by right-clicking on the SQLDeveloper.app and selecting "Show Package Contents". You may have to temporarily change the file permissions to let you edit it.
    For the record I'm running SQL Developer 1.2.0 on a Mac TiBook G4 867MHz with Mac OS X 10.4.10 and 1Gb RAM (and it is still maddeningly slow because Java fundamentally sucks).
    -Bion

    Ok - I think I found it.
    Go into ~/Library/Application Support/SQL Developer/system1.5.3.57.83/o.ide.11.1.1.0.22.49.44 (or similar for whatever version you're running) and edit the settings.xml file there.
    Look for a block that looks like:
    <Item class="oracle.javatools.util.Pair">
    <first class="java.lang.String">delete-previous</first>
    <second class="oracle.ide.keyboard.KeyStrokes">
    <data>
    <Item class="javax.swing.KeyStroke">[0]</Item>
    </data>
    </second>
    </Item>
    and change it to:
    <Item class="oracle.javatools.util.Pair">
    <first class="java.lang.String">delete-previous</first>
    <second class="oracle.ide.keyboard.KeyStrokes">
    <data>
    <Item class="javax.swing.KeyStroke">[8]</Item>
    </data>
    </second>
    </Item>
    I'm not sure why, but this file seems to always contain the incorrect keystroke value when I do a fresh install of SQL Developer. I always have to go in and change that value by hand. I've tried choosing any number of the accelerator presets, but none of them make the delete key work.

  • PL/SQL Bug in SQL Developer?

    SQL Developer v 1.1.1.25 running on Windows XP.
    I have a PL/SQL procedure that does not compile with debug in SQL Developer. Compiling it with debug produces the following error:
    an Error(1): PLS-00801: internal error [79110].The only way I was able to get the procedure to compile in SQL Developer was to add the 4th line. If I uncomment the 4th line it compiles with debug. Why??
    Here is the procedure:
    CREATE OR REPLACE
    PROCEDURE BOGUS AS
      CURSOR c1 IS
        SELECT dummy FROM DUAL;
    --  x c1%ROWTYPE;
      PROCEDURE test ( rec IN OUT c1%ROWTYPE) IS
      begin
        null;
      end;
    BEGIN
      NULL;
    END BOGUS;Message was edited by:
    marife
    I played around some more with the procedure and discovered the problem. The key is the compiling with debug. I believe that compile with debug cannot build the debug information for a %ROWTYPE as a parameter. But if I define a local variable of that %ROWTYPE, then the compile with debug knows what debug information to track for the %ROWTYPE.
    I discovered that in SQL*Plus it compiles, but when you issue the ALTER PROCEDURE bogus COMPILE DEBUG, it does not compile. This is a problem with the debug option for compiling and not a problem with SQL Developer.
    Sorry for the posting. Hopefully this information will save other times and fustration.
    Mike

    Just for anyone else searching on this bug - I get the same error with certain procedures in TOAD when compiling with DEBUG.
    Fortunately nobody here has the first clue how to use TOAD debug so it's only ever switched on by accident or after a reinstall (it's the default) - so turning debug off fixes the problem.

  • Host variables in SQL Developer not showing decimal places

    I'm a very newbie, taking my first PL/SQL class, so please be gentle! I think this may be a SQL Developer problem, because when I run the same thing from terminal-line SQLplus on my Linux install, it works right.
    I'm working with a procedure, and passing a value out to a host variable. Although the value should have a decimal portion, when I print the host variable, all that prints is the integer portion.
    Here's the entire program:
    set serveroutput on;
    create or replace package mypkg
    is
      procedure myproc
        (p_in in number,
         p_out out number);
    end;--END package mypkg
    create or replace package body mypkg
    is
      procedure myproc
        (p_in in number,
         p_out out number)
      is
        lv_out_num number(7,2);
      begin
        lv_out_num := p_in / 10.0;
        p_out := lv_out_num;
        dbms_output.put_line('p_out is ' || to_char(p_out,'999.99' ));
      end;--END procedure myproc
    end;--END package body mypkg
    variable myvar number
    execute mypkg.myproc(33,:myvar);
    print :myvarAnd here's the output:
    PACKAGE mypkg compiled
    PACKAGE BODY mypkg compiled
    anonymous block completed
    p_out is    3.30
    MYVAR
    3As you can see, myvar should be 3.3, but it only shows 3. However, like I said above, when I do this from sqlplus from a terminal in linux, it works fine. Thus I'm thinking its a SQL Developer thing.
    Details:
    Machine:
    HP Pavilion dv6 notebook (Core i7) with 8 GB RAM
    Windows side:
    Windows 7 Home Premium SP1
    Oracle 10g Express
    SQL Developer 3.1.06
    Linux side:
    Oracle Linux 5.6 (in Virtualbox)
    Oracle 11g release 1
    Thanks,
    Alex

    Hi,
    This issue has been previously reported on and bugged:
    Re: Oracle Sql Developer prblem with variable format
    Regards,
    Gary

Maybe you are looking for