SQL statement causes the database to hang

Guys,

a DBA told me that there is something wrong with this SQL statement and causes a blockage of database...

Please check.

SELECT field1 FROM table1 WHERE Field1 LIKE ' %% ' AND field2 = '123456' ORDER BY Field2 ASC

Tell me, what is the problem with statement above. The LIKE operator is?

Thanks for the help!

Are not specifically related to your question, but having a clause such as ' where Field2 ='123456 "and then you place your order on Field2 is not really going to do much for you, all values will be identical!

Carl

Tags: Database

Similar Questions

  • Copy SQL statement to another database with the same SQL_ID

    Is there a reliable way to copy a sql statement in a database to another preserving the formatting so it ends with the same SQL_ID.

    I want to copy a statement of the shared pool to a test database to develop a plan to import sql database in production.

    In the past, I just did ' select sql_fulltext from v$ sql "in SQL Developer and pasted the result into a spreadsheet SQL Developer and run it.   The statement is now in the pool shared with the correct sql_id.

    This does not work for instruction, I am currently in train.  It ends with a different id of sql.

    I know it's probably a problem of formatting, but the statement is 1000 characters and a manual check will take forever.

    You could put in a SQL Tuning Set and transfer it.

  • can a sql statement cause different sql_id?

    can a sql statement cause different sql_id? reason why I ask... in my AWR report by looking at the sql section I found even with different sql_id sql query... .i was thinking of a sql can have only a single sql_id... .i double checked 5 or 6 times the sql text... they are the exact same, but different sql_id... .is it possible?

    No, it is not possible.

    However if you compare:

    select * from emp.scott 
    

    with

    select * FROM emp.scott
    

    These two will have different hash values, because the hash value is case-sensitive.

    I know, Oracle uses the portion of the MD5 to generate the SQL_ID and the HASH_VALUE of a sql statement.

    Bearing in mind the last, it would be possible that two different sql queries have same hash values.

    I recommend Tanel Poder's article on the relationship between the SQL_ID and HASH_VALUE (it's a very good article)

    http://blog.tanelpoder.com/2009/02/22/sql_id-is-just-a-fancy-representation-of-hash-value/

  • SQL sent to the database in obiee 10g

    Hello

    I can't see the SQL sent to the database in the log file. Ony able of logical query. I connected inwith administrator and checked th eloglevel is 5.

    How can I view the general sql query that was sent to the database.

    Thank you

    Advanced to the prefix tab
    SET VARIABLE DISABLE_CACHE_HIT = 1;

    Or another NQConfig.ini

    The NO value to cache.

    Since it is answered, mark it as correct :)

    Published by: Srini VIEREN on April 26, 2013 10:35

  • Is it possible to make the condition depending on the sql statements in the data models

    Hi all

    Is it possible to include the condition based on sql statements in the data models.

    For example
    if (some parameter is not null)
    <sqlstatement name="STATEMENT_1">
    ...
    </sqlstatement>
    else
    <sqlstatement name="STATEMENT_2">
    ...
    </sqlstatement>
    Is something like this? Also, the good doc is available for ' how to take full advantage of the "data models" in BI Publisher?

    Thank you
    -Sookie

    Hello Sookie,
    I couldn't find the time to get a data model of demonstration of work for you, but I'll try to explain.

    First, write a PL/SQL package. Make sure that you set all the parameters of model of data such as a global variable in the default PL/SQL package.

    CREATE OR REPLACE
    package as employee
    function BeforeReportTrigger return Boolean;
    query_text varchar (2000);
    number of p_DEPTNO;
    END;
    /

    CREATE OR REPLACE
    package as body employee
    function BeforeReportTrigger return Boolean IS
    Start

    IF (p_DEPTNO = 10) THEN
    query_text: = select col1, col2, col3 from HR.
    elsif (p_DEPTNO = 20) THEN
    query_text: = select col1, col2, col3 hr_history.
    on the other
    query_text: = select col1, col2, col3 hr_history1.
    end if;
    Returns true;
    end;
    /

    Use this package in the default package in your data model. Check the "defaultPackage ="employee"in the following data model header.

    Sample data model
    ------------------------------












    --
    --
    --
    --

    Before running the query SQL, data engine reads the "before the release of the report" and all the texte_requete argument based on the p_DeptNo value. When executing the Q1, engine sqlQuery analyze the query ' & quert_text and replace it with the actual value. For example if the p_deptno = 10, the query will be "select col1, col2, col3 from HR.

    Try it...

  • Pinning on SQl statement in the library cache

    Hello
    Do to pin frequently used SQL statement to the shared pool...

    I know that dbms_shared_pool.keep does the job for PL/SQL, but on simple SQL statements.

    Experts from the clues?

    Thank you

    King

    See more of scripts:

    -- Get address and hash_value of SQL statement
    select address, hash_value from v$sql where sql_text like 'your query to keep';
    ------------------------------------------------------------------------------------------------
     00000000858CA2B0      2239673969
    
    exec dbms_shared_pool.keep('00000000858CA2B0, 2239673969','C');
    

    I think you want to pin the SQL statement that is specific to the moment analysis of long abovid.
    I see no reason to pin the SQL more.

    Dion Cho

  • Try to run a SQL statement through the window of OEM 12 c run SQL.  Statement fails

    All,

    I have a 11g database.  When it is initially installed, I installed it in $ORACLE_BASE = / orabin/app/oracle/product and $ORACLE_HOME = $ORACLE_BASE/11gDB_R2.  This is the version 11.2.0.1 to give birth to 11.2.0.3.

    Recently, I installed 11.2.0.4 in $ORACLE_BASE/11.2.0.4.  Then, I upgraded my database at 11.2.0.4.  Everything works fine.

    All my scripts on the linux host logon changed to point my environment at $ORACLE_BASE/11.2.0.4 House and my $PATH when I connect to the linux host is: /orabin/app/oracle/product/11.2.0.4/bin:/orabin/app/oracle/product/11.2.0.4/OPatch:/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin

    On my OEM Console, the database appears as 11.2.0.4 and me can manage very well.

    However, when I try to use the window of the OEM Console to execute SQL to execute any type of SQL statement, it fails.

    The failure error is:

    Could not launch/orabin/app/oracle/product/11gDB_R2/bin/sqlplus-s/nolog: no such file or directory

    It would be a mistake since the 11gDB_R2 directory tree (the 11.2.0.3 software) has been removed from the host, now that the database is set to level and working as 11.2.0.4.

    I wonder if somewhere in the OEM software, there is always a pointer to the old ORACLE_HOME?  I can't find anything in the .bashrc or other shell scripts that are executed when a Shell session on the host computer which were still the reference to the old directory of 11gDB_R2 so I'm a bit puzzled.

    I have 8 guests, and all have been improved in the same way at 11.2.0.4.  For some databases, the OEM window run SQL is executing the SQL code.

    Someone has some ideas on this?

    Go to the Configuration of the analysis of the database (when you set the password) and update of the Oracle home.   Also do this for all targets listener on this host as well.

  • FDM generated SQL statement in the log file?


    Hello everyone, hopefully a simple question:

    When you perform an import using FDM, I know that behind the scenes of a SQL SELECT statement statement composed and performed on the database server. My question: the actual SQL statement is retained in a newspaper somewhere (so that we can see it?) In our case, it's an Oracle DB server and we use the ERPI adapter; not sure if it's relevant. We would like to enter this SQL statement and use it as a starting point for other things.

    Thanks in advance for anything you can offer.

    The statement SQL is not written in the journal of the adapter.  The only things that are registered are what show in the file card log if you enable loggin to the adapter source ERPi in action 'Get Data'.

  • Invalid SQL syntax causes the removal of the view

    I have found that when you change a view through SQL Developer, entering the syntax invalid SQL and hit 'Cancel' causes in my opinion should be deleted. Here are the steps that present this problem for me:

    1. create, save, and close a valid database view by clicking right "views" on the Connections tab and selecting «New view...» »
    2. open the view via a right click on the view and selecting ' Edit... »
    3 change to point to a non-existent table
    4 try to save, select "OK".
    5. when presented with an error message, click OK in the dialog box "Edit Error object.
    6. click on 'Cancel' in the window "Edit View".
    7. right click on the view, and then select 'open '. The "SQL" tab is empty, even though you can see the value in the "Columns" tab
    8. after refreshing, the view is a party.

    I looked under the problems known and searched the forum to see if it had been reported. Please let know us if there is some setting I can change to avoid this problem. I hope it's a bug, because I can't imagine the changes not saved, causing the removal of the view would be the desired behavior. Please find below my contact information of the environment.

    -Matt

    Details of the environment
    ==============

    The version of SQL Developer: 3.0.04 build HAND - 04.34
    DB version:
    Oracle Database 10g Release 10.2.0.4.0 - Production
    PL/SQL Release 10.2.0.4.0 - Production
    "CORE 10.2.0.4.0 Production."
    AMT for Linux: release 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    Java version:
    Java version "1.6.0_16.
    Java (TM) SE Runtime Environment (build 1.6.0_16 - b01)
    The Client Java VM (build 14, 2 - b01, mixed mode, sharing)
    OS: Windows XP Pro SP2

    Yes.
    Changed to Bug 12334150: EDIT DELETED THE VIEW DIALOG box ON entering a not VALID AND the CANCELLATION of THE DIA SYNTAX

    -Rambeau

  • Logging has no SQL statements using the view system

    Hello

    We would like to improve our logging of errors of logging of sql statements failed.
    in other words, when a user does something in our system that generates a sql error.
    We want to connect to the corresponding sql statement.

    to do this, we need a way to get this statement by using a sql query.
    is there perhaps something like a point system with the sql statement failed where
    I can just go get the last being?

    would be very happy for some advice.

    Yes, you need to activate the first check. Checkout:

    http://www.Oracle-base.com/articles/10G/Auditing_10gR2.php
    http://www.tiplib.com/183/enable-auditing-Oracle-database

  • SQL statement for the hierarchy of the Organization

    Nice day

    I was wondering if there is a script/sql statement that would generate the hierarchy of the Organization (similar to the organization hierarchy editor) in Oracle EBS HRMS 11.5.10

    Thank you
    Elmer

    I was wondering if there is a script/sql statement that would generate the hierarchy of the Organization (similar to the organization hierarchy editor) in Oracle EBS HRMS 11.5.10

    Please see if (how to extract HR organization hierarchies in SQL? [REF 463359.1]) help.

    Thank you
    Hussein

  • Hide results SQL - State of the button, see the

    Hello
    I use APEX 4.0 with Toad for Oracle 10.5. My problem is that I need to hide the delete button based on the results of the SQL statement. When the point: P43_DEPARTMENT_ID value is entered and there is for any field below, the data will appear along the line.
    SELECT (SELECT distinct department_id
                 FROM tbl_department
                WHERE department_id = :P43_DEPARTMENT_ID
                AND department_id IN (SELECT SUBSTR (division_id, 0, 5)
                                              FROM tbl_division))
                AS DIVISION, 
     (SELECT distinct department_id
                 FROM tbl_department
                WHERE department_id = :P43_DEPARTMENT_ID
                AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5)
                                              FROM tbl_grant))
                AS GRANTS,     
     (SELECT distinct department_id
                 FROM tbl_department
                WHERE department_id = :P43_DEPARTMENT_ID
                AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5)
                                              FROM tbl_allotment))
                AS ALLOTMENT,  
     (SELECT distinct department_id
                 FROM tbl_department
                WHERE department_id = :P43_DEPARTMENT_ID
                AND department_id IN (SELECT department_id
                                              FROM tbl_department_temp))
                AS DEPARTMENT_TEMP,
     (SELECT distinct department_id
                 FROM tbl_department
                WHERE department_id = :P43_DEPARTMENT_ID
                AND department_id IN (SELECT SUBSTR (division_id, 0, 5)
                                              FROM tbl_division_temp))
                AS DIVISION_TEMP, 
     (SELECT distinct department_id
                 FROM tbl_department
                WHERE department_id = :P43_DEPARTMENT_ID
                AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5)
                                              FROM tbl_grant_temp))
                AS GRANT_TEMP,     
     (SELECT distinct department_id
                 FROM tbl_department
                WHERE department_id = :P43_DEPARTMENT_ID
                AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5)
                                              FROM tbl_allotment_temp))
                AS ALLOTMENT_TEMP
    FROM DUAL
    But when no data appears that there is still a blank line for the fields. That will make the hidden Delete button. I don't know how to remove this row of the grid with my results of the select statement above. The State still thinks there is a line and a value (s) appear statement.
    DIVISION OF | GRANTS | ALLOTMENT | DEPARTMENT_TEMP | DIVISION_TEMP | GRANT_TEMP | ALLOTMENT_TEMP
    ________|_______ |___________|__________________|_____________ |____________|_________________
    Can someone help me with my select statement or provide me with advice on how to remove this blank line when there is no data? I can't create a view and then add a WHERE IS NOT NULL clause because of the variable binding: P43_DEPARTMENT_ID.

    Do not know if I just got it, but what about:

    SELECT SELECT (separate department_id
    OF tbl_department
    WHERE department_id =: P43_DEPARTMENT_ID
    AND department_id IN (SELECT SUBSTR (division_id, 0, 5)
    OF tbl_division))
    THE DIVISION,
    SELECT (separate department_id
    OF tbl_department
    WHERE department_id =: P43_DEPARTMENT_ID
    AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5)
    OF tbl_grant))
    FORM OF GRANTS,
    SELECT (separate department_id
    OF tbl_department
    WHERE department_id =: P43_DEPARTMENT_ID
    AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5)
    OF tbl_allotment))
    AS ASSIGNMENT,.
    SELECT (separate department_id
    OF tbl_department
    WHERE department_id =: P43_DEPARTMENT_ID
    AND department_id IN (SELECT department_id
    OF tbl_department_temp))
    AS DEPARTMENT_TEMP,
    SELECT (separate department_id
    OF tbl_department
    WHERE department_id =: P43_DEPARTMENT_ID
    AND department_id IN (SELECT SUBSTR (division_id, 0, 5)
    OF tbl_division_temp))
    AS DIVISION_TEMP,
    SELECT (separate department_id
    OF tbl_department
    WHERE department_id =: P43_DEPARTMENT_ID
    AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5)
    OF tbl_grant_temp))
    AS GRANT_TEMP,
    SELECT (separate department_id
    OF tbl_department
    WHERE department_id =: P43_DEPARTMENT_ID
    AND department_id IN (SELECT SUBSTR (fk_division_id, 0, 5)
    OF tbl_allotment_temp))
    AS ALLOTMENT_TEMP
    OF THE DOUBLE
    LESS
    SELECT NULL, NULL, NULL, NULL, NULL, NULL, NULL from double

    This should ensure you don't receive a "no data found" when all the columns return null.

  • find sql_id using the sql statement, including the carriage return and tab...

    Hello. all.

    I wonder how to find sql_id using a sql statement, including transport retrun and tab space multiple.
    To be more precise,

    My sql is:

    Select
    col_a,
    col_b,
    ..
    ..

    I usually use the following query to find the sql_id

    Select sql_id in v$ sql where sql_text like 'MY SQL STATEMENT %.

    When MY SQL STATEMENT includes carriage return and tab space multiple, how can I do?

    Thanks in advance.
    Best regards.

    Hello

    Did you look at regular expressions? Use regexp_like instead of as.

    http://www.Stanford.edu/dept/ITSS/docs/Oracle/10G/server.101/b10759/conditions018.htm

    Kind regards

  • SQL statement for the materialized view?

    Can someone please tell me what SQL statement creates a materialized view?

    Syntactically, Yes. Otherwise Yes too (as long as you don't mind the Cartesian join with State B).
    Why not just try and see what happens?

    Concerning

    Etbin

  • State of the database...

    I had a strange question(for me)... when I use oracle as a user my data base search "on", at the same time with my user name, it looks like the "standby". I checked IDs at the level of the BONE and it showed me that I am part of the dba group. Can someone explain to me please on this issue... The datails below...


    Thanks in advance.

    whoami $
    Oracle
    $ su - john
    Jean password:
    whoami $
    John
    $ sqlplus "virtue sysdba".

    SQL * more: Production version 11.2.0.1.0 Tue Apr 13 16:16:46 2010

    Copyright (c) 1982, 2009, Oracle. All rights reserved.

    Connect to an instance is idle.

    SQL > exit
    Disconnected
    $ su - oracle
    Oracle password:
    [YOU HAVE NEW MESSAGES]
    $ sqlplus "virtue sysdba".

    SQL * more: Production version 11.2.0.1.0 Tue Apr 13 16:17:09 2010

    Copyright (c) 1982, 2009, Oracle. All rights reserved.


    Connected to:
    Oracle Database 11 g Release 11.2.0.1.0 - 64 bit Production

    SQL > select status from v$ instance;

    STATUS
    ------------
    OPEN

    SQL > exit
    Disconnected from the database to Oracle 11 g Release 11.2.0.1.0 - 64 bit Production
    $ id
    UID = 206 (Oracle) gid = 203 (oinstall) groups = 0 (system), 204 (dba)


    $ su - john
    Jean password:
    $ id
    UID = 1000 (John) gid = 204 (dba) groups = 1 (staff), 203 (oinstall)

    Hello

    It simply means that you have not set correctly ORACLE_SID/ORACLE_HOME before using the sqlplus command.

    Set ORACLE_SID correctly and then connect to the database.

    Concerning
    Anurag

Maybe you are looking for

  • 40 Firefox fails to load the pages after about an hour of use

    I have followed all 7 steps and added suggestions to https://support.mozilla.org/en-US/kb/troubleshoot-and-diagnose-firefox-problemsbut none solves the problem. FF40 works after you restart the computer, then don't load/refresh pages (get the circle

  • Satellite A210-12U - no lights come on or anything like that

    I have a Satellite A210-12U who died on me. I wasn't doing anything special, just posting on a bulletin board, one just like this and the power died, almost as a power cut, without warning. It was plugged in at the time. And now it is completely dead

  • Can I transfer my IPad to someone else?  I just don't use it.

    I have an IPad 3 & I just don't use it.  Can I give someone and take my name, password and ID, qustions, and put their own identity on that? I would appreciate a response and how to do it.  I wonder if I should contact the Apple support or if its pos

  • Error code 646 for Windows Vista

    When I try to install these updates, I get an error code 646.  I have a laptop Dell Inspiron 1501 with Windows Vista. Update of security for the viewer Microsoft Office Visio 2007 (KB973709) Download size: 2.5 MB You may have to restart your computer

  • Replacing the hard drive on my Pavilion dv6 - 3150ee but the bios is not recognize it.

    Hello I have a HP Pavilion dv6-3150ee. my original hard drive was broken. I bought a western digital 500 GB 5400 Sata 2. I installed the hard drive and made the recovery. Everything went well past and ok. When completed recovery operation, the system