Fine tuning oracle inline view

Hi All,
i have a sql query (inline view) which is taking very long time (16 mins Approx) in our environment (Oracle 8.1.7 on Sun).
Can anyone have any idea to either fine tune the query OR convert it into PL/SQL.
Query:
SELECT DISTINCT ML.MFG_LEVEL,          
SUBSTR(ML.PROCESS_DESC,
INSTR(ML.PROCESS_DESC, '_', 1, 2) + 1) AS FACILITY,
SUBSTR(ML.PROCESS_DESC, 1, INSTR(ML.PROCESS_DESC, '_') - 1) AS PACKAGE_NAME,
SUBSTR(ML.PROCESS_DESC,
INSTR(ML.PROCESS_DESC, '_') + 1,
INSTR(ML.PROCESS_DESC, '_', 1, 2) -
INSTR(ML.PROCESS_DESC, '_') - 1) AS BASIC_TYPE,
BT.BATCH_TIME_MEAN / BS.BATCH_SIZE AS RUNTIME_BASE,
ML.TASK_DESC,
ML.RESOURCE_DESC AS RESOURCE_NAME,
ML.PROCESS_DESC
FROM (SELECT DISTINCT RP.VALUE AS MFG_LEVEL,
TM.TASK_DESC,
RM.RESOURCE_DESC,
PC.PROCESS_DESC
FROM DWH_MCD.TASK_MASTER TM,
DWH_MCD.TASK_PARAMETER_MASTER TP,
DWH_MCD.RESOURCE_MASTER RM,
DWH_MCD.PROCESS_PLAN PP,
DWH_MCD.PROCESS PC,
DWH_MCD.RESOURCE_PARAMETER RP,
DWH_MCD.PARAMETER_TYPE PT
WHERE PC.PROCESS_ID = PP.PROCESS_ID AND PP.TASK_ID = TM.TASK_ID AND
TM.TASK_ID = TP.TASK_ID AND TP.RESOURCE_ID = RM.RESOURCE_ID AND
RP.RESOURCE_ID = RM.RESOURCE_ID AND
PT.PARAMETER_TYPE_ID = RP.PARAMETER_TYPE_ID AND
PT.PARAMETER_TYPE_ID = 220037 -- AREA i.e MFG_LEVEL
AND(TM.TASK_DESC NOT LIKE '%SUBCON%' OR
PC.PROCESS_DESC NOT LIKE '%VF%')) ML,
(SELECT DISTINCT TP.VALUE AS BATCH_TIME_MEAN,
TM.TASK_DESC,
RM.RESOURCE_DESC,
PC.PROCESS_DESC
FROM DWH_MCD.TASK_MASTER TM,
DWH_MCD.TASK_PARAMETER_MASTER TP,
DWH_MCD.RESOURCE_MASTER RM,
DWH_MCD.PROCESS_PLAN PP,
DWH_MCD.PROCESS PC,
DWH_MCD.RESOURCE_PARAMETER RP,
DWH_MCD.PARAMETER_TYPE PT
WHERE PC.PROCESS_ID = PP.PROCESS_ID AND PP.TASK_ID = TM.TASK_ID AND
TM.TASK_ID = TP.TASK_ID AND TP.RESOURCE_ID = RM.RESOURCE_ID AND
RP.RESOURCE_ID = RM.RESOURCE_ID AND
PT.PARAMETER_TYPE_ID = TP.PARAMETER_TYPE_ID AND
PT.PARAMETER_TYPE_ID = 220030 -- BATCH TIME MEAN
AND(TM.TASK_DESC NOT LIKE '%SUBCON%' OR
PC.PROCESS_DESC NOT LIKE '%VF%')) BT,
(SELECT DISTINCT TP.VALUE AS BATCH_SIZE,
TM.TASK_DESC,
RM.RESOURCE_DESC,
PC.PROCESS_DESC
FROM DWH_MCD.TASK_MASTER TM,
DWH_MCD.TASK_PARAMETER_MASTER TP,
DWH_MCD.RESOURCE_MASTER RM,
DWH_MCD.PROCESS_PLAN PP,
DWH_MCD.PROCESS PC,
DWH_MCD.RESOURCE_PARAMETER RP,
DWH_MCD.PARAMETER_TYPE PT
WHERE PC.PROCESS_ID = PP.PROCESS_ID AND PP.TASK_ID = TM.TASK_ID AND
TM.TASK_ID = TP.TASK_ID AND TP.RESOURCE_ID = RM.RESOURCE_ID AND
RP.RESOURCE_ID = RM.RESOURCE_ID AND
PT.PARAMETER_TYPE_ID = TP.PARAMETER_TYPE_ID AND
PT.PARAMETER_TYPE_ID = 220008 -- BATCH SIZE
AND(TM.TASK_DESC NOT LIKE '%SUBCON%' OR
PC.PROCESS_DESC NOT LIKE '%VF%')) BS
WHERE ML.TASK_DESC = BT.TASK_DESC AND ML.RESOURCE_DESC = BT.RESOURCE_DESC AND
ML.PROCESS_DESC = BT.PROCESS_DESC AND ML.TASK_DESC = BS.TASK_DESC AND
ML.RESOURCE_DESC = BS.RESOURCE_DESC AND
ML.PROCESS_DESC = BS.PROCESS_DESC;
Please feel free to ask me for more information if needed.
Thank You.
Best Regards,
Jawahar.

Jawahar,
Before you run this sql statement analyse those tables which you use in that query using dbms_utility.analyse_schema() then create one Mview for that query. Before you do all this use "Explain Plan for" this query and observe the statistics. See you need to create a table for Explain Plan. You can find that script in ORACLE_HOME/rdbms/admin/utlxplan.sql
Kamalesh JK
jkkstar inc

Similar Messages

  • Fine tuning Oracle database

    Forward me please any suggestion/ways to fine tune Oracle database with using Toad/ Solars , or any other methods.
    Arif

    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96533/toc.htm

  • Fine tuning Oracle database using EM DB control

    What are the good features with we should use to fine tune the db system using em db control.

    All the diagnostics pack and the tuning pack capabilities are designed specifically to do what you ask.. As made available using the AWR and ADDM and used through the 'Advisor Central' link on the EM console.
    You use them the way demonstrated in the online tutorials: http://www.oracle.com/technology/products/oem/index.html and look through the documentation indicated, especially under the links "Demos and Tutorials"

  • Tuning query with inline views

    Hi!
    I have a performance problem with the following query. I try to combine v1 and v2 into one inline view but because of the recursive design of the tables workflow and workflow_node it didn't work.
    Does anybody has an idea for tuning this query?
    SELECT distinct v1.u_protocol_id
       FROM ( SELECT workflow_node.workflow_id,u_protocol.u_protocol_id
                   FROM workflow_node,workflow,U_protocol
                   WHERE workflow.workflow_id=workflow_node.workflow_id
                     AND u_protocol.u_protocol_id = workflow_node.parameter_2
                  AND workflow_node.workflow_node_type_id=17
                  AND workflow.workflow_node_type_id=42
             ) v1,
             ( SELECT workflow_node.workflow_id,test_template.test_template_id
               FROM workflow_node,test_template
               WHERE test_template.test_template_id = workflow_node.template
                 AND workflow_node.order_number = 1
                 AND workflow_node.workflow_node_type_id=42
             ) v2,
             ( SELECT aliquot.aliquot_id,test_template.test_template_id
               FROM aliquot,test,test_template
               WHERE aliquot.aliquot_id = test.aliquot_id
                 AND test.test_template_id = test_template.test_template_id
             ) v3
       WHERE v1.workflow_id = v2.workflow_id
         AND v2.test_template_id= v3.test_template_id

    I have found a script (utlxplan.sql) for creating the plan_table so here it is
    SQL> @c:\utlxplan.sql;
    Table created.
    SQL> EXPLAIN PLAN FOR SELECT distinct v1.u_protocol_id
      2     FROM ( SELECT workflow_node.workflow_id,u_protocol.u_protocol_id
      3         FROM lims_sys.workflow_node,lims_sys.workflow,lims_sys.U_protocol
      4         WHERE workflow.workflow_id=workflow_node.workflow_id
      5           AND u_protocol.u_protocol_id = workflow_node.parameter_2
      6        AND workflow_node.workflow_node_type_id=17
      7        AND workflow.workflow_node_type_id=42
      8       ) v1,
      9       ( SELECT workflow_node.workflow_id,test_template.test_template_id
    10         FROM lims_sys.aliquot,lims_sys.test,lims_sys.workflow_node,lims_sys.test_template
    11         WHERE aliquot.aliquot_id = test.aliquot_id
    12           AND test.test_template_id = test_template.test_template_id
    13     AND test_template.test_template_id = workflow_node.template
    14       ) v2
    15     WHERE v1.workflow_id = v2.workflow_id
    16  /
    Explained.
    SQL> SELECT * FROM TABLE(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    | Id  | Operation                           |  Name                           |
    Rows  | Bytes | Cost  |
    |   0 | SELECT STATEMENT                    |                                 |
    PLAN_TABLE_OUTPUT
          |       |       |
    |   1 |  SORT UNIQUE                        |                                 |
          |       |       |
    |   2 |   FILTER                            |                                 |
          |       |       |
    |   3 |    NESTED LOOPS                     |                                 |
          |       |       |
    PLAN_TABLE_OUTPUT
    |   4 |     NESTED LOOPS                    |                                 |
          |       |       |
    |   5 |      NESTED LOOPS                   |                                 |
          |       |       |
    |   6 |       NESTED LOOPS                  |                                 |
          |       |       |
    |   7 |        NESTED LOOPS                 |                                 |
          |       |       |
    PLAN_TABLE_OUTPUT
    |   8 |         NESTED LOOPS                |                                 |
          |       |       |
    |   9 |          TABLE ACCESS BY INDEX ROWID| WORKFLOW                        |
          |       |       |
    |* 10 |           INDEX RANGE SCAN          | FK_WORKFLOW_WORKFLOW_NODE_TYPE  |
          |       |       |
    |  11 |          TABLE ACCESS BY INDEX ROWID| WORKFLOW_NODE                   |
    PLAN_TABLE_OUTPUT
          |       |       |
    |  12 |           AND-EQUAL                 |                                 |
          |       |       |
    |* 13 |            INDEX RANGE SCAN         | FK_WORKFLOW_NODE_WORKFLOW       |
          |       |       |
    |* 14 |            INDEX RANGE SCAN         | FK_WORKFLOW_NODE_NODE_TYPE      |
          |       |       |
    PLAN_TABLE_OUTPUT
    |  15 |         TABLE ACCESS BY INDEX ROWID | U_PROTOCOL                      |
          |       |       |
    |* 16 |          INDEX UNIQUE SCAN          | PK_U_PROTOCOL                   |
          |       |       |
    |  17 |        TABLE ACCESS BY INDEX ROWID  | WORKFLOW_NODE                   |
          |       |       |
    |* 18 |         INDEX RANGE SCAN            | FK_WORKFLOW_NODE_WORKFLOW       |
          |       |       |
    PLAN_TABLE_OUTPUT
    |  19 |       TABLE ACCESS BY INDEX ROWID   | TEST_TEMPLATE                   |
          |       |       |
    |* 20 |        INDEX UNIQUE SCAN            | PK_TEST_TEMPLATE                |
          |       |       |
    |  21 |      TABLE ACCESS BY INDEX ROWID    | TEST                            |
          |       |       |
    |* 22 |       INDEX RANGE SCAN              | FK_TEST_TEST_TEMPLATE           |
    PLAN_TABLE_OUTPUT
          |       |       |
    |  23 |     TABLE ACCESS BY INDEX ROWID     | ALIQUOT                         |
          |       |       |
    |* 24 |      INDEX UNIQUE SCAN              | PK_ALIQUOT                      |
          |       |       |
    |  25 |    INDEX UNIQUE SCAN                | PK_OPERATOR_GROUP               |
          |       |       |
    PLAN_TABLE_OUTPUT
    |  26 |    INDEX UNIQUE SCAN                | PK_OPERATOR_GROUP               |
          |       |       |
    |  27 |    INDEX UNIQUE SCAN                | PK_OPERATOR_GROUP               |
          |       |       |
    |  28 |    INDEX UNIQUE SCAN                | PK_OPERATOR_GROUP               |
          |       |       |
    |  29 |    INDEX UNIQUE SCAN                | PK_OPERATOR_GROUP               |
          |       |       |
    PLAN_TABLE_OUTPUT
    Predicate Information (identified by operation id):
      10 - access("SYS_ALIAS_5"."WORKFLOW_NODE_TYPE_ID"=42)
      13 - access("SYS_ALIAS_5"."WORKFLOW_ID"="WORKFLOW_NODE"."WORKFLOW_ID")
      14 - access("WORKFLOW_NODE"."WORKFLOW_NODE_TYPE_ID"=17)
    PLAN_TABLE_OUTPUT
      16 - access("SYS_ALIAS_4"."U_PROTOCOL_ID"=TO_NUMBER("WORKFLOW_NODE"."PARAMETER
    _2"))
      18 - access("WORKFLOW_NODE"."WORKFLOW_ID"="WORKFLOW_NODE"."WORKFLOW_ID")
      20 - access("SYS_ALIAS_1"."TEST_TEMPLATE_ID"="WORKFLOW_NODE"."TEMPLATE")
      22 - access("SYS_ALIAS_2"."TEST_TEMPLATE_ID"="SYS_ALIAS_1"."TEST_TEMPLATE_ID")
      24 - access("SYS_ALIAS_3"."ALIQUOT_ID"="SYS_ALIAS_2"."ALIQUOT_ID")
    Note: rule based optimization

  • [SQL] inline view and order by on oracle 8.0.5

    Hi everyone.
    I am trying to sort data inside "inline view"
    on "Oracle8 Release 8.0.5.0.0 - Production".
    However, it did not work. Is this an oracle-bug?
    I got the oracle error , "ORA-00907".
    The sql script is like this:
    select ..............
    from (select ..... from .. where .... order by ...)
    where rownum <11
    However, the "exactly" same sql has no problem
    on "Oracle8i Enterprise Edition Release 8.1.7.0.0".
    Every response will be greatly appreciated.
    Thanks in advance.
    Ho.

    Order by cannot be used in a subquery while for inline view it is supported but in Oracle8i, release 8.1 and up
    Khurram

  • Oracle BUG (CASE + remote tables + inline view)

    Oracle 9.2.0.8
    BUG: Oracle inserts NULL when we use CASE statement in the SELECT query and we join a remote table with inline view.
    Script:
    CREATE TABLE t1 (a number(19,4)OK.
    SELECT (case when b = 1 then c else d end)
    FROM t2@Remote LEFT JOIN
    (SELECT a FROM t3@Remote) q ON (t2.a = q.a)123
    456
    789
    3 rows selected.
    INSERT INTO TABLE t1 (a)
    SELECT (case when b = 1 then c else d end)
    FROM t2@Remote LEFT JOIN
    (SELECT a FROM t3@Remote) q ON (t2.a = q.a)3 rows inserted.
    SELECT * FROM t1<null>
    <null>
    <null>
    3 rows selected
    Oracle inserts the correct values if I:
    * replace the CASE with DECODE
    * join with table not with an inline view
    * join local tables
    Someone with registration in the Metalink can post the bug.
    Best regards, Beroetz

    Oracle 9.2.0.8
    BUG: Oracle inserts NULL when we use CASE statement in the SELECT query and we join a remote table with inline view.
    Script:
    CREATE TABLE t1 (a number(19,4)OK.
    SELECT (case when b = 1 then c else d end)
    FROM t2@Remote LEFT JOIN
    (SELECT a FROM t3@Remote) q ON (t2.a = q.a)123
    456
    789
    3 rows selected.
    INSERT INTO TABLE t1 (a)
    SELECT (case when b = 1 then c else d end)
    FROM t2@Remote LEFT JOIN
    (SELECT a FROM t3@Remote) q ON (t2.a = q.a)3 rows inserted.
    SELECT * FROM t1<null>
    <null>
    <null>
    3 rows selected
    Oracle inserts the correct values if I:
    * replace the CASE with DECODE
    * join with table not with an inline view
    * join local tables
    Someone with registration in the Metalink can post the bug.
    Best regards, Beroetz

  • Query works everywhere but Flex: inline views not supported perhaps?

    EDIT2: Actually not. It turns out to be a bug in the way Adobe is treating any integer PK column, no matter how it is defined, INT, or INTEGER, as an alias for the rowid in SQlite.  This is incorrect. rowid does not always equal the PK value.  This causes joins to return the wrong values.
    EDIT: turns out to be the use of the absolute value function in the query.
    See http://forums.adobe.com/thread/516392
    My bread-and-butter query, the one that is the core of my application, uses a UNION query with inline views when doing proximity word-searches. It works beautifully in SQLite returning a resultset  in about one second from an over 300MB database, against several tables equijoined, the two biggest tables having close to 4 million rows and 300,000 rows, respectively.
    It runs fine in Visual Studio using the .NET provider for SQLite, and also in SQLite Manager 0.5.6 by Mrinal Kant and in other front-ends to SQLite. But the verbatim query returns no rows in Flex and zero rows in the SQLite Admin GUI front-end, which is built on the Flex SQL libraries.
    My first thought is that inline views might not be supported in Flex? 
    Does Flex do what in the Microsoft world is called a "pass-through" query, sending the sql intact through to the back end, or does Flex take the query statement apart and apply the WHERE clause conditions client-side, as Microsoft Access does to support so-called "heterogeneous" joins, i.e. queries that might join tables from, say, SQL Server and Oracle in the same query?

    EDIT2: Actually not. It turns out to be a bug in the way Adobe is treating any integer PK column, no matter how it is defined, INT, or INTEGER, as an alias for the rowid in SQlite.  This is incorrect. rowid does not always equal the PK value.  This causes joins to return the wrong values.
    EDIT: turns out to be the use of the absolute value function in the query.
    See http://forums.adobe.com/thread/516392
    My bread-and-butter query, the one that is the core of my application, uses a UNION query with inline views when doing proximity word-searches. It works beautifully in SQLite returning a resultset  in about one second from an over 300MB database, against several tables equijoined, the two biggest tables having close to 4 million rows and 300,000 rows, respectively.
    It runs fine in Visual Studio using the .NET provider for SQLite, and also in SQLite Manager 0.5.6 by Mrinal Kant and in other front-ends to SQLite. But the verbatim query returns no rows in Flex and zero rows in the SQLite Admin GUI front-end, which is built on the Flex SQL libraries.
    My first thought is that inline views might not be supported in Flex? 
    Does Flex do what in the Microsoft world is called a "pass-through" query, sending the sql intact through to the back end, or does Flex take the query statement apart and apply the WHERE clause conditions client-side, as Microsoft Access does to support so-called "heterogeneous" joins, i.e. queries that might join tables from, say, SQL Server and Oracle in the same query?

  • Difference between INLINE view and WITH clause

    Can anyone plz explain me about the performance difference between the below queries?
    Query using INLINE view:
    SELECT e.ename AS employee_name,
    dc.dept_count AS emp_dept_count
    FROM emp e,
    (SELECT deptno, COUNT(*) AS dept_count
    FROM emp
    GROUP BY deptno) dc
    WHERE e.deptno = dc.deptno;
    Query using WITH clause:
    WITH dept_count AS (
    SELECT deptno, COUNT(*) AS dept_count
    FROM emp
    GROUP BY deptno)
    SELECT e.ename AS employee_name,
    dc.dept_count AS emp_dept_count
    FROM emp e,
    dept_count dc
    WHERE e.deptno = dc.deptno;

    Here's another one:
    http://www.oracle-base.com/articles/misc/WithClause.php
    And, here on this forum you will see that the WITH-clause is heavily used by all of us in order to generate some sample data (when OP's don't care to post CREATE TABLE + INSERT INTO statements).
    The WITH clause enables you as well to 'pretend' you have a table and demonstrate a solution very quickly, without doing actual DDL .
    As for the performance difference:
    We would need to know your database version and many other things.
    See:
    HOW TO: Post a SQL statement tuning request - template posting
    for step by step instructions you can (and should) explore yourself.

  • Error -3000 in Oracle Explorer View while trying to add connection. v. 10.2

    I have been using Oracle 9.2 and it's cooresponding ODP.NET for ASP.NET web development. I am now started on a new project that is running on a 10g database. I figured I would try out the Visual Tools suite and get the benefit of using ODP.NET and the integrated tools.
    I run the installer and created a new home directory just like the release notes say. After I reboot I copy my TNS Names and try SQL plus from my 9.x version and it works perfectly I can connect to any server. I check my Oracle Home selector and it is pointing to the 10g client directory.
    The problem is that when I am in Visual Studio .NET 2003 and open the Oracle Explorer view and click Add Connection. I get the dialog box and select my database and use a username/password and click Test and I immediately get a "-3000" error message almost like it is not even going out on the network. It says some internal error (String) datatype but nothing useful at all in the error message to help in resolving the error.
    I did a search on the forums here and everyone says use the latest version which I would do but I am on the latest version (Downloaded Yesterday 10-19-2005). So to get back to work I uninstalled the 10g visual tools and I am using the 9.2 client using the 9.2 ODP.NET until I can find out what the issue is with the 10g tools.

    Just to give an update to help others if they may encounter this issue. I uninstalled the Oracle 9.x client and removed any traces even the Universal installer. Once you reboot and ensure that nothing anywhere is pointing to the oracle directory I even deleted the Oracle directory to ensure that it would be a clean install.
    I then proceeded to install the 10.2 Developer tools and used the default settings and when I finished the installation I copied my TNSNames over to the network directory and rebooted. I then launched VS.NET 2003 and went to Oracle Explorer and added a Database and did the test connection and it worked. So it appears to have an issue with an existing installation running side by side (9.x and 10.x) The 9.x install did have the ODP.NET library installed so this alone might have been the issue as I haven't seen in the docs were you can't have both on the same system as with .NET you aren't supposed to have this issue running multiple versions of the same .NET assembly on the same machine.
    What was wierd with the scenario is that other than ODP.NET on the 10g client install everything worked fine connecting using the command line tools. It just would not connect via Visual Studio .NET's environment. I didn't try to do it in code as I figured it would be just the same issue.

  • Does an inline view execute before the rest of the select?

    Hi,
    The O'Reilly book Mastering Oracle Sql defines an inline view simply as a
    subquery in a select FROM clause. This conforms to the definitions in
    the Oracle 9i and 10g docs.
    But unlike the Oracle docs, the O'Reilly book says the inline view is,
    like a WITH clause, executed before the rest of the query. I can't see
    how this can be done unless the inline view makes no reference to
    other tables joined in the FROM clause.
    Is there a species of inline view in 9i/10g that IS restricted as above -
    no refs to other tables in the FROM clause - and what is it called?
    Thanks for any help.
    Ken Quirici

    As explained above, Oracle can choose to merge the query if feasible to do so. Look at the two queries and their plans below. The plan in second query changes to creating a temporary VIEW since in that case, Oracle is unable to perform the merge:
    SQL> select *
      2          from scott.emp e,
      3                  (select * from scott.dept d where d.deptno = 10) dd
      4  where
      5          e.deptno = dd.deptno
      6  /
         EMPNO ENAME      JOB              MGR HIREDATE           SAL       COMM     DEPTNO     DEPTNO DNAME          LOC
          7782 CLARK      MANAGER         7839 09-JUN-1981       2450                    10         10 ACCOUNTING     NEW YORK
          7839 KING       PRESIDENT            17-NOV-1981       5000                    10         10 ACCOUNTING     NEW YORK
          7934 MILLER     CLERK           7782 23-JAN-1982       1300                    10         10 ACCOUNTING     NEW YORK
    3 rows selected.
    Execution Plan
    Plan hash value: 3570059291
    | Id  | Operation                    | Name           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT             |                |     3 |   171 |     2   (0)| 00:00:01 |
    |   1 |  NESTED LOOPS                |                |     3 |   171 |     2   (0)| 00:00:01 |
    |   2 |   TABLE ACCESS BY INDEX ROWID| DEPT           |     1 |    20 |     1   (0)| 00:00:01 |
    |*  3 |    INDEX UNIQUE SCAN         | PK_DEPT        |     1 |       |     0   (0)| 00:00:01 |
    |   4 |   TABLE ACCESS BY INDEX ROWID| EMP            |     3 |   111 |     1   (0)| 00:00:01 |
    |*  5 |    INDEX RANGE SCAN          | IDX_EMP_DEPTNO |     3 |       |     0   (0)| 00:00:01 |
    SQL> select *
      2          from scott.emp e,
      3                  (select * from scott.dept d where d.deptno = 10 and rownum > 0) dd
      4  where
      5          e.deptno = dd.deptno
      6  /
         EMPNO ENAME      JOB              MGR HIREDATE           SAL       COMM     DEPTNO     DEPTNO DNAME          LOC
          7782 CLARK      MANAGER         7839 09-JUN-1981       2450                    10         10 ACCOUNTING     NEW YORK
          7839 KING       PRESIDENT            17-NOV-1981       5000                    10         10 ACCOUNTING     NEW YORK
          7934 MILLER     CLERK           7782 23-JAN-1982       1300                    10         10 ACCOUNTING     NEW YORK
    3 rows selected.
    Execution Plan
    Plan hash value: 1670713873
    | Id  | Operation                       | Name           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                |                |     5 |   280 |     2   (0)| 00:00:01 |
    |   1 |  NESTED LOOPS                   |                |     5 |   280 |     2   (0)| 00:00:01 |
    |   2 |   VIEW                          |                |     1 |    19 |     1   (0)| 00:00:01 |
    |   3 |    COUNT                        |                |       |       |            |          |
    |*  4 |     FILTER                      |                |       |       |            |          |
    |   5 |      TABLE ACCESS BY INDEX ROWID| DEPT           |     1 |    20 |     1   (0)| 00:00:01 |
    |*  6 |       INDEX UNIQUE SCAN         | PK_DEPT        |     1 |       |     0   (0)| 00:00:01 |
    |   7 |   TABLE ACCESS BY INDEX ROWID   | EMP            |     5 |   185 |     1   (0)| 00:00:01 |
    |*  8 |    INDEX RANGE SCAN             | IDX_EMP_DEPTNO |     5 |       |     0   (0)| 00:00:01 |
    SQL> disconnect
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL>
    can it, in it's WHERE clause, reference other tables in the FROM clause?No. it cannot. but as said above, tha may not stop Oracle from merging the queries.
    SQL> select *
      2          from scott.emp e,
      3                  (select * from scott.dept d where d.deptno = 10 and e.sal > 1000) dd
      4  where
      5          e.deptno = dd.deptno
      6  /
                    (select * from scott.dept d where d.deptno = 10 and e.sal > 1000) dd
    ERROR at line 3:
    ORA-00904: "E"."SAL": invalid identifier
    SQL>

  • Projection problem in OracleAS Map Viewer

    Hi,
    I am using OracleAS Map Viewer 11 EA1and I try to display a map with an image (srid=1002000) and a vector (srid=8192) on the top. If I understand the documentation correctly, the vector might be reprojected into the map srid which is 1002000. But when the map is created, the vector is not correctly reprojected (I see some roads in the ocean!). I am wandering if it is a bug in map viewer; or maybe I didn't use it corectly!
    My query looks like:
    <map_request
    title=""
    datasource="all_images"
    width="1229"
    height="840"
    srid="1002000"
    antialiase="false"
    format="PNG_URL">
    <center size="7865.9766">
    <geoFeature>
    <geometricProperty typeName="center">
    <Point>
    <coordinates>
    1230462.1 , -582145.4
    </coordinates>
    </Point>
    </geometricProperty>
    </geoFeature>
    </center>
    <themes>
    <theme name="mosaic_pan'"
    min_scale="5000000.0"
    max_scale="0.0">
    <jdbc_georaster_query
    jdbc_srid="1002000"
    datasource="all_images"
    georaster_table="mosaic.mosaic_pan"
    georaster_column="georaster"
    asis="false">
         select georaster from mosaic.mosaic_pan where rowid='AAANn1AAKAAAAAKAAA'
              </jdbc_georaster_query>
    </theme>
    <theme name="road_l" min_scale="10000.0" max_scale="0.0">
    <jdbc_query
    datasource="all_images"
              jdbc_srid="8192"
    render_style="MDSYS:L.MAJOR STREET"
    spatial_column="shape1"
    >select shape1 from can51.road_l</jdbc_query>
    </theme>
    </themes>
    </map_request>
    Thanks in advance,
    Ganael

    your map request seems correct, and yes mapviewer will automatically reproject your vector theme if it's srid (8192) is different from the request srid (1002000). What's more likely is that your georaster is not being displayed correctly? Have you tried displaying the vector road data against a know vector boundary data set like country/state, in the 1002000 projection and see if everything is working fine? then add the georaster layer back on and go from there....

  • Can You Explain This SQL Query - Inline View Included

    The query is taken from "Oracle Database 10g: SQL Fundamentals II" page 3-7 (chapter 3)
    I do not fully understand the following query:
    SELECT a.last_name, a.salary, a.department_id, b.salavg
    FROM   employees a, (SELECT   department_id,
    AVG(salary) salavg
    FROM     employees
    GROUP BY department_id) b
    WHERE  a.department_id = b.department_id
    AND    a.salary > b.salavg;
    The inline view can return several records. Can you please tell me in step by step how does this work. I understand the concept of join tables and aliases, etc. I just need to know the mechanism of this code.
    Thanks

    user11164565 wrote:
    The query is taken from "Oracle Database 10g: SQL Fundamentals II" page 3-7 (chapter 3)
    I do not fully understand the following query:
    SELECT a.last_name, a.salary, a.department_id, b.salavg
    FROM   employees a, (SELECT   department_id,
    AVG(salary) salavg
    FROM     employees
    GROUP BY department_id) b
    WHERE  a.department_id = b.department_id
    AND    a.salary > b.salavg;
    The inline view can return several records. Can you please tell me in step by step how does this work. I understand the concept of join tables and aliases, etc. I just need to know the mechanism of this code.
    The query is returning the last name, salary , department and average salary of all the departments where salary is greater than the average salary.
    HTH
    Aman....

  • Configurable Code-list not Extendable in Fine-Tuning.

    Hi
    I am facing some problems while changing the values in Code-list while using fine tuning process in Configuration. I have created three code-lists and then being added to configuration using BAC.
    In this BAC I have created one business Topic and three separate business options. Each business option is linked with each bcc (business Configuration Set).
    Now when I go to and “Edit project scope” I am able to get the code list on my UI using extension fields and values are there too. But the problem I am facing is that in “Open Activity list” when I open the Business Options NOT all the options are opening properly.
    Although I have got some of them opening fine and let me make changes while others are showing errors.
    Any Advice Please.
    Many thanks in Advance.
    Regards
    Asad

    Yes i have regenerated now and still the same problem is there.
    Yes the flag has been selected in the BC SET.
    in Fine tuning there is slight difference in BOTH BC views.
    One with normal behavior only shows the code in code list while the one with Issues/Problems is showing code & Description in same CODE column while some Times it does show only code though?? 
    Any guess here?
    Regards
    Asad

  • Few Methods of fine tuning query

    I want to know few methods of fine tuning the query

    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96533/toc.htm

  • Oracle.adf.view.rich.context.ExceptionHandler is not working properly

    Hi,
    I am using Jdev 11.1.2.0.0 and weblogic server (10.3.5).
    I have overridden oracle.adf.view.rich.context.ExceptionHandler class and registered under ADF Meta-INF/services folder. when I am deploying in the local machine it is working fine, but in production mode it is not catching the Faces(UI) level exceptions.
    Please let me know any configuration have I missed in Production server or not?

    +"So don't go for this solution to quickly and always think of alternative solutions. Sometimes a try-catch-final block does it better than sophisticated web exception handling. "+
    https://blogs.oracle.com/jdevotnharvest/entry/extending_the_adf_controller_exception_handler
    :-)

Maybe you are looking for