Using an NDS for an unfavorable SQL executed only once in a proceudure

Hello
We are using Oracle 11.1.0.7.0.

I go through the code written by someone else. In this package they use NDS for each SQL call if it is called several times, or only once. Is it a good thing?

I thought that NDS has been reserved for SQL statements that over and over again in a possible procedure called variant "WHERE clause" variables and so on...

Is there AN advantage to using NDS for SQL queries called only once in a procedure?

Thank you

There is no benefit unless you want to convert PL/SQL SQL * more (analyze once, run once)
There are procedures to ensure: analysis at compile time, run many times.
The code turns in his own foot.

Or the developer must have got hold of the unpublished book one chapter of Tom Kyte "how to write impassable applications."

---------
Sybrand Bakker
Senior Oracle DBA

Tags: Database

Similar Questions

  • We will use a script that allows users to connect only once.

    We will use a script that allows users to connect only once. 
    However some users need a second possibility of connection.
    How is - this can be handled in a script?

    The users in question are members of the same group secuity.

    Where the use of Windows server 2003 with xp clients.

    Hello

    Your question of Windows 7 is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please post your question in Windows 7 IT Pro Technet Forums network.

    http://social.technet.Microsoft.com/forums/en/category/WindowsServer/

    I hope this helps.

  • How can I access other demo sample such as sh (sales history) patterns similar to hr & oe I use to study for the exam SQL?

    I installed Oracle 12 c database on my Tablet Windows Pro 8.1 and I chose to install demo (sample) patterns in an additional download of oracle.com/downloads.  Then, on the instruction of the book corrected Oracle, I've unlocked users 'HR' and 'oe' using the following commands:

    ALTER user HR account unlock identified per hour;

    ALTER user oe account unlock identified by oe;

    I've been connecting to connections HR and oe to write and execute sql commands following fundamentals of SQL as well as the book in preparation for the exam successfully.  Now, in Chapter 10 of the book, he mentions the "sh" (historical sales) pattern.  I tried to launch a slight spin on orders above change/unlock to unlock the 'sh' user when logged in sysdba, but I get an error message indicating that the user "sh" is not found.  So I've navigated to the .sql file sh_main.sql and opened it with SQL Developer to run it, but it requires parameters that are not in the book, as if they were in Chapter 1 of 'oe' and 'hr '.  I know put sh as password, USERS, TEMP and V3 for version, but I do not know the path of log file to use (or type as a parameter).  Maybe I go about it the wrong way at this point?  It is not as simply by running the command user unlock, because it does not recognize the "sh" user even if that user exists in the directory tree under connect sysdba "other users".

    What am I supposed to do to connect to the less common, but still useful demo schema "sh" (sales history)?

    Thank you

    Heather

    It works well for me.

    BTW in V11 + passwords are CaSeSenSiTive

    SQL > select username from dba_users where username like 'P % ';

    USERNAME

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

    PHPDEMO

    PLS

    PM

    SQL > account user PM ALTER unlock identified by PM;

    Modified user.

    SQL > connect h/h

    ERROR:

    ORA-01017: name of user and password invalid. connection refused

    WARNING: You are more connected to ORACLE.

    SQL > connect h/h

    Connected.

    SQL > USER TO SEE THE

    The USER is "PM".

  • I want to get rid of having to use a password for good, I'm the only user

    I did not need to be an administrator, and I understand there is a way to get just a standard account.

    Hello

    Yes, for all Windows 7

    Kind regards.

  • How to use one login for all applications in one only workspace

    Hi all

    I'm creating a mobile application for our College, which will include 10 applications with different access control.

    I need single sign on for this. Based on the username of connection, I need to set up access control.

    Could someone guide me how to do this?

    Thank you.

    Kind regards.

    Maahjoor wrote:

    I'm creating a mobile application for our College, which will include 10 applications with different access control.

    I need single sign on for this. Based on the username of connection, I need to set up access control.

    See:

  • While the loop executes only once?

    I'm doing a LabVIEW program to control a power supply of Sorensen. The VI circled in red calls for supply of the voltage and current and then exports it. I want this to happen continuously, but it seems that it only updates once. Anyone know how to fix this?

    Yes.  Your loop will not go again until an event occurs as the change in value on the value of the boolean values.  You might want to set a timeout on the structure of the event so that if no event occurs (I don't know if you have other manifestations), the case of delay of the event structure is running and the loop will iterate.

  • I can't synchronize my music twice in my Apple Watch... Why? Always show waiting for synchronization... (just only once after I reset all content and settings)

    Hi, I did several times reset the Apple Watch...

    The music album could be only synchronize again to cool after the reset

    It's really annoying me later...

    Is in any way remedy?

    = IN APPLE WE TRUST = u

    Hello

    If you have not already done so, it can help to upgrade your iPhone and Apple Watch to the latest version of the software:

    Update the software on your iPhone, iPad or iPod touch - Apple Support iOS

    Update the software on your Apple Watch - Apple Support

    Do not forget that the playlist starts synchronization when your watch is in charge and your iPhone is nearby, with devices connected through Bluetooth.

    More information:

    Listen to music on your Apple Watch - Apple Support

  • Oracle of the MAF error ' cannot read the DataControl uses on loadDataControl for the id:

    Need help!

    I created a simple SOAP web service for a remote database that works very well in 12 c WebLogic Server and also in the Jdeveloper HTTP Analyzer. When I use the same web service in the attached code, I get the following error (I've included output System.out.println in Ref. to the flow of the code) I use Jdeveloper 12 c MAF 2.0.0.0.41 on Mac OSx 10.9.

    Chk #0

    Processing line # 1

    Chk #1

    Chk #2

    [SEVERE - oracle.adfmf.framework - AmxBindingContext - loadDataControlById] Cannot read the DataControl uses on loadDataControl for the id: WLFNewActWS. [SEVERE - oracle.adfmf.framework - SynchronizationDC - syncDataFromOfflineToOnline] [Ljava.lang.StackTraceElement;@467c53d3

    @


    Sorry about that, I think I'm wrong you.

    OK, I created an example to test what goes wrong.

    1. server side, create a project named Employee_ws

    a. Department_ws.java

    public interface {Department_ws}

    public boolean addDepartment (a Department);

    }

    b. Department.java

    public class {Department

    public Department() {}

    Super();

    }

    int departmentId.

    String departmentName;

    locationId int;

    managerId int;

    {} public void setDepartmentId (int departmentId)

    this.departmentId = departmentId;

    }

    public int getDepartmentId() {}

    return departmentId.

    }

    {} public void setDepartmentName (String departmentName)

    this.departmentName = departmentName;

    }

    public String getDepartmentName() {}

    return departmentName;

    }

    {} public void setLocationId (int locationId)

    this.locationId = locationId;

    }

    public int getLocationId() {}

    return locationId.

    }

    {} public void setManagerId (managerId int)

    this.managerId = managerId;

    }

    public int getManagerId() {}

    return managerId;

    }

    }

    c. Department_impl.java

    @WebService

    / public class Department_impl implements Department_ws {}

    public Department_impl() {}

    Super();

    }

    @Override

    @WebMethod

    {} public boolean addDepartment (@WebParam (name = "arg0") a Department)

    If (Department! = null) {}

    int departmentId = department.getDepartmentId ();

    String departmentName = department.getDepartmentName ();

    int locationId = department.getLocationId ();

    managerId int = department.getManagerId ();

    Connection Conn;

    try {}

    Conn = ConnectionFactory.getConnection ();

    conn.setAutoCommit (true);

    Statement šment = conn.createStatement ();

    String inset_sql =

    "INSERT INTO dept (department_name, location_id, department_id, manager_id) VALUES ('+ '.

    departmentId + "," "" + departmentName + "'," + locationId + "," + managerId + ")";

    šment. Execute (inset_sql);

    Returns true;

    } catch (Exception e) {}

    System.out.println (e);

    }

    }

    Returns false;

    }

    }

    d. ConnectionFactory.java

    import java.sql.Connection;

    to import java.sql.DriverManager;

    import java.sql.SQLException;

    Connect to the database

    public class {ConnectionFactory

    public ConnectionFactory() {}

    Super();

    }

    protected static connection conn = null;

    public static connection getConnection() bird Exception {}

    If (conn == null) {}

    try {}

    String driver = "oracle.jdbc.driver.OracleDriver";

    String url = "jdbc:oracle:thin:@localhost:1521:orcl";

    User String = "employee";

    String password = "employee";

    Class.forName (driver);

    Conn = DriverManager.getConnection (url, user, password);

    } catch (SQLException e) {}

    System.Err.println (e.getMessage ());

    }

    }

    return conn;

    }

    public static {} Sub closeConnection()

    try {}

    If (conn! = null) {}

    Conn.Close ();

    Conn = null;

    }

    } catch (Exception ex) {}

    throw new RuntimeException (ex);

    }

    }

    }

    You can run Department_impl.java to start the Web service. i.e. http://127.0.0.1:7001 / Employee_ws-Client-context-root/Department_implPort? WSDL

    Server side sql:

    CREATE USER employee IDENTIFIED BY employee DEFAULT TABLESPACE users

    Temp TEMPORARY TABLESPACE

    Users WE QUOTA UNLIMITED;

    GRANT create employee to logon.

    GRANT alter used to logon.

    GRANT create any employee at table;

    GRANT create trigger employee TO;

    GRANT create any employee to view;

    GRANT create sequence employee TO;

    GRANT create synonym employee TO;

    GRANT create type employee TO;

    GRANT create employee to procedure;

    CREATE TABLE (DEPT

    DEPARTMENT_ID NUMBER (7, 0) NOT NULL,

    DEPARTMENT_NAME VARCHAR2 (50).

    NUMBER OF LOCATION_ID (7, 0),

    MANAGER_ID NUMBER (7.0)

    );

    2 create a mobile application of CRG named Dept

    a. Department.java (even for the server)

    b. SynchronizationDC.java

    import java.util.ArrayList;

    import java.util.List;

    Import oracle.adfmf.framework.api.AdfmfJavaUtilities;

    Import oracle.adfmf.framework.exception.AdfInvocationException;

    public class SynchronizationDC {}

    public SynchronizationDC() {}

    Super();

    }

    public void syncDataFromOfflineToOnline() {}

    It's just for testing, so I build Department manually instead of mobile db data, please replace in your business logic

    A Department = new Department();

    department.setDepartmentId (1);

    department.setDepartmentName("1");

    department.setLocationId (1);

    department.setManagerId (1);

    NamesList list = new ArrayList (1);

    List ParamsList = new ArrayList (1);

    List TypesList = new ArrayList (1);

    namesList.add ("arg0");

    paramsList.add (department);

    typesList.add (Department.class);

    try {}

    AdfmfJavaUtilities.invokeDataControlMethod ("Dept_WS", null, "addDepartment", namesList, paramsList,

    typesList);

    } catch (AdfInvocationException e) {}

    System.out.println (e);

    }

    }

    }

    c. new an AMX pag called Dept.amx

    "http://www.w3.org/2001/XMLSchema-instance" xmlns:amx ="http://xmlns.oracle.com/adf/mf/amx"

    xmlns:dvtm ="http://xmlns.oracle.com/adf/mf/amx/dvt" >. "

    Text = "syncDataFromOfflineToOnline."

    Disabled = "#{!}" Bindings.syncDataFromOfflineToOnline.Enabled}"id ="cb3"/ >

    d. deploy on Android Simulator

    Click the button and a new record have been db insert through the webservice, search the remote db recording

    If above does not solve your problem, please let me know, thanks.

    Byron

  • When to use the cursor for loop and the cursor (open, fetch, close)

    Hello world
    I have a small doubt about when to use the cursor for loop and when to use the cursor for loop and the cursor (open, fetch, close).
    Well, I'm not the difference between implicit and explicit cursor. So please tell me how I got to know, what to use and when?




    Kind regards
    BS2012

    Published by: BS2012 on January 29, 2013 12:15

    All SQLs are analyzed, stored and executed as cursors. Thus, you will always use a cursor.

    The problem is that languages, such as PL/SQL, provide different interfaces to interact with the SQL cursor. As the ref, the slider interface, the interface DBMS_SQL slider interface and so on.

    Each of these interfaces offers different features. For example, using the interface DBMS_SQL allows binding dynamics and dynamic recovery. The Ref Cursor interface allows your code PL/SQL pass a handle to a reference pointing to the SQL cursor, to an external client. Etc.

    The fundamental reason for the use of an explicit cursor interface is mainly that you own and manage bulk made extraction output provided by PL/SQL cursor.

    With a cursor FOR , the motor loop of PL/SQL optimize the loop by extracting block a 100 lines both. However, you cannot access this collection in bulk directly inside the loop.

    With an explicit cursor interface, you specify the size of the extraction in bulk via the clause LIMIT , and you set the variable of collection to use. This allows you to use the collection directly variable inside the loop.

    However, the need to do - code manually in bulk collection - rarely occur in the daily programs in PL/SQL. A line of treatment is both slow and not well fits. And even if your bulk code collects lines, these lines must still be processed one at a time in your code. It is much more efficient and scalable rather write SQL code, and make the engine SQL the line of treatment for you.

  • Call a procedure that returns a refcursor, use it in an another proc sql?

    I have a procedure that returns a refcursor; How can I include this refcursor in a sql statement that is inside another procedure, or view etc.?

    This is the kind of foolery, I tried so far (myproc1 returns a ref cursor):

    create or replace procedure myproc2
    (
    slider ref RC
    )
    AS
    RC1 of ref cursor;
    Start
    EXECUTE myproc1 (rc1).
    Open rc for
    Select rc1.* in the rc1;
    end myproc2;

    If you want to use the result set in an SQL Ref Cursor won't be of any help. Can be read all nested Table Type. You can declare an object type and store your result in them and use them in SQL.

    Thank you
    Knani.

  • Use of ROWID in the Update SQL statement

    Hi all

    I have an update statement that uses the rowid column to make the selection on the target table. Since a rowid represents the physical location of a row on disc, we know that this reference may change when various activities are conducted on the line of database/table/etc...

    Here is an example of the statement I post:

    UPDATE tabA outertab SET col1 = 'value '.
    WHERE EXISTS (SELECT 1 FROM tabA innertab WHERE outertab.) ROWID = outertab. ROWID AND...)

    Of course, the inner query is more complicated and uses other tables etc. but for the purposes of the example we don't need to include the details.

    My question is: what help rowid in a single statement SQL as a reference of a subquery in the outer statement is there a risk that outdoor activities can change the rowid and these changes be reflected in the session database that my query is executed which causes an incompatibility between the clause SQL internally and externally?

    In response to the question that will follow this post: 'why don't you just use a PK', we would like to avoid to maintain a PK on the table that we are talking about very large volumes of data and we do not want to have to appeal to a sequence, if we can avoid when we insert the data. If however there is a risk that this Update statement may fail, or update lines badly, then we might have to use a PK.

    I know there are a lot of discussions about this, but I havnt been able to find one that someone answered with any kind of confidence or clarity, any help would be appreciated.

    Thank you

    Keith

    Edited by: Turtle on March 5, 2009 05:24

    When using rowid in a single statement SQL as a reference of a subquery in the outer statement is there a risk that outdoor activities can change the rowid and these changes be reflected in the session database that my query is executed which causes an incompatibility between the clause SQL internally and externally?

    No, it's safe to use rowid in this query type. Docs

    A line assigned ROWID remains unchanged, unless the line is exported and imported using the import and export utilities. When you delete a row in a table, then commit the transaction enclosing, rowid of the deleted row can be attributed to a line inserted in a subsequent operation.

  • recently sql executed by applications

    Dear all,

    I would like to build a module for my application debugging and modules can display later or recent sql (eg 10) performed by the application.

    I found a similar sql but this single list last sql, sql

    Select a.username, a.terminal, a.program, b.sql_text
    session $ v a, v$ sqlarea b
    where a.audsid = (select userenv ('sessionid') of double)
    and a.sql_address = b.address
    ;

    Is there a way to list 20 recently sql executed by the application?

    THX!

    Reference documents;
    1 watch the last sql of the current session: oracle, session, last
    http://www.experts-exchange.com/database/Oracle/Q_20973836.html

    2 AskTom discussion
    http://asktom.Oracle.com/pls/ask/f?p=4950:8:519498075307800596:no:F4950_P8_DISPLAYID, F4950_P8_CRITERIA:497421739750,

    Try to gather a lot of data when an application has encountered an error seems to be a rather poor idea. To the point where you met a connection error, you're probably not in a good position to run a bunch of queries. After all, the error may be your connection to the database has been lost, your session has been killed, etc..

    Generally, it would be more logical to keep a log of what the app does at each stage and then to a clerical error in the newspaper when there is a mistake, point from which a person can spend by the newspaper to try to find the source of the problem. It is quite common to just reel the paper constantly in a file and do rotate programmatically newspapers to prevent them from using too much disk space, but you could also allocate a few MB of memory and to keep a living newspaper that gets only written to disk when an error is generated.

    Justin

  • Parse Hard & Soft Parse for a given SQL?

    Hi all

    I need to know which of these is a hard and soft analysis for a given Sql. What I think is the 'charges' and 'invalidation' indicates if a cursor is invalidated and gets reloaded, which allows us to check if a call analysis becomes hard analysis.

    Confusion here is should "Disk reads" value nonzero means hard analysis regardless of the 'load' and 'invalidation' and 'Disc bed' zero value means soft parse?

    SELECT a.SQL_ID, a.INSTANCE_NUMBER, a.SNAP_ID,
      TO_CHAR(b.END_INTERVAL_TIME, 'DD-MON-YYYY HH24:MI') snap_time,
      a.PLAN_HASH_VALUE,
            ROUND(a.ELAPSED_TIME_DELTA/1000000) TOTAL_EXECUTION_TIME_SEC,
            ROUND(a.CPU_TIME_DELTA/1000000)    cpu_seconds,
            a.ROWS_PROCESSED_DELTA    rows_processed,
            a.BUFFER_GETS_DELTA      buffer_gets,
            a.DISK_READS_DELTA      disk_reads,
            a.EXECUTIONS_DELTA      executions,
            a.PARSE_CALLS_DELTA    parses,
      a.VERSION_COUNT             version_count,
            a.LOADS_TOTAL               loads_total,
            a.INVALIDATIONS_TOTAL       invalidations_total
    FROM DBA_HIST_SQLSTAT a, DBA_HIST_SNAPSHOT b
    WHERE a.SNAP_ID = b.SNAP_ID and a.INSTANCE_NUMBER=b.INSTANCE_NUMBER
    AND a.INSTANCE_NUMBER=1 AND a.SQL_ID='bsraj0u9r9d3w'
    ORDER BY a.SNAP_ID desc;
    
                                                                 TOTAL
                  Instance      Snap Snap                    EXECUTION     CPU                    Buffer     Disk                   version loads invalidations
    Sql Id          Number        Id Time                    TIME(Sec) Seconds     Rows             Gets    Reads Executions Parses   count total         total
    ------------- -------- --------- -------------------- ------------ ------- -------- ---------------- -------- ---------- ------ ------- ----- -------------
    bsraj0u9r9d3w        1      9368 12-FEB-2016 12:00              14      13      200       14,079,211      780          2      1       1     6             5 --- hard Parse
    bsraj0u9r9d3w        1      9348 11-FEB-2016 16:00             110      91    1,500      104,806,435        0         15      4       1     5             4 --- ??
    bsraj0u9r9d3w        1      9347 11-FEB-2016 15:00              30      29      500       34,922,061        0          5      2       1     5             4 --- ??
    bsraj0u9r9d3w        1      9346 11-FEB-2016 14:00              14      13      200       14,009,248        0          2      1       1     5             4 --- ??
    bsraj0u9r9d3w        1      9341 11-FEB-2016 09:00              14      13      200       14,009,957      651          2      2       1     5             4 --- hard Parse
    bsraj0u9r9d3w        1      9297 09-FEB-2016 13:00              20      20      500       23,380,631        0          5      4       1     4             3 --- ??
    bsraj0u9r9d3w        1      9294 09-FEB-2016 10:00              65      53    1,300       58,569,220        0         13     13       1     3             2 --- ??
    bsraj0u9r9d3w        1      9293 09-FEB-2016 09:00              18      17      300       18,635,057        0          3      2       1     3             2 --- ??
    bsraj0u9r9d3w        1      9292 09-FEB-2016 08:00              70      67    1,700       77,145,560      787         17     17       1     3             2 --- hard Parse
    bsraj0u9r9d3w        1      9272 08-FEB-2016 12:00              18      18      400       22,164,178        0          4      4       1     2             1 --- ??
    bsraj0u9r9d3w        1      9270 08-FEB-2016 10:00             106     101    2,500      123,154,635        0         26     24       1     2             1 --- ??
    bsraj0u9r9d3w        1      9269 08-FEB-2016 09:00              11      10      300       11,401,899      657          3      3       1     2             1 --- hard Parse
    bsraj0u9r9d3w        1      9253 07-FEB-2016 17:00             104      98    2,300      115,320,927      788         23     23       1     1             0 --- hard Parse
    

    Thanks in advance

    Reads disk do not mean that the query will invalidation thus analyze hard. Reading disc mean simply that the IO that happens from disk and it is perhaps due to the result not being not not available in memory.

    I'm not sure why you use this type of analysis to check if requests are going for hard analysis or not? Why not pick up a particular query run and use TKPROF(better SQLTXPLAN) or AWR based SQRPT.sql to check the same? What is the exact issuethat, you're trying to solve?

    Aman...

  • "XYZ" is not in the scope. You may need to use an alias for "MNO".

    Hello

    I use 3 entities

    Global

    ABC

    XYZ

    All relationships are in one on one, Global contains ABC and ABC contains XYZ.

    XYZ contains a text MNO attribute and I executed the bottom rule in the doc of the rule of the OPM 10.3.1 and 10.4. In 10.4 it works fine where as in 10.3, I get an error "" XYZ" is not in the scope. "You may need to use an alias for"MNO""

    MNO is correct if

    MNO = "MARK".

    I would like to know why I get this error and the solution for it.
    Thanks in advance

    I highly recommend to undertake formal training. Then the OPA is easy to get up and run with, it's like any other powerful tool that once you start digging into the most powerful bits you need to have a better understanding of the underlying concepts to really get the best value.

    You must also make sure that read you the excellent guide of best practices of Jasmine

    http://www.Oracle.com/technetwork/apps-tech/policy-automation/learnmore/policymodelingbestpracticeguide-1371173.PDF

    So assuming that we still use the above very limited model (it's rare to see 1:1 too many relationships in practice) and you need to get this working on 10.3... essentially, what you're going to need to do is navigate the relationships to pass information to the entity levels - I'll use your feature names as on the model, but they write the rules more difficult to understand.

    I suppose that the text of standard relationship containment generated automatically.

    the global attribute value

    1 For(all instances of ABC, ABC has an MNO of "Mark")

    2 otherwise

    ABC has a MNO 'brand '.

    For (all instances of XYZ to ABC, MNO XYZ = "Mark")

    Although personally I would also enter the condition in the second rule to a conclusion so separate.

  • Do need me a separate license for VMware vCenter Server Heartbeat for a remote SQL Server database?

    Do need me a separate license for VMware vCenter Server Heartbeat for a remote SQL Server database?

    Only a single vCenter Server Heartbeat license is necessary to protect the components of the vCenter Server installed remotely, including SQL Server. A single license is also used for several UNIQUE for vCenter Server services protected authentication servers. A license is required per instance of vCenter Server.

Maybe you are looking for

  • Firefox said it blocked Adobe flash

    YouTube videos usually work very well, I managed to launch a video, but two minutes after that all videos of a stopped working, and an error message appears: "this plugin is vulnerable and must be updated. Enable Adobe flash '.I thought it might be j

  • Downgrade from Vista to XP for Satellite A210-16F PSAEL

    Other users of laptops from Toshiba greetings I come to you with what I noticed to be a fairly frequent problem for users of Satellite A2xx - downgrade from Windows Vista to XP. I am owner of a 2 - day old of a Toshiba Satellite A210 - 16F PSAEL (AMD

  • Print two-sided Photosmart 7510

    I'm running Mac OSX 10.9.3 and a pilot recently re-installed for my Photosmart 7510 (long story on renewed OSX installation). Any application that I use, I am unable to get the 7510 to start to print at the long edge binding. It ONLY prints in short-

  • Get [error number: 0 x 80070424] when you try to install SP3 with Windows Update

    I got [error number: 0 x 80070424] when I was trying to do the updates window to install sp3, whatever that means? And how to fix it?

  • Sharing RunTimeStore

    Hello I read in a previous post that applications can share data using the RunTimeStore API, and I'm trying to share data in my application between 2 different modules, however I can't do. I create in my main module of the RunTimeStore RuntimeStore a