LogPhysical Query on 11g

Hi,
Because of the bug we can not see the physical query from Administrator sessions, dose anyone know how to check this log from backend (linux)?

Hi nila,
NQquery log file shows only Physical SQL Query, logical execution plan of the last run report not all the reports at a time.The path is as follows C:\Middleware\instances\instance1\diagnostics\logs\OracleBIServerComponent\coreapplication_obis1\nqquery.log
UPDATED POST
Your question was not this before,anyways if you want to check in Linux box also open your putty or command prompt and go to the path mentioned above and then view the Nqquery.log
ex:- cd C:\Middleware\instances\instance1\diagnostics\logs\OracleBIServerComponent\coreapplication_obis1\nqquery.log
next step -> vi nqquery.log
which will show the file in notepad....there you can see the query.
Mark points.
Cheers,
KK
Edited by: Kranthi on Jan 31, 2011 3:00 AM

Similar Messages

  • Very slow simple spatial query on 11g

    I've created two spatial tables as following:
    CREATE TABLE usregions
    region_code NUMBER(1,0) NOT NULL,
    shape ST_GEOMETRY,
    CONSTRAINT usregions_pk PRIMARY KEY usregions(region_code)
    INSERT INTO MDSYS.user_sdo_geom_metadata
    (table_name, column_name, diminfo, srid)
    VALUES ('USREGIONS', 'SHAPE',
    sdo_dim_array (sdo_dim_element ('X', -180, 180, 0.5),
    sdo_dim_element ('Y', -90, 90, 0.5)),
    4269);
    CREATE INDEX usregions_dx ON usregions (shape)
    INDEXTYPE IS MDSYS.spatial_index;
    CREATE TABLE usstates
    state_code NUMBER(1,0) NOT NULL,
    state_name VARCHAR2(30),
    shape ST_GEOMETRY,
    CONSTRAINT usstates_pk PRIMARY KEY usstates(state_code)
    INSERT INTO MDSYS.user_sdo_geom_metadata
    (table_name, column_name, diminfo, srid)
    VALUES ('USSTATES', 'SHAPE',
    sdo_dim_array (sdo_dim_element ('X', -180, 180, 0.5),
    sdo_dim_element ('Y', -90, 90, 0.5)),
    4269);
    CREATE INDEX usstates_dx ON usstates (shape)
    INDEXTYPE IS MDSYS.spatial_index;
    I then loaded both tables with data from a shapefile.
    The state shapefile is just the US map with all the states.
    The region shapefile is the same US map with only 5 regions (Northeast, mid atlantic, mid west, south, and west).
    I created the region shapefile from the state shapefile using ESRI ArcMap to dissolve the States border. So Pennsylvania, Virginia, Maryland, and DC is one polygon; New York and up is another polygon, etc.
    I also created the same two tables, with the same data in SQL Server 2008 (KatMai), as well as in PostGRE 8.3.
    Then I ran the following query:
    SELECT s.state_name
    FROM usstates s
    WHERE s.shape.ST_Within((SELECT shape
    FROM usregions
    WHERE region_code=2))=1;
    Region 2 is Mid Atlantic and I was expecting to see:
    STATE_NAME
    District of Columbia
    Maryland
    Pennsylvania
    Virgina
    Instead, Oracle 11g only returned "District of Columbia"
    The query took 6.4 seconds to run.
    On SQL Server 2008, I got the expected result and it took 0.4 seconds to execute.
    On PostGRE 8.3, I also got the expected result and it took 0.5 seconds to execute.
    Why is Oracle not returning all the States? Is this a bug?
    Am I doing something wrong???
    Thanks.

    save data into internal backup format ???backup format doesn't matter, program is just reading rows from backup file and inserting them into database - so is generating SQL insert commands
    >
    and then it will restore it back to database. It isdone by inserts, each 500 row commit
    I can't follow your post, but...yuck.program is just inserting records into T2 table, but on T2 table is trigger and inside trigger is SQL command "UPDATE TABLE T3 ..... where ......". In this time is T3 already filled with 60569 records.
    And inserting going slower and slower. Without trigger is speed ok. But on oracle 10g speed is ok with this trigger. So I am concern about what could changed in oracle 11g and cause such behavior.
    I will try produce some simple test example

  • Issue in executing contains Query(Oracle 11g Enterprise E on Linux RHEL 4

    Oracle Version: 11.1.0.6.0
    We are facing problem in executing contains Query :
    1.When length of string inside contains clause goes beyond 4000 it gives error ORA-01704: string literal too long
    2.We try to modify query by breaking it into multiple contains clause but it was not giving good performance (performance degrades as number of contains clauses increases.)It seems accessing same index multiple times becoming costly and taking more time. (We can see same domain Index has been accessed 3 times for 3 contains clause ()
    3.We used multiple varchar(4000) type bind variable in single contains clause but giving error
         ORA-29902: error in executing ODCIIndexStart() routine
         ORA-01489: result of string concatenation is too long
    4.We used bind variable of type clob but giving error
    Error:
    ORA-29902: error in executing ODCIIndexStart() routine
         ORA-20000: Oracle Text error:
         DRG-50857: oracle error in drexrstart_clob
    I read from article
    http://www.oracle.com/technology/products/text/pdf/ot11g_new_features.pdf
    That we don’t need to modified query as we had to do with SDATA(as we are doing in above examples) and optimizer will realize that query can be satisfied by the text index and will “push down” the filtering of rows into the text index processor rather than doing table access for filtering on sdata column but when I tried to write that query it was doing table access to filter for filter by column.
    My Questions:
    a.     Is it possible as mentioned in above point(point number 5) that we don’t need to write SDATA query in contains clause and optimizer will use composite index automatically.
    b.     Is there any workaround for using string literal > 4000 char in contains clause.
    c.     Why performance degrades lineally when using multiple contains clause.
    d.     Can we use in clause in SDATA and write query like this:
    i.     SDATA(queryid in ( 'q1',’q2’))
    /* Table */
    create table ContentStore (ResourceID raw(16), QueryID VARCHAR2(38),IFID VARCHAR2(38),ISTimeStamp number,ISProtocolName VARCHAR2(100),ismimecontenttype varchar2(100),ISToBeDisplayed number(1),IndexedMetaText CLOB)
    /* Index */
    create index idxMeta on ContentStore (IndexedMetaText) indextype is ctxsys.context filter by queryid,IFID,istimestamp,isprotocolname,ismimecontenttype,resourceid,istobedisplayed order by istimestamp desc parameters('filter ctxsys.null_filter section group GRP_system2 sync(every "sysdate+1/(24*4)" MEMORY 209715200 PARALLEL 2) storage my_text_storage memory 209715200')parallel 2
    /* GRP_system2*/
    begin
    ctx_ddl.create_section_group('GRP_system2', 'BASIC_SECTION_GROUP');
    ctx_ddl.add_field_section('GRP_system2', 'FILENAME', 'FILENAME');
    ctx_ddl.add_field_section('GRP_system2', 'ISIPSrcIP', 'ISIPSrcIP');
    ctx_ddl.add_field_section('GRP_system2', 'ISProxyUserIP', 'ISProxyUserIP');
    ctx_ddl.add_field_section('GRP_system2', 'isipdestip', 'isipdestip');
    end;
    /* 1.When length of string inside contains clause goes beyond 4000 it gives
         error ORA-01704: string literal too long */
    select indexedmetatext from ContentStore where rowid in ( select oraclerowid from ( select rowid as oraclerowid from ContentStore where contains(indexedmetatext,'((68.142.91.152 within isipsrcip) or (68.142.91.152 within isproxyuserip) or (68.142.91.152 within isipdestip)) and ((sdata(queryid = ''a51f216a-b211-4b59-89d4-6fcce58a8517'')) or (sdata(queryid = ''c7d7fdb3-e532-42f1-a8b4-450771fc763f'')) or (sdata(queryid = ''7746f95a-01ba-4318-991a-35c2a8a0c73d'')) or (sdata(queryid = ''b0d339d2-ada9-485b-b752-79920a589340'')) or (sdata(queryid = ''33083cc8-7ed0-4a67-81f0-de1f3d673db2'')) or (sdata(queryid = ''0475dea9-288b-4be6-815e-751c98c25f2b'')) or (sdata(queryid = ''8cfb62f4-2bac-4da6-a2c2-84e409f5a810'')) or (sdata(queryid = ''afbf17a7-4170-45f4-9b66-de3860de93d7'')) or (sdata(queryid = ''750a7b1c-db61-4f87-b78f-505bc73aa5df'')) or (sdata(queryid = ''debc06f3-51a8-4278-9d38-f316dfb6340c'')) or (sdata(queryid = ''d2d8d8a8-b691-439f-b6de-618825aad152'')) or (sdata(queryid = ''f6a3515a-4c7b-48d0-8d46-f62541525cd0'')) or (sdata(queryid = ''bef5c527-5e78-494f-832c-12b3967f22cc'')) or (sdata(queryid = ''638a4029-c4bf-42ef-87bc-2cd4a3977dd1'')) or (sdata(queryid = ''1ce38c22-fd80-4d0f-b9ab-1a09941c5809'')) or (sdata(queryid = ''7bbbcc66-f19d-4758-bdd8-2796da1e26fe'')) or (sdata(queryid = ''d3e96050-ab5e-48b7-9445-d884167c8ae9'')) or (sdata(queryid = ''eaf93ce1-fbd8-4bb6-9fb1-12c337878c72'')) or (sdata(queryid = ''ef1ce7ce-9b4a-4f10-9c91-7256f513c709'')) or (sdata(queryid = ''46bf5cda-ada3-41f2-92b0-174ac29c5808'')) or (sdata(queryid = ''59136e92-147f-41c4-ac75-79d921268714'')) or (sdata(queryid = ''fb2382b2-6496-4c9f-a427-2f6db3b9fd16'')) or (sdata(queryid = ''531b3790-ed50-4b83-a0d0-eabfed2b6701'')) or (sdata(queryid = ''4908b148-2432-4041-947c-31ff8e10646c'')) or (sdata(queryid = ''82007d26-d526-42c9-a8d0-5b75e7f08b90'')) or (sdata(queryid = ''002735e8-6886-4bb4-a732-8a9d04165837'')) or (sdata(queryid = ''43f25cba-1d90-4cc2-84d1-a8719c5b1c9f'')) or (sdata(queryid = ''99d9027f-948b-4bc7-9a44-3092d6b29580'')) or (sdata(queryid = ''24221285-ea64-4e14-8c08-a173ec1b7fd9'')) or (sdata(queryid = ''47ad81d7-75cb-4787-91ab-c2bc5c5e1aaa'')) or (sdata(queryid = ''4ff2846f-6d70-4f9b-a5bf-317263c0ccc5'')) or (sdata(queryid = ''c1f5fbe7-72d1-499d-8d72-4aa21a79c97e'')) or (sdata(queryid = ''356f12c5-a769-478d-b57b-8a063be8ee8e'')) or (sdata(queryid = ''f6181853-2e16-4bce-88c0-6602bc853935'')) or (sdata(queryid = ''890f80e9-f3dd-4862-a55c-4f76569df360'')) or (sdata(queryid = ''5e9df138-8377-4841-92de-49bf6ed378a5'')) or (sdata(queryid = ''600b4dfd-e379-4754-8d06-873b593dbd14'')) or (sdata(queryid = ''af1476ac-3742-4272-bc97-584b1bbe3e2b'')) or (sdata(queryid = ''c2eb4e4c-2d09-4be8-b6ba-f1440349ed5a'')) or (sdata(queryid = ''2b819cdb-0941-48fd-8b93-dd1f661933b3'')) or (sdata(queryid = ''dfa094c9-c48c-4ca1-ad06-ead4f1a9d146'')) or (sdata(queryid = ''b1222061-acaf-4e85-80e1-00af07df962c'')) or (sdata(queryid = ''219b0c7b-266e-455b-b7ca-4f760976253c'')) or (sdata(queryid = ''2396f1e3-28f8-451b-a114-29390cec0cf3'')) or (sdata(queryid = ''c7d7fdb3-e532-42f1-a8b4-450771fc763f'')) or (sdata(queryid = ''7746f95a-01ba-4318-991a-35c2a8a0c73d'')) or (sdata(queryid = ''b0d339d2-ada9-485b-b752-79920a589340'')) or (sdata(queryid = ''33083cc8-7ed0-4a67-81f0-de1f3d673db2'')) or (sdata(queryid = ''0475dea9-288b-4be6-815e-751c98c25f2b'')) or (sdata(queryid = ''8cfb62f4-2bac-4da6-a2c2-84e409f5a810'')) or (sdata(queryid = ''afbf17a7-4170-45f4-9b66-de3860de93d7'')) or (sdata(queryid = ''750a7b1c-db61-4f87-b78f-505bc73aa5df'')) or (sdata(queryid = ''debc06f3-51a8-4278-9d38-f316dfb6340c'')) or (sdata(queryid = ''d2d8d8a8-b691-439f-b6de-618825aad152'')) or (sdata(queryid = ''f6a3515a-4c7b-48d0-8d46-f62541525cd0'')) or (sdata(queryid = ''bef5c527-5e78-494f-832c-12b3967f22cc'')) or (sdata(queryid = ''638a4029-c4bf-42ef-87bc-2cd4a3977dd1'')) or (sdata(queryid = ''1ce38c22-fd80-4d0f-b9ab-1a09941c5809'')) or (sdata(queryid = ''7bbbcc66-f19d-4758-bdd8-2796da1e26fe'')) or (sdata(queryid = ''d3e96050-ab5e-48b7-9445-d884167c8ae9'')) or (sdata(queryid = ''eaf93ce1-fbd8-4bb6-9fb1-12c337878c72'')) or (sdata(queryid = ''ef1ce7ce-9b4a-4f10-9c91-7256f513c709'')) or (sdata(queryid = ''46bf5cda-ada3-41f2-92b0-174ac29c5808'')) or (sdata(queryid = ''59136e92-147f-41c4-ac75-79d921268714'')) or (sdata(queryid = ''fb2382b2-6496-4c9f-a427-2f6db3b9fd16'')) or (sdata(queryid = ''531b3790-ed50-4b83-a0d0-eabfed2b6701'')) or (sdata(queryid = ''2396f1e3-28f8-451b-a114-29390cec0cf3''))) and (sdata(istobedisplayed = 1)) and (sdata(istimestamp >= 1245283200)) and (sdata(istimestamp < 1245369600)) and ((sdata(IFID = ''1eeb7036-cd84-4e4d-be90-e720c7db4470'')))') > 0
    order by istimestamp desc ) where rownum <= 250)
    /* 2.We try to modify query by breaking it into multiple contains clause but it was not giving good performance (performance degrades as number of contains clauses increases.)
    Problem: - Performance of below query degrades linearly as number of contains clause for same column increases.
    Execution plan :
    It seems accessing same index multiple times becoming costly and taking more time. (We can see same domain Index has been accessed 3 times for 3 contains clause ()
    select indexedmetatext from ContentStore where rowid in ( select oraclerowid from ( select rowid as oraclerowid from ContentStore where
    contains(indexedmetatext,'((68.142.91.152 within isipsrcip) or (68.142.91.152 within isproxyuserip) or (68.142.91.152 within isipdestip)) and ((sdata(queryid = ''a51f216a-b211-4b59-89d4-6fcce58a8517'')) or (sdata(queryid = ''c7d7fdb3-e532-42f1-a8b4-450771fc763f'')) or (sdata(queryid = ''7746f95a-01ba-4318-991a-35c2a8a0c73d'')) or (sdata(queryid = ''b0d339d2-ada9-485b-b752-79920a589340'')) or (sdata(queryid = ''33083cc8-7ed0-4a67-81f0-de1f3d673db2'')) or (sdata(queryid = ''0475dea9-288b-4be6-815e-751c98c25f2b'')) or (sdata(queryid = ''8cfb62f4-2bac-4da6-a2c2-84e409f5a810'')) or (sdata(queryid = ''afbf17a7-4170-45f4-9b66-de3860de93d7'')) or (sdata(queryid = ''750a7b1c-db61-4f87-b78f-505bc73aa5df'')) or (sdata(queryid = ''debc06f3-51a8-4278-9d38-f316dfb6340c'')) or (sdata(queryid = ''d2d8d8a8-b691-439f-b6de-618825aad152'')) or (sdata(queryid = ''f6a3515a-4c7b-48d0-8d46-f62541525cd0'')) or (sdata(queryid = ''bef5c527-5e78-494f-832c-12b3967f22cc'')) or (sdata(queryid = ''638a4029-c4bf-42ef-87bc-2cd4a3977dd1'')) or (sdata(queryid = ''1ce38c22-fd80-4d0f-b9ab-1a09941c5809'')) or (sdata(queryid = ''7bbbcc66-f19d-4758-bdd8-2796da1e26fe'')) or (sdata(queryid = ''d3e96050-ab5e-48b7-9445-d884167c8ae9'')) or (sdata(queryid = ''eaf93ce1-fbd8-4bb6-9fb1-12c337878c72'')) or (sdata(queryid = ''ef1ce7ce-9b4a-4f10-9c91-7256f513c709'')) or (sdata(queryid = ''46bf5cda-ada3-41f2-92b0-174ac29c5808'')) or (sdata(queryid = ''59136e92-147f-41c4-ac75-79d921268714'')) or (sdata(queryid = ''fb2382b2-6496-4c9f-a427-2f6db3b9fd16'')) or (sdata(queryid = ''531b3790-ed50-4b83-a0d0-eabfed2b6701'')) or (sdata(queryid = ''4908b148-2432-4041-947c-31ff8e10646c'')) or (sdata(queryid = ''82007d26-d526-42c9-a8d0-5b75e7f08b90'')) or (sdata(queryid = ''002735e8-6886-4bb4-a732-8a9d04165837'')) or (sdata(queryid = ''43f25cba-1d90-4cc2-84d1-a8719c5b1c9f'')) or (sdata(queryid = ''99d9027f-948b-4bc7-9a44-3092d6b29580'')) or (sdata(queryid = ''24221285-ea64-4e14-8c08-a173ec1b7fd9'')) or (sdata(queryid = ''47ad81d7-75cb-4787-91ab-c2bc5c5e1aaa'')) or (sdata(queryid = ''4ff2846f-6d70-4f9b-a5bf-317263c0ccc5'')) or (sdata(queryid = ''c1f5fbe7-72d1-499d-8d72-4aa21a79c97e'')) or (sdata(queryid = ''356f12c5-a769-478d-b57b-8a063be8ee8e'')) or (sdata(queryid = ''f6181853-2e16-4bce-88c0-6602bc853935'')) or (sdata(queryid = ''890f80e9-f3dd-4862-a55c-4f76569df360'')) or (sdata(queryid = ''5e9df138-8377-4841-92de-49bf6ed378a5'')) or (sdata(queryid = ''600b4dfd-e379-4754-8d06-873b593dbd14'')) or (sdata(queryid = ''af1476ac-3742-4272-bc97-584b1bbe3e2b'')) or (sdata(queryid = ''c2eb4e4c-2d09-4be8-b6ba-f1440349ed5a'')) or (sdata(queryid = ''2b819cdb-0941-48fd-8b93-dd1f661933b3'')) or (sdata(queryid = ''dfa094c9-c48c-4ca1-ad06-ead4f1a9d146'')) or (sdata(queryid = ''b1222061-acaf-4e85-80e1-00af07df962c'')) or (sdata(queryid = ''219b0c7b-266e-455b-b7ca-4f760976253c'')) or (sdata(queryid = ''2396f1e3-28f8-451b-a114-29390cec0cf3''))) and (sdata(istobedisplayed = 1)) and (sdata(istimestamp >= 1245283200)) and (sdata(istimestamp < 1245369600)) and ((sdata(IFID = ''1eeb7036-cd84-4e4d-be90-e720c7db4470'')))') > 0
    or
    contains(indexedmetatext,'((68.142.91.152 within isipsrcip) or (68.142.91.152 within isproxyuserip) or (68.142.91.152 within isipdestip)) and ((sdata(queryid = ''f22c0b85-2e72-4450-92b7-8f9864c2517a'')) or (sdata(queryid = ''dbc6111b-5fef-4925-93f0-ecf94aa2305b'')) or (sdata(queryid = ''5d737150-3c55-4582-8b2e-8039615b8e69'')) or (sdata(queryid = ''fc8bf42c-2c7a-4506-aa3a-89266ef09ceb'')) or (sdata(queryid = ''7d3f7561-ba99-49fd-9492-214d9f571831'')) or (sdata(queryid = ''73110ce8-6930-4044-90f7-9c5d27bc0b10'')) or (sdata(queryid = ''d1c975a6-607d-4334-a84c-cc63f68bda3a'')) or (sdata(queryid = ''11fd0d2a-540d-4de0-852a-75f1b841b262'')) or (sdata(queryid = ''0dbfd826-497e-4283-8fc6-210c631c4a3e'')) or (sdata(queryid = ''eb2fd3d3-3b14-4092-a373-edd5448802c2'')) or (sdata(queryid = ''a3b69f62-560b-4883-8bd8-d8225af075b4'')) or (sdata(queryid = ''8596dc3e-c062-4527-9df6-e2c6aa10187d'')) or (sdata(queryid = ''5ce0dea4-b005-4185-9a05-7e91f14c7a8a'')) or (sdata(queryid = ''27eb925f-6f0c-4e27-9b57-91d78de703df'')) or (sdata(queryid = ''53b63124-caf4-4e71-ac5b-0e323d2805cb'')) or (sdata(queryid = ''f3dea938-a547-4510-8c24-25e04fa11ec4'')) or (sdata(queryid = ''5d8ebe7d-224b-4731-a1f2-ef1e3b409579'')) or (sdata(queryid = ''69c8dc53-031a-4069-a9e5-89f28cb7a7e0'')) or (sdata(queryid = ''2f65dc5e-63f6-4904-95f8-94c8983931a9'')) or (sdata(queryid = ''9ce16005-5b3b-4691-a624-5a7835e9e982'')) or (sdata(queryid = ''e5f133c5-f8d3-4905-b4db-ceba89476e7d'')) or (sdata(queryid = ''27dd1a53-a158-46ea-b38d-31a57bd7154e'')) or (sdata(queryid = ''cc335826-5e5e-4d4c-9406-2050717bea5d'')) or (sdata(queryid = ''e1ca6d4d-0005-43ec-a121-5574b37231ec'')) or (sdata(queryid = ''4be550f1-8e0a-4748-8186-50228531751d'')) or (sdata(queryid = ''8637ff63-3d0d-4451-9e40-b890d197f6cd'')) or (sdata(queryid = ''5f664e9e-b72f-4ae7-b69d-081ab7873146'')) or (sdata(queryid = ''baecc6fb-e9cf-41df-9fa4-1793b510d474'')) or (sdata(queryid = ''fa27ba4c-4ab8-4bd0-8725-a03c4666dcde'')) or (sdata(queryid = ''918bfb52-7323-4046-b96a-4ef905687dbb'')) or (sdata(queryid = ''3faad930-81c6-421b-84aa-81a9cfdc2c8b'')) or (sdata(queryid = ''7dc5033d-3a27-4058-885a-d103e73328f2'')) or (sdata(queryid = ''8eb4a0ce-654b-42f0-a868-7f7fdb483a13'')) or (sdata(queryid = ''1b44713f-6cbf-4b49-b851-5a500b221c27'')) or (sdata(queryid = ''11febb09-9106-4b92-a43d-cb71696adc90'')) or (sdata(queryid = ''1d84ca10-375e-4e17-a1c0-03515e1cfe5b'')) or (sdata(queryid = ''9cf1f3fd-136c-4abb-8319-6f6c6ddc514c'')) or (sdata(queryid = ''24f5347a-ff20-4245-a4dc-eb2f8c918c91'')) or (sdata(queryid = ''2640ef3c-8a20-4f28-92df-0bc19b058d91'')) or (sdata(queryid = ''af3d0817-0d40-4adb-9655-a5460805a7eb'')) or (sdata(queryid = ''77b86c41-3afc-4c9c-9432-d7a1ee979af2'')) or (sdata(queryid = ''2a26f0d8-1162-4f34-be48-65b409abef28'')) or (sdata(queryid = ''649810b8-0d7b-47ab-8433-8e9bba88583d'')) or (sdata(queryid = ''c4f853ef-cd7c-436d-a16d-03d49681bee6'')) or (sdata(queryid = ''5c1896ce-06af-406c-bfbd-40d2349171bd'')) or (sdata(queryid = ''8d9fe822-f720-4ee5-a80d-552edd778f82'')) or (sdata(queryid = ''f30220c6-5638-47ec-ad98-4768ee299232'')) or (sdata(queryid = ''3faf5d0b-e3c0-4b68-8244-e07334c17326''))) and (sdata(istobedisplayed = 1)) and (sdata(istimestamp >= 1245283200)) and (sdata(istimestamp < 1245369600)) and ((sdata(IFID = ''1eeb7036-cd84-4e4d-be90-e720c7db4470'')))') > 0
    or
    contains(indexedmetatext,'((68.142.91.152 within isipsrcip) or (68.142.91.152 within isproxyuserip) or (68.142.91.152 within isipdestip)) and ((sdata(queryid = ''c3662b10-98fc-453d-86e1-0c81fe3bb038'')) or (sdata(queryid = ''2b4e7f6e-7871-45eb-b046-bfd4f5d2d84c'')) or (sdata(queryid = ''5af44897-0bc9-4307-bcb1-7f07750e1e25'')) or (sdata(queryid = ''2b57feb3-1681-48db-9856-5d23d69de605'')) or (sdata(queryid = ''47c3939e-d46d-4c7f-9a42-305634642a72'')) or (sdata(queryid = ''476a04ad-6be3-459b-8ab1-6e270416add6'')) or (sdata(queryid = ''61be42b4-11d6-4ff9-a06d-e896690d7fd4'')) or (sdata(queryid = ''97a00e72-2e7d-4c02-b41b-d9d1601bc08c'')) or (sdata(queryid = ''8739fefa-c015-4912-999e-cd9524dffedb'')) or (sdata(queryid = ''61054068-5892-4aaf-ab31-9e6301de9808'')) or (sdata(queryid = ''741a5302-aadc-4bf2-bdcf-b41e95b49d05'')) or (sdata(queryid = ''c13d9ec0-2b18-4838-9bdb-ddb0686fd1d5'')) or (sdata(queryid = ''b02a2176-0ba5-47f4-843d-3d54e3faad77'')) or (sdata(queryid = ''451b906e-3a5c-4ed2-9d94-0a603e6ad94d'')) or (sdata(queryid = ''d1c767d7-cd0a-44c5-a8ff-ce5fa4522ece'')) or (sdata(queryid = ''ca71a03e-26c6-43f3-9755-a248ebaf35b5'')) or (sdata(queryid = ''d93777b8-f03b-49b0-94fc-8019b52c0637'')) or (sdata(queryid = ''e05ebc73-51cb-4112-b685-5104c4884020'')) or (sdata(queryid = ''a1b342c7-9ce0-4aa1-96e8-74621b34d411'')) or (sdata(queryid = ''bde5de4a-b1d4-4edd-9033-6bcba45fcfc2'')) or (sdata(queryid = ''1e345627-c639-4349-95d0-fdfe348935df'')) or (sdata(queryid = ''bd33b778-83c1-4610-a767-f8ce2ade5339'')) or (sdata(queryid = ''54eaa539-e50a-4e95-8d94-f7e95cf0f57b'')) or (sdata(queryid = ''3181ef7a-77cd-405f-9dfa-1c13444efb82'')) or (sdata(queryid = ''0a72bf53-c8ca-405f-9098-9383ed02815a'')) or (sdata(queryid = ''2fb2fff2-b240-46a6-99b8-00521b4325e4'')) or (sdata(queryid = ''5321fa18-a88d-45cb-b8d6-383180cb308b'')) or (sdata(queryid = ''f13bcfdf-d61f-4871-9c74-23ea58204cbb'')) or (sdata(queryid = ''eb5188da-3659-4e7a-b9e4-6985624c3867'')) or (sdata(queryid = ''1679a0ee-6fa7-4c5b-9e0f-09512bc6a74b'')) or (sdata(queryid = ''fd05f61b-5c63-4f99-975e-573ca0f68e8e'')) or (sdata(queryid = ''10802bc7-28bd-43d4-aa24-cf5f9cf6d19f'')) or (sdata(queryid = ''302dbebf-4edd-43a8-93e9-dd6faec8ff14'')) or (sdata(queryid = ''573020da-b5c1-489a-a7d9-eae363e535ef'')) or (sdata(queryid = ''ca514f9e-f4b9-42eb-a8b3-57a384e65540''))) and (sdata(istobedisplayed = 1)) and (sdata(istimestamp >= 1245283200)) and (sdata(istimestamp < 1245369600)) and ((sdata(IFID = ''1eeb7036-cd84-4e4d-be90-e720c7db4470'')))') > 0
    order by istimestamp desc ) where rownum <= 250)
    /* 3.We used multiple varchar(4000) type bind variable in single contains clause but giving error
         ORA-29902: error in executing ODCIIndexStart() routine
         ORA-01489: result of string concatenation is too long
         variable querystring1 varchar2(4000);
    exec :querystring1 := '((sdata(queryid = ''a51f216a-b211-4b59-89d4-6fcce58a8517'')) or (sdata(queryid = ''d1c975a6-607d-4334-a84c-cc63f68bda3a'')) or(sdata(queryid = ''11fd0d2a-540d-4de0-852a-75f1b841b262'')) or(sdata(queryid = ''0dbfd826-497e-4283-8fc6-210c631c4a3e'')) or(sdata(queryid = ''eb2fd3d3-3b14-4092-a373-edd5448802c2'')) or(sdata(queryid = ''a3b69f62-560b-4883-8bd8-d8225af075b4'')) or(sdata(queryid = ''8596dc3e-c062-4527-9df6-e2c6aa10187d'')) or(sdata(queryid = ''5ce0dea4-b005-4185-9a05-7e91f14c7a8a'')) or(sdata(queryid = ''27eb925f-6f0c-4e27-9b57-91d78de703df'')) or(sdata(queryid = ''53b63124-caf4-4e71-ac5b-0e323d2805cb'')) or(sdata(queryid = ''f3dea938-a547-4510-8c24-25e04fa11ec4'')) or(sdata(queryid = ''5d8ebe7d-224b-4731-a1f2-ef1e3b409579'')) or(sdata(queryid = ''69c8dc53-031a-4069-a9e5-89f28cb7a7e0'')) or(sdata(queryid = ''2f65dc5e-63f6-4904-95f8-94c8983931a9'')) or(sdata(queryid = ''9ce16005-5b3b-4691-a624-5a7835e9e982''))) ';
    variable querystring2 varchar2(4000);
    exec :querystring2 := '((sdata(queryid = ''a51f216a-b211-4b59-89d4-6fcce58a8517'')) or (sdata(queryid = ''d1c975a6-607d-4334-a84c-cc63f68bda3a'')) or(sdata(queryid = ''11fd0d2a-540d-4de0-852a-75f1b841b262'')) or(sdata(queryid = ''0dbfd826-497e-4283-8fc6-210c631c4a3e'')) or(sdata(queryid = ''eb2fd3d3-3b14-4092-a373-edd5448802c2'')) or(sdata(queryid = ''a3b69f62-560b-4883-8bd8-d8225af075b4'')) or(sdata(queryid = ''8596dc3e-c062-4527-9df6-e2c6aa10187d'')) or(sdata(queryid = ''5ce0dea4-b005-4185-9a05-7e91f14c7a8a'')) or(sdata(queryid = ''27eb925f-6f0c-4e27-9b57-91d78de703df'')) or(sdata(queryid = ''53b63124-caf4-4e71-ac5b-0e323d2805cb'')) or(sdata(queryid = ''f3dea938-a547-4510-8c24-25e04fa11ec4'')) or(sdata(queryid = ''5d8ebe7d-224b-4731-a1f2-ef1e3b409579'')) or(sdata(queryid = ''69c8dc53-031a-4069-a9e5-89f28cb7a7e0'')) or(sdata(queryid = ''2f65dc5e-63f6-4904-95f8-94c8983931a9'')) or(sdata(queryid = ''9ce16005-5b3b-4691-a624-5a7835e9e982''))) ';
    variable querystring3 varchar2(4000);
    exec :querystring3 := '((sdata(queryid = ''a51f216a-b211-4b59-89d4-6fcce58a8517'')) or (sdata(queryid = ''d1c975a6-607d-4334-a84c-cc63f68bda3a'')) or(sdata(queryid = ''11fd0d2a-540d-4de0-852a-75f1b841b262'')) or(sdata(queryid = ''0dbfd826-497e-4283-8fc6-210c631c4a3e'')) or(sdata(queryid = ''eb2fd3d3-3b14-4092-a373-edd5448802c2'')) or(sdata(queryid = ''a3b69f62-560b-4883-8bd8-d8225af075b4'')) or(sdata(queryid = ''8596dc3e-c062-4527-9df6-e2c6aa10187d'')) or(sdata(queryid = ''5ce0dea4-b005-4185-9a05-7e91f14c7a8a'')) or(sdata(queryid = ''27eb925f-6f0c-4e27-9b57-91d78de703df'')) or(sdata(queryid = ''53b63124-caf4-4e71-ac5b-0e323d2805cb'')) or(sdata(queryid = ''f3dea938-a547-4510-8c24-25e04fa11ec4'')) or(sdata(queryid = ''5d8ebe7d-224b-4731-a1f2-ef1e3b409579'')) or(sdata(queryid = ''69c8dc53-031a-4069-a9e5-89f28cb7a7e0'')) or(sdata(queryid = ''2f65dc5e-63f6-4904-95f8-94c8983931a9'')) or(sdata(queryid = ''9ce16005-5b3b-4691-a624-5a7835e9e982''))) ';
         select indexedmetatext from ContentStore where rowid in ( select oraclerowid from ( select rowid as oraclerowid from ContentStore where contains(indexedmetatext,:querystring1|| ' or ' ||:querystring2|| ' or ' ||:querystring3) > 0 order by istimestamp desc ) where rownum <= 250);
    /* 4.We used bind variable of type clob but giving error
    Error:
    ORA-29902: error in executing ODCIIndexStart() routine
         ORA-20000: Oracle Text error:
         DRG-50857: oracle error in drexrstart_clob
    variable querystring CLOB;
    exec :querystring := '((sdata(queryid = ''a51f216a-b211-4b59-89d4-6fcce58a8517'')) or (sdata(queryid = ''d1c975a6-607d-4334-a84c-cc63f68bda3a'')) or(sdata(queryid = ''11fd0d2a-540d-4de0-852a-75f1b841b262'')) or(sdata(queryid = ''0dbfd826-497e-4283-8fc6-210c631c4a3e'')) or(sdata(queryid = ''eb2fd3d3-3b14-4092-a373-edd5448802c2'')) or(sdata(queryid = ''a3b69f62-560b-4883-8bd8-d8225af075b4'')) or(sdata(queryid = ''8596dc3e-c062-4527-9df6-e2c6aa10187d'')) or(sdata(queryid = ''5ce0dea4-b005-4185-9a05-7e91f14c7a8a'')) or(sdata(queryid = ''27eb925f-6f0c-4e27-9b57-91d78de703df'')) or(sdata(queryid = ''53b63124-caf4-4e71-ac5b-0e323d2805cb'')) or(sdata(queryid = ''f3dea938-a547-4510-8c24-25e04fa11ec4'')) or(sdata(queryid = ''5d8ebe7d-224b-4731-a1f2-ef1e3b409579'')) or(sdata(queryid = ''69c8dc53-031a-4069-a9e5-89f28cb7a7e0'')) or(sdata(queryid = ''2f65dc5e-63f6-4904-95f8-94c8983931a9'')) or(sdata(queryid = ''9ce16005-5b3b-4691-a624-5a7835e9e982''))) ';
    select indexedmetatext from ContentStore where rowid in ( select oraclerowid from ( select rowid as oraclerowid from ContentStore where contains(indexedmetatext,:querystring) > 0 order by istimestamp desc ) where rownum <= 250);
    /* 5.I read from article
    http://www.oracle.com/technology/products/text/pdf/ot11g_new_features.pdf
    That we don’t need to modified query as we had to do with SDATA(as we are doing in above examples) and optimizer will realize that query can be satisfied by the text index and will “push down” the filtering of rows into the text index processor rather than doing table access for filtering on sdata column but when I tried to write that query it was doing table access to filter for filter by column.
    /* 6.My Questions:
    a.     Is it possible as mentioned in above point(point number 5) that we don’t need to write SDATA query in contains clause and optimizer will use composite index automatically.
    b.     Is there any workaround for using string literal > 4000 char in contains clause.
    c.     Why performance degrades lineally when using multiple contains clause.
    d.     Can we use in clause in SDATA and write query like this:
    i.     SDATA(queryid in ( 'q1',’q2’))
    */

    SQE is really breakthrough for me but I dont know why it is not working in my case.I tried it onOracle 11g installaion with window and Linux both but did not get success.
    Please suggest me what I need to check when Installing if it is installation problem?
    My attempt:
    [oracle@oracle2 ~]$ sqlplus / as sysdba
    SQL*Plus: Release 11.1.0.6.0 - Production on Mon Jul 6 12:21:32 2009
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> create user test identified by test;
    User created.
    SQL> grant connect,dba,resource,ctxapp to test;
    Grant succeeded.
    SQL> connect test/test@content;
    Connected.
    SQL> create table test (text varchar2(2000));
    Table created.
    SQL> insert into test values ('hello world');
    1 row created.
    SQL> create index testindex on test(text) indextype is ctxsys.context;
    Index created.
    SQL> exec ctx_query.store_sqe('testsqe', 'hello')
    PL/SQL procedure successfully completed.
    SQL> select * from test where contains (text, 'sqe(testsqe)') > 0;
    select * from test where contains (text, 'sqe(testsqe)') > 0
    ERROR at line 1:
    ORA-29902: error in executing ODCIIndexStart() routine
    ORA-20000: Oracle Text error:
    DRG-00100: internal error, arguments : [50935],[drpn.c],[1051],[],[]
    ORA-01403: no data found
    SQL> select * from test where contains (text, 'ctx_query.sqe(testsqe)') > 0;
    no rows selected
    SQL>

  • Dynamic SQL and Pivot Query in 11G

    Hello all,
    I am using APEX and 11G I am trying to create a report based on the results of a pivot query. Below is the code to build the query string. The :P4_EPSB_PERIOD_HOLD holds data like (SEP-08') for example.
    declare
    q varchar2(4000);
    begin
    q:=q ||' select * FROM';
    q:=q ||' ( ';
    q:=q ||' select segment2, ';
    q:=q ||' accounted_dr, ';
    q:=q ||' period_name ';
    q:=q ||' from gl_je_lines a, ';
    q:=q ||' gl_code_combinations b';
    q:=q ||' where b.code_combination_id = a.code_combination_id';
    q:=q ||' and segment2 >= :P4_EPSB_OBJECT_FROM';
    q:=q ||' and segment2 <= :P4_EPSB_OBJECT_TO';
    q:=q ||' and period_name IN :P4_EPSB_PERIOD_HOLD';
    q:=q ||' and segment4 >= :P4_EPSB_LOCATION_FROM';
    q:=q ||' and segment4 <= :P4_EPSB_LOCATION_TO';
    q:=q ||' )';
    q:=q ||' PIVOT';
    q:=q ||' (';
    q:=q ||' sum(accounted_dr)';
    q:=q ||' for period_name IN :P4_EPSB_PERIOD_HOLD';
    q:=q ||' )';
    return q;
    end;
    I get the missingfailed to parse SQL query:
    ORA-00906: missing left parenthesis
    If I print the sql statement that the query generates, I get the following code, which, if the varaibles are hard-coded, works fine.
    select * FROM ( select segment2, accounted_dr, period_name from gl_je_lines a, gl_code_combinations b where b.code_combination_id = a.code_combination_id and segment2 >= :P4_EPSB_OBJECT_FROM and segment2 <= :P4_EPSB_OBJECT_TO and period_name IN :P4_EPSB_PERIOD_HOLD and segment4 >= :P4_EPSB_LOCATION_FROM and segment4 <= :P4_EPSB_LOCATION_TO ) PIVOT ( sum(accounted_dr) for period_name IN :P4_EPSB_PERIOD_HOLD )
    Any advice as to how to tackle this would be most welecome and appreciated.
    Thanks

    P4_EPSB_PERIOD_HOLDcome with single quotes? like 'SEP-08' or SEP-08

  • Re-writing the query in 11g

    Hello,
    Can someone suggest an idea to rewrite this query? this query is taking longer time as expected probably
    they way the query is formed is not right? Thanks in advance! I use 11g
    SELECT   brand_id,
                          region_id,
                          sku_base_id,
                          desc_key,
                          (SELECT   MAX (cps.product_code)
                             FROM   cat_prod_sku_vw cps
                            WHERE       cps.brand_id = srl.brand_id
                                    AND cps.region_id = srl.region_id
                                    AND cps.brand_id = 4
                                    AND cps.region_id = 0
                                    AND (   cps.parent_cat_id
                                         || 'PROD'
                                         || cps.prod_base_id) = srl.desc_text)
                             AS desc_text
                   FROM   sku_rgn_lang_vw srl
                  WHERE       brand_id = 4
                          AND region_id = 0
                          AND desc_key LIKE 'www_pcode_%'
                          AND LENGTH (desc_text) > 6
                          AND desc_text LIKE 'CAT%' ;

    You should look at this thread {message:id=9360003} to get an idea of what other information is required.
    However, I would be inclined to re-write it as a (outer) join instead of a scalar select. Somethign more like:
    SELECT srl.brand_id, srl.region_id, srl.sku_base_id, srl.desc_key,
           cps.desc_text
    FROM sku_rgn_lang_vw srl
       left join (SELECT brand_id, region_id,
                         parent_cat_id||'PROD'||prod_base_id desc_text
                         MAX (product_code) product_code
                  FROM cat_prod_sku_vw cps
                  WHERE brand_id = 4
                    AND region_id = 0
                  GROUP BY brand_id, region_id,
                           parent_cat_id||'PROD'||prod_base_id) cps
          on cps.brand_id = srl.brand_id AND
             cps.region_id = srl.region_id AND
             cps.parent_cat_id||'PROD'||cps.prod_base_id = srl.desc_text
    WHERE srl.brand_id = 4
      AND srl.region_id = 0
      AND srl.desc_key LIKE 'www_pcode_%'
      AND LENGTH (cps.desc_text) > 6
      AND cps.desc_text LIKE 'CAT%' ;Although, I'm not entirely sure I got all of the aliases correct.
    John

  • Execute query on 11g

    Hi.
    I have a strange problem with 11g forms. Must say I would not believe it if I did not see this myself. The problem is when I do F11 (enter query), make some conditions, do ctrl+F11 the query gets executed. But when I do the same thing using toolbar icons to enter and execute query any form crashes. I have the key-entqry and key-exeqry triggers defined on form level. Form toolbar icon I call do_key('ENTER_QUERY') and do_key('EXECUTE_QUERY') respectively. I just cant imagine what is the difference in using function keys and doing do_key as in my case. The same functionality is 100% tested and work on Forms 10g.
    Anybody with the similar problem?
    Best regards.

    The form crashes too.
    When I create a new menu with only two menu-items(do_key('ENTER_QUERY') and do_key('EXECUTE_QUERY')) and attach it to your form, it works.
    This is the stack trace:
    Last Trigger FORM/BLOCK/FIELD: TEST_CRASH.DEPT.DEPTNO
    Last Trigger: KEY-ENTQRY - (Successfully Completed)
    Last Builtin: EXECUTE_QUERY - (Successfully Completed)
    ----- Call Stack Trace -----
    Symbol file D:\Oracle\Middleware\as_1\RDBMS\ADMIN\oracore11.SYM does not match binary
    Symbol file D:\Oracle\Middleware\as_1\RDBMS\ADMIN\oraclient11.SYM does not match binary
    Symbol file D:\Oracle\Middleware\as_1\RDBMS\ADMIN\orageneric11.SYM does not match binary
    calling call entry argument values in hex
    location type point (? means dubious value)
    Symbol file D:\Oracle\Middleware\as_1\RDBMS\ADMIN\oracore11.SYM does not match binary
    Symbol file D:\Oracle\Middleware\as_1\RDBMS\ADMIN\oraclient11.SYM does not match binary
    Symbol file D:\Oracle\Middleware\as_1\RDBMS\ADMIN\orageneric11.SYM does not match binary
    _skgpexit()+15                00000000            
    kgucrsh()+7         CALLrel  sltln()+4 0 0
    __VInfreq__kgebse() CALLreg 00000000 2B69108
    +1023
    kgerse()+111        CALLrel  kgepop()+0 2B69108 2B91A54 258
    __VInfreq__kglsupd( CALLrel _kgerse()+0          2B69108
    )+50
    kglpnds()+69        CALLrel  kglpndl()+0 2B69108 2E683A0 1
    _kgstmComputeTransl  CALLreg  00000000             2B69108 2E683A0 1 2B69108
    ation()+28 2B997C0 2E683AC
    kgssinit_state()+ CALL??? 00000000 2E683A0 1 2B69108
    189
    _kgstmComputeRefEpo  CALL???  00000000             2B99794 1 2B69108 2B69108
    ch()+173 2B99794 2B50954
    _kguucad()+75        CALL???  00000000             2B99794 1 2B69108
    667C7E09 CALLrel 66837BB6 1 1 2B69108
    668125A4 CALLrel 66741A73 2173920 2B50954 1 1
    66811F9B CALLrel 66812548 2173920 2E4C960
    ipkdedxDestroyXCo CALLrel _depxcdestroy()+0    2173920 2E4C960
    ntext()+104
    00000001 CALL??? 00000000
    ----- End of Call Stack Trace -----
    I modified your menu(e.g. remove the menu roles), but it still crashes.
    Something strange in the stack trace:
    Last Trigger: KEY-ENTQRY - (Successfully Completed)
    Last Builtin: EXECUTE_QUERY - (Successfully Completed)
    I expected as last trigger KEY-EXEQRY, because the EXECUTE_QUERY is cald from this one...
    I suggest you contact Oracle support with your testcase.
    Sorry I couldn't help...

  • Error in using Lookup Query - OIM 11g

    Hi Guys,
    I am trying to use following lookup query:
    select usr_key, usr_login from USR where usr_status = 'Active' and have following mapping defined in the process form:
    Column Width = 200
    Lookup Column Name = usr_login
    Column Names = usr_key, usr_login
    Column Captions = USER_KEY, USER_LOGIN
    The values are getting populated properly while searching for the lookup. But when I click on 'SELECT' button. It throws error. saying 'A system error occurred'
    I see following error in the log:
    <Jul 4, 2011 7:19:07 PM IST> <Error> <XELLERATE.WEBAPP> <BEA-000000> <Class/Method: tcLookupFieldAction/selectedValue encounter some problems: {1}
    Thor.API.Exceptions.tcColumnNotFoundException
    at Thor.API.tcMetaDataSet.getStringValue(tcMetaDataSet.java:368)
    at com.thortech.xl.webclient.actions.tcLookupFieldAction.selectedValue(tcLookupFieldAction.java:1723)
    ### Steps to Reproduce Problem ###
    1. Create a new process form
    2. For one of the column, assign following properties:
    Lookup Query = select usr_key, usr_login from USR where usr_status = 'Active'
    Column Width = 200
    Lookup Column Name = usr_login
    Column Names = usr_key, usr_login
    Column Captions = USER_KEY, USER_LOGIN
    3. Activate the form
    4. Open the resource in Web Console
    5. Search for that lookup.
    6. Select any of the value
    7. Press 'Select' button. Error is thrown.
    Could somebody please help me out with this issue?
    Thanks,

    Got the solution:
    tcColumnNotFoundException with Lookup Query

  • Selection Steps greyed out for a Union Query - OBIEE 11g

    Hello,
    I did some research and could not find possible solution/explanation for the issue I am facing.
    For one of the report which is based on Union of 3 queries in OBIEE 11g, I recently added a calculated item which now I would like to remove. The best way to achieve this was by removing respective step in selection steps.
    However I could not see complete list of steps in this Union report and also cannot modify or remove the selection step for calculated item (2 below). Also Selection steps on task bar is by default greyed out
    Below is what I see when I select selection steps
    1. Start with all members
    2. Then Add Average
    Any ideas or workaround.
    Thank you,
    Sai

    RqList <<184070>> [for database 3023:147018:DEVFRC,57] /* FETCH FIRST 1000001 ROWS ONLY */
    0 as c1 [for database 3023:147018,57],
    D2.c1 as c2 [for database 3023:147018,57],
    D1.c1 as c3 [for database 3023:147018,57]
    Child Nodes (RqJoinSpec): <<184109>> [for database 3023:147018:DEVFRC,57]
    RqJoinNode <<184107>> []
    RqList <<184082>> [for database 3023:147018:DEVFRC,57] distinct
    sum(FCT_LEDGER_STAT.N_VALUE) as c1 [for database 3023:147018,57]
    Child Nodes (RqJoinSpec): <<184085>> [for database 3023:147018:DEVFRC,57]
    RqJoinNode <<184084>> []
    FCT_LEDGER_STAT T147426
    ) as D1
    RqJoinNode <<184108>> []
    RqList <<184088>> [for database 3023:147018:DEVFRC,57] distinct
    DIM_FINANCIAL_ELEMENT.V_FINANCIAL_ELEM_NAME as c1 [for database 3023:147018,57]
    Child Nodes (RqJoinSpec): <<184099>> [for database 3023:147018:DEVFRC,57]
    RqJoinNode <<184098>> []
    DIM_FINANCIAL_ELEMENT T147109
    ) as D2
    OrderBy: c2 asc NULLS LAST [for database 3023:147018,57]
    =========================================================
    PHYSICAL
    ==================================================
    WITH
    SAWITH0 AS (select sum(T147426.N_VALUE) as c1
    from
    OFSAAATOMIC.FCT_LEDGER_STAT T147426),
    SAWITH1 AS (select distinct T147109.V_FINANCIAL_ELEM_NAME as c1
    from
    OFSAAATOMIC.DIM_FINANCIAL_ELEMENT T147109)
    select D1.c1 as c1, D1.c2 as c2, D1.c3 as c3 from ( select 0 as c1,
    D2.c1 as c2,
    D1.c1 as c3
    from
    SAWITH0 D1,
    SAWITH1 D2
    order by c2 ) D1 where rownum <= 1000001

  • Joins issue in query - OBIEE 11g

    Hi all,
    I have created a new repository with a simple star schema, and also have created ragged hierarchy. Now when i select any dimension field and a measure from the fact, the query generated by BI has 2 physical queries i.e. one for dimension and other for fact. but when it joins these 2 subqueries it does not consider any common column to join on , and results in incorrect data.
    Not able to figure out what is going wrong. Pls. let me know hw to resolve this issue if any one has faced a similar one.
    rgds,
    Shruti

    RqList <<184070>> [for database 3023:147018:DEVFRC,57] /* FETCH FIRST 1000001 ROWS ONLY */
    0 as c1 [for database 3023:147018,57],
    D2.c1 as c2 [for database 3023:147018,57],
    D1.c1 as c3 [for database 3023:147018,57]
    Child Nodes (RqJoinSpec): <<184109>> [for database 3023:147018:DEVFRC,57]
    RqJoinNode <<184107>> []
    RqList <<184082>> [for database 3023:147018:DEVFRC,57] distinct
    sum(FCT_LEDGER_STAT.N_VALUE) as c1 [for database 3023:147018,57]
    Child Nodes (RqJoinSpec): <<184085>> [for database 3023:147018:DEVFRC,57]
    RqJoinNode <<184084>> []
    FCT_LEDGER_STAT T147426
    ) as D1
    RqJoinNode <<184108>> []
    RqList <<184088>> [for database 3023:147018:DEVFRC,57] distinct
    DIM_FINANCIAL_ELEMENT.V_FINANCIAL_ELEM_NAME as c1 [for database 3023:147018,57]
    Child Nodes (RqJoinSpec): <<184099>> [for database 3023:147018:DEVFRC,57]
    RqJoinNode <<184098>> []
    DIM_FINANCIAL_ELEMENT T147109
    ) as D2
    OrderBy: c2 asc NULLS LAST [for database 3023:147018,57]
    =========================================================
    PHYSICAL
    ==================================================
    WITH
    SAWITH0 AS (select sum(T147426.N_VALUE) as c1
    from
    OFSAAATOMIC.FCT_LEDGER_STAT T147426),
    SAWITH1 AS (select distinct T147109.V_FINANCIAL_ELEM_NAME as c1
    from
    OFSAAATOMIC.DIM_FINANCIAL_ELEMENT T147109)
    select D1.c1 as c1, D1.c2 as c2, D1.c3 as c3 from ( select 0 as c1,
    D2.c1 as c2,
    D1.c1 as c3
    from
    SAWITH0 D1,
    SAWITH1 D2
    order by c2 ) D1 where rownum <= 1000001

  • Query Tuning: 11g

    How to optimize a select query on a tabe that is range partition on date index.
    Insertion is occuring at a very high rate in this table.
    Latest 600 records is to be retrived.
    The explain plan shows that fetch is taking lot of time in disc IO,s
    1- plan is also poor due to full table index.
    2- Optimizer is not picking the better plan may be high insertion making the index selection redundant.
    Please suggest how to attack on such issues.

    uploading latest run with autotrace and explain plain with waits elapsed time is 1521 secs around 25 minutes.
    please let me know what is bottle neck here.
    ####TKPROF output#########
    SQL ID : 2j5w6bv437cak
    select almevttbl.AlmEvtId, almevttbl.AlmType, almevttbl.ComponentId,
      almevttbl.TimeStamp, almevttbl.Severity, almevttbl.State,
      almevttbl.Category, almevttbl.CauseCode, almevttbl.UnitType,
      almevttbl.UnitId, almevttbl.UnitName, almevttbl.ServerName,
      almevttbl.StrParam, almevttbl.ExtraStrParam, almevttbl.ExtraStrParam2,
      almevttbl.ExtraStrParam3, almevttbl.ParentCustId, almevttbl.ExtraParam1,
      almevttbl.ExtraParam2, almevttbl.ExtraParam3,almevttbl.ExtraParam4,
      almevttbl.ExtraParam5, almevttbl.SRCIPADDRFAMILY,almevttbl.SrcIPAddress11,
      almevttbl.SrcIPAddress12,almevttbl.SrcIPAddress13,almevttbl.SrcIPAddress14,
      almevttbl.DESTIPADDRFAMILY,almevttbl.DestIPAddress11,
      almevttbl.DestIPAddress12,almevttbl.DestIPAddress13,
      almevttbl.DestIPAddress14,  almevttbl.DestPort, almevttbl.SrcPort,
      almevttbl.SessionDir, almevttbl.CustomerId, almevttbl.ProfileId,
      almevttbl.ParentProfileId, almevttbl.CustomerName, almevttbl.AttkDir,
      almevttbl.SubCategory, almevttbl.RiskCategory, almevttbl.AssetValue,
      almevttbl.IPSAction, almevttbl.l4Protocol,almevttbl.ExtraStrParam4 ,
      almevttbl.ExtraStrParam5,almevttbl.username,almevttbl.ExtraStrParam6,
      IpAddrFamily1,IPAddrValue11,IPAddrValue12,IPAddrValue13,IPAddrValue14,
      IpAddrFamily2,IPAddrValue21,IPAddrValue22,IPAddrValue23,IPAddrValue24
    FROM
           AlmEvtTbl PARTITION(ALMEVTTBLP20100323) WHERE AlmEvtId IN ( SELECT  * FROM
      ( SELECT /*+ FIRST_ROWS(1000) INDEX (AlmEvtTbl AlmEvtTbl_Index) */AlmEvtId
      FROM AlmEvtTbl PARTITION(ALMEVTTBLP20100323) where       ((AlmEvtTbl.Customerid
      = 0 or AlmEvtTbl.ParentCustId = 0))  ORDER BY AlmEvtTbl.TIMESTAMP DESC) 
      WHERE ROWNUM  <  602) order by timestamp desc
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.10       0.17          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch       42   1348.25    1521.24       1956   39029545          0         601
    total       44   1348.35    1521.41       1956   39029545          0         601
    Misses in library cache during parse: 1
    Optimizer mode: FIRST_ROWS
    Parsing user id: 82 
    Rows     Row Source Operation
        601  PARTITION RANGE SINGLE PARTITION: 24 24 (cr=39029545 pr=1956 pw=1956 time=11043 us cost=0 size=7426 card=1)
        601   TABLE ACCESS BY LOCAL INDEX ROWID ALMEVTTBL PARTITION: 24 24 (cr=39029545 pr=1956 pw=1956 time=11030 us cost=0 size=7426 card=1)
        601    INDEX FULL SCAN ALMEVTTBL_INDEX PARTITION: 24 24 (cr=39029377 pr=1956 pw=1956 time=11183 us cost=0 size=0 card=1)(object id 72557)
        601     FILTER  (cr=39027139 pr=0 pw=0 time=0 us)
    169965204      COUNT STOPKEY (cr=39027139 pr=0 pw=0 time=24859073 us)
    169965204       VIEW  (cr=39027139 pr=0 pw=0 time=17070717 us cost=0 size=13 card=1)
    169965204        PARTITION RANGE SINGLE PARTITION: 24 24 (cr=39027139 pr=0 pw=0 time=13527031 us cost=0 size=48 card=1)
    169965204         TABLE ACCESS BY LOCAL INDEX ROWID ALMEVTTBL PARTITION: 24 24 (cr=39027139 pr=0 pw=0 time=10299895 us cost=0 size=48 card=1)
    169965204          INDEX FULL SCAN ALMEVTTBL_INDEX PARTITION: 24 24 (cr=1131414 pr=0 pw=0 time=3222624 us cost=0 size=0 card=1)(object id 72557)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                      42        0.00          0.00
      SQL*Net message from client                    42       11.54        133.54
      db file sequential read                      1956        0.20         28.00
      latch free                                     21        0.00          0.01
      latch: cache buffers chains                     9        0.01          0.02
    SQL ID : 0ushr863b7z39
    SELECT /* OPT_DYN_SAMP */ /*+ ALL_ROWS IGNORE_WHERE_CLAUSE
      NO_PARALLEL(SAMPLESUB) opt_param('parallel_execution_enabled', 'false')
      NO_PARALLEL_INDEX(SAMPLESUB) NO_SQL_TUNE */ NVL(SUM(C1),0), NVL(SUM(C2),0)
    FROM
    (SELECT /*+ IGNORE_WHERE_CLAUSE NO_PARALLEL("PLAN_TABLE") FULL("PLAN_TABLE")
      NO_PARALLEL_INDEX("PLAN_TABLE") */ 1 AS C1, CASE WHEN
      "PLAN_TABLE"."STATEMENT_ID"=:B1 THEN 1 ELSE 0 END AS C2 FROM
      "SYS"."PLAN_TABLE$" "PLAN_TABLE") SAMPLESUB
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.00       0.01          1          3          0           1
    total        3      0.00       0.01          1          3          0           1
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 82     (recursive depth: 1)
    Rows     Row Source Operation
          1  SORT AGGREGATE (cr=3 pr=1 pw=1 time=0 us)
          0   TABLE ACCESS FULL PLAN_TABLE$ (cr=3 pr=1 pw=1 time=0 us cost=29 size=138856 card=8168)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file sequential read                         1        0.01          0.01
    SQL ID : bjkdb51at8dnb
    EXPLAIN PLAN SET STATEMENT_ID='PLUS30350011' FOR select almevttbl.AlmEvtId,
      almevttbl.AlmType, almevttbl.ComponentId, almevttbl.TimeStamp,
      almevttbl.Severity, almevttbl.State, almevttbl.Category,
      almevttbl.CauseCode, almevttbl.UnitType, almevttbl.UnitId,
      almevttbl.UnitName, almevttbl.ServerName, almevttbl.StrParam,
      almevttbl.ExtraStrParam, almevttbl.ExtraStrParam2, almevttbl.ExtraStrParam3,
       almevttbl.ParentCustId, almevttbl.ExtraParam1, almevttbl.ExtraParam2,
      almevttbl.ExtraParam3,almevttbl.ExtraParam4,almevttbl.ExtraParam5,
      almevttbl.SRCIPADDRFAMILY,almevttbl.SrcIPAddress11,almevttbl.SrcIPAddress12,
      almevttbl.SrcIPAddress13,almevttbl.SrcIPAddress14,
      almevttbl.DESTIPADDRFAMILY,almevttbl.DestIPAddress11,
      almevttbl.DestIPAddress12,almevttbl.DestIPAddress13,
      almevttbl.DestIPAddress14,  almevttbl.DestPort, almevttbl.SrcPort,
      almevttbl.SessionDir, almevttbl.CustomerId, almevttbl.ProfileId,
      almevttbl.ParentProfileId, almevttbl.CustomerName, almevttbl.AttkDir,
      almevttbl.SubCategory, almevttbl.RiskCategory, almevttbl.AssetValue,
      almevttbl.IPSAction, almevttbl.l4Protocol,almevttbl.ExtraStrParam4 ,
      almevttbl.ExtraStrParam5,almevttbl.username,almevttbl.ExtraStrParam6,
      IpAddrFamily1,IPAddrValue11,IPAddrValue12,IPAddrValue13,IPAddrValue14,
      IpAddrFamily2,IPAddrValue21,IPAddrValue22,IPAddrValue23,IPAddrValue24 FROM 
           AlmEvtTbl PARTITION(ALMEVTTBLP20100323) WHERE AlmEvtId IN ( SELECT  * FROM
      ( SELECT /*+ FIRST_ROWS(1000) INDEX (AlmEvtTbl AlmEvtTbl_Index) */AlmEvtId
      FROM AlmEvtTbl PARTITION(ALMEVTTBLP20100323) where       ((AlmEvtTbl.Customerid
      = 0 or AlmEvtTbl.ParentCustId = 0))  ORDER BY AlmEvtTbl.TIMESTAMP DESC) 
      WHERE ROWNUM  <  602) order by timestamp desc
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.28       0.26          0          0          0           0
    Execute      1      0.01       0.00          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        2      0.29       0.27          0          0          0           0
    Misses in library cache during parse: 1
    Optimizer mode: FIRST_ROWS
    Parsing user id: 82 
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       1        0.00          0.00
      SQL*Net message from client                     1        0.00          0.00
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse       13      0.71       0.96          3         10          0           0
    Execute     14      0.20       0.29          4        304         26          21
    Fetch       92   2402.17    2714.85       3819   70033708          0        1255
    total      119   2403.09    2716.10       3826   70034022         26        1276
    Misses in library cache during parse: 10
    Misses in library cache during execute: 6
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                      49        0.00          0.00
      SQL*Net message from client                    48       29.88        163.43
      db file sequential read                      1966        0.20         28.10
      latch free                                     21        0.00          0.01
      latch: cache buffers chains                     9        0.01          0.02
      latch: session allocation                       1        0.00          0.00
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse      940      0.51       0.73          1          2         38           0
    Execute   3263      1.93       2.62          7       1998         43          23
    Fetch     6049      1.32       4.41        214      12858         36       13724
    total    10252      3.78       7.77        222      14858        117       13747
    Misses in library cache during parse: 172
    Misses in library cache during execute: 168
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file sequential read                        88        0.04          0.62
      latch: shared pool                              8        0.00          0.00
      latch: row cache objects                        2        0.00          0.00
      latch free                                      1        0.00          0.00
      latch: session allocation                       1        0.00          0.00
       34  user  SQL statements in session.
    3125  internal SQL statements in session.
    3159  SQL statements in session.
    Trace file: ora11g_ora_2064.trc
    Trace file compatibility: 11.01.00
    Sort options: default
           6  sessions in tracefile.
          98  user  SQL statements in trace file.
        9111  internal SQL statements in trace file.
        3159  SQL statements in trace file.
          89  unique SQL statements in trace file.
       30341  lines in trace file.
        6810  elapsed seconds in trace file.
    ###################################### AutoTrace Output#################  
    Statistics
           3901  recursive calls
              0  db block gets
       39030275  consistent gets
           1970  physical reads
            140  redo size
         148739  bytes sent via SQL*Net to client
            860  bytes received via SQL*Net from client
             42  SQL*Net roundtrips to/from client
             73  sorts (memory)
              0  sorts (disk)
            601  rows processed

  • Filter based on another analysis need to run as a seperate query obiee 11g

    Hi,
    I have a main report which has a filter condition that depends on the another request(Created through Filter based on another analysis).The Filter based on another analysis report query comes as a embedded query along with the main query (making a subquery).As it has a subquery it is taking more time to fetch data.
    Is there any possiblity of running the Filter based on another analysis report as a seperate query.
    Please suggest.
    Thanks,
    Soukath

    Hi,
    Make sure one thing,u have eanble check box and submit sql button in the bottom of Advanced tab then save it and try again it will work.
    refer:
    http://tipsonobiee.blogspot.com/2009/06/step-by-step-to-bypass-all-caches.html
    Thanks
    Deva
    Edited by: Devarasu on Dec 19, 2011 11:59 AM

  • WITH vs INNER QUERY on 11g (100% CPU & Never Return vs 2-3 Seconds)

    I cannot figure out why this is happening. We have an 11g database and a pipelined stored function. The following will never return. The db cpu goes up to about 100%.
    FOR myRow IN (
      WITH subquery AS (
        SELECT ...
      SELECT
      FROM subqery
    LOOP
      PIPE ROW(...);
    END LOOP;If it's formatted the following way, it behaves the same way...:
    FOR myRow IN (
      SELECT
      FROM (
        SELECT ...
    LOOP
      PIPE ROW(...);
    END LOOP;However, using the SELECT * FROM (...) method, without the procedure, returns fine:
    SELECT * FROM (
      SELECT * FROM (
    )But this never returns:
    WITH subquery AS (
      SELECT ...
    SELECT
    FROM subqueryI have no idea how to diagnose this. It's as if one method tries to store results one way, while the other does not. Any thoughts would be greatly appreciated!!

    This is the explain for the /*+materialize*/ and subquery form:
    Plan hash value: 2761872157
    | Id  | Operation                  | Name                      | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT           |                           |     1 |   130 |       |  3427   (2)| 00:00:42 |
    |   1 |  TEMP TABLE TRANSFORMATION |                           |       |       |       |            |          |
    |   2 |   LOAD AS SELECT           |                           |       |       |       |            |          |
    |*  3 |    HASH JOIN               |                           |     5 |  1090 |       |  3425   (2)| 00:00:42 |
    |   4 |     TABLE ACCESS FULL      | U_MASTER                  |   579 |  4632 |       |     5   (0)| 00:00:01 |
    |*  5 |     HASH JOIN RIGHT OUTER  |                           | 83280 |    16M|  4152K|  3418   (2)| 00:00:42 |
    |   6 |      VIEW                  |                           | 83280 |  3171K|       |   857   (2)| 00:00:11 |
    |*  7 |       HASH JOIN            |                           | 83280 |  4066K|       |   857   (2)| 00:00:11 |
    |*  8 |        TABLE ACCESS FULL   | U_MASTER                  |   246 |  1722 |       |     5   (0)| 00:00:01 |
    |   9 |        VIEW                |                           | 83280 |  3497K|       |   851   (2)| 00:00:11 |
    |* 10 |         HASH JOIN          |                           | 83280 |  3903K|  2704K|   851   (2)| 00:00:11 |
    |* 11 |          TABLE ACCESS FULL | T_MASTER                  | 78886 |  1771K|       |   377   (2)| 00:00:05 |
    |* 12 |          TABLE ACCESS FULL | T_CONTAINER_IN            | 84469 |  2062K|       |   191   (3)| 00:00:03 |
    |* 13 |      HASH JOIN OUTER       |                           | 83280 |    13M|  1048K|  1634   (2)| 00:00:20 |
    |  14 |       TABLE ACCESS FULL    | C_MASTER                  | 16742 |   850K|       |   127   (2)| 00:00:02 |
    |  15 |       VIEW                 |                           | 83280 |  9678K|       |   937   (2)| 00:00:12 |
    |* 16 |        HASH JOIN           |                           | 83280 |  9678K|       |   937   (2)| 00:00:12 |
    |* 17 |         TABLE ACCESS FULL  | U_MASTER                  |   246 |  2706 |       |     5   (0)| 00:00:01 |
    |  18 |         VIEW               |                           | 83280 |  8783K|       |   931   (2)| 00:00:12 |
    |* 19 |          HASH JOIN         |                           | 83280 |  5530K|  2704K|   931   (2)| 00:00:12 |
    |* 20 |           TABLE ACCESS FULL| T_MASTER                  | 78886 |  1771K|       |   377   (2)| 00:00:05 |
    |* 21 |           TABLE ACCESS FULL| T_CONTAINER_IN            | 84469 |  3712K|       |   191   (3)| 00:00:03 |
    |  22 |   VIEW                     |                           |     1 |   130 |       |     2   (0)| 00:00:01 |
    |  23 |    TABLE ACCESS FULL       | SYS_TEMP_0FD9D670A_23115C |     1 |   103 |       |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       3 - access("A"."PICKUP_LOC_UNIT"="B"."U_ID")
           filter(("A"."STATUS"=1 OR "A"."STATUS"=2) AND "B"."FAC_ID"=161 AND
                  "from$_subquery$_008"."TO_UNIT_ID" IS NULL AND SYS_EXTRACT_UTC(INTERNAL_FUNCTION("A"."ORIGIN_DATETIME"))
                  <=SYS_EXTRACT_UTC(SYSTIMESTAMP(6)) OR "B"."FAC_ID"=161 AND "from$_subquery$_008"."PREV_T_ID" IS NULL
                  AND SYS_EXTRACT_UTC(INTERNAL_FUNCTION("from$_subquery$_008"."TASK_DATE_TIME"))>SYS_EXTRACT_UTC(SYSTIMEST
                  AMP(6)) AND SYS_EXTRACT_UTC(INTERNAL_FUNCTION("A"."ORIGIN_DATETIME"))<=SYS_EXTRACT_UTC(SYSTIMESTAMP(6))
                  AND "from$_subquery$_008"."TO_UNIT_ID" IS NOT NULL OR "from$_subquery$_008"."FAC_ID"=161 AND
                  "from$_subquery$_014"."TASK_DATE_TIME" IS NULL AND ("from$_subquery$_008"."UNIT_TYPE_ID"=2 OR
                  "from$_subquery$_008"."UNIT_TYPE_ID"=3) AND SYS_EXTRACT_UTC(INTERNAL_FUNCTION("from$_subquery$_008"."TAS
                  K_DATE_TIME"))<=SYS_EXTRACT_UTC(SYSTIMESTAMP(6)) OR "from$_subquery$_008"."FAC_ID"=161 AND
                  ("from$_subquery$_008"."UNIT_TYPE_ID"=2 OR "from$_subquery$_008"."UNIT_TYPE_ID"=3) AND
                  SYS_EXTRACT_UTC(INTERNAL_FUNCTION("from$_subquery$_008"."TASK_DATE_TIME"))<=SYS_EXTRACT_UTC(SYSTIMESTAMP
                  (6)) AND SYS_EXTRACT_UTC(INTERNAL_FUNCTION("from$_subquery$_014"."TASK_DATE_TIME"))>SYS_EXTRACT_UTC(SYST
                  IMESTAMP(6)))
       5 - access("from$_subquery$_008"."QCSJ_C000000000600000"="G"."PREV_T_ID"(+) AND
                  "from$_subquery$_008"."C_ID_IN"="G"."C_ID_IN"(+))
       7 - access("H"."TO_UNIT_ID"="I"."U_ID")
       8 - filter("I"."UNIT_TYPE_ID"=1 OR "I"."UNIT_TYPE_ID"=2 OR "I"."UNIT_TYPE_ID"=3)
      10 - access("G"."T_ID"="H"."T_ID")
      11 - filter("H"."STATUS"=1)
      12 - filter("G"."REJECT"=0)
      13 - access("A"."C_ID"="C"."C_ID_IN"(+))
      16 - access("D"."TO_UNIT_ID"="E"."U_ID")
      17 - filter("E"."UNIT_TYPE_ID"=1 OR "E"."UNIT_TYPE_ID"=2 OR "E"."UNIT_TYPE_ID"=3)
      19 - access("C"."T_ID"="D"."T_ID")
      20 - filter("D"."STATUS"=1)
      21 - filter("C"."REJECT"=0) This is the explain for the with statement form (the one that never returns):
      Plan hash value: 868902620
    | Id  | Operation                        | Name                         | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                 |                              |     5 |   840 |       |  1493   (2)| 00:00:18 |
    |*  1 |  FILTER                          |                              |       |       |       |            |          |
    |   2 |   NESTED LOOPS OUTER             |                              |     5 |   840 |       |  1493   (2)| 00:00:18 |
    |*  3 |    HASH JOIN                     |                              | 83280 |    11M|       |  1484   (2)| 00:00:18 |
    |   4 |     TABLE ACCESS FULL            | U_MASTER                     |   579 |  4632 |       |     5   (0)| 00:00:01 |
    |*  5 |     HASH JOIN OUTER              |                              | 83280 |    10M|  1048K|  1477   (2)| 00:00:18 |
    |   6 |      TABLE ACCESS FULL           | C_MASTER                     | 16742 |   850K|       |   127   (2)| 00:00:02 |
    |   7 |      VIEW                        |                              | 83280 |  6424K|       |   937   (2)| 00:00:12 |
    |*  8 |       HASH JOIN                  |                              | 83280 |  6424K|       |   937   (2)| 00:00:12 |
    |*  9 |        TABLE ACCESS FULL         | U_MASTER                     |   246 |  2706 |       |     5   (0)| 00:00:01 |
    |* 10 |        HASH JOIN                 |                              | 83280 |  5530K|  2704K|   931   (2)| 00:00:12 |
    |* 11 |         TABLE ACCESS FULL        | T_MASTER                     | 78886 |  1771K|       |   377   (2)| 00:00:05 |
    |* 12 |         TABLE ACCESS FULL        | T_CONTAINER_IN               | 84469 |  3712K|       |   191   (3)| 00:00:03 |
    |* 13 |    VIEW PUSHED PREDICATE         |                              |     1 |    29 |       |     0   (0)| 00:00:01 |
    |* 14 |     HASH JOIN                    |                              |   845 | 46475 |       |   384   (2)| 00:00:05 |
    |* 15 |      TABLE ACCESS FULL           | U_MASTER                     |   246 |  1722 |       |     5   (0)| 00:00:01 |
    |  16 |      NESTED LOOPS                |                              |       |       |       |            |          |
    |  17 |       NESTED LOOPS               |                              |   845 | 40560 |       |   378   (2)| 00:00:05 |
    |* 18 |        TABLE ACCESS FULL         | T_MASTER                     | 78886 |  1771K|       |   377   (2)| 00:00:05 |
    |* 19 |        INDEX RANGE SCAN          | IDX_T_CONTAINER_IN_PREV_T_ID |     1 |       |       |     0   (0)| 00:00:01 |
    |* 20 |       TABLE ACCESS BY INDEX ROWID| T_CONTAINER_IN               |     1 |    25 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter(("A"."STATUS"=1 OR "A"."STATUS"=2) AND "B"."FAC_ID"=161 AND "from$_subquery$_008"."TO_UNIT_ID" IS
                  NULL AND SYS_EXTRACT_UTC(INTERNAL_FUNCTION("A"."ORIGIN_DATETIME"))<=SYS_EXTRACT_UTC(SYSTIMESTAMP(6)) OR
                  "B"."FAC_ID"=161 AND "from$_subquery$_008"."PREV_T_ID" IS NULL AND
                  SYS_EXTRACT_UTC(INTERNAL_FUNCTION("from$_subquery$_008"."TASK_DATE_TIME"))>SYS_EXTRACT_UTC(SYSTIMESTAMP(6)) AND
                  SYS_EXTRACT_UTC(INTERNAL_FUNCTION("A"."ORIGIN_DATETIME"))<=SYS_EXTRACT_UTC(SYSTIMESTAMP(6)) AND
                  "from$_subquery$_008"."TO_UNIT_ID" IS NOT NULL OR "from$_subquery$_008"."FAC_ID"=161 AND
                  "from$_subquery$_014"."TASK_DATE_TIME" IS NULL AND ("from$_subquery$_008"."UNIT_TYPE_ID"=2 OR
                  "from$_subquery$_008"."UNIT_TYPE_ID"=3) AND SYS_EXTRACT_UTC(INTERNAL_FUNCTION("from$_subquery$_008"."TASK_DATE_TI
                  ME"))<=SYS_EXTRACT_UTC(SYSTIMESTAMP(6)) OR "from$_subquery$_008"."FAC_ID"=161 AND
                  ("from$_subquery$_008"."UNIT_TYPE_ID"=2 OR "from$_subquery$_008"."UNIT_TYPE_ID"=3) AND
                  SYS_EXTRACT_UTC(INTERNAL_FUNCTION("from$_subquery$_008"."TASK_DATE_TIME"))<=SYS_EXTRACT_UTC(SYSTIMESTAMP(6)) AND
                  SYS_EXTRACT_UTC(INTERNAL_FUNCTION("from$_subquery$_014"."TASK_DATE_TIME"))>SYS_EXTRACT_UTC(SYSTIMESTAMP(6)))
       3 - access("A"."PICKUP_LOC_UNIT"="B"."U_ID")
       5 - access("A"."C_ID"="C"."C_ID_IN"(+))
       8 - access("D"."TO_UNIT_ID"="E"."U_ID")
       9 - filter("E"."UNIT_TYPE_ID"=1 OR "E"."UNIT_TYPE_ID"=2 OR "E"."UNIT_TYPE_ID"=3)
      10 - access("C"."T_ID"="D"."T_ID")
      11 - filter("D"."STATUS"=1)
      12 - filter("C"."REJECT"=0)
      13 - filter("from$_subquery$_008"."C_ID_IN"="G"."C_ID_IN"(+))
      14 - access("H"."TO_UNIT_ID"="I"."U_ID")
      15 - filter("I"."UNIT_TYPE_ID"=1 OR "I"."UNIT_TYPE_ID"=2 OR "I"."UNIT_TYPE_ID"=3)
      18 - filter("H"."STATUS"=1)
      19 - access("G"."PREV_T_ID"="from$_subquery$_008"."QCSJ_C000000000600000")
      20 - filter("G"."REJECT"=0 AND "G"."T_ID"="H"."T_ID")Just wanted to say thanks again for any additional help you can provide!
    Edited by: asmallgrin on Feb 3, 2010 7:28 AM

  • Querying 2.5D data in Oracle 11g

    I'm trying to use the SDO_RELATE function on some 2.5D data in 11g and have some questions:
    Lets say if I have two tables with some points in one and two polygons in the other:
    -- TEST_TABLE_A
    CREATE TABLE TEST_TABLE_A (
    VALUE          VARCHAR2(100),
    GEOMETRY     MDSYS.SDO_GEOMETRY);
    -- Metadata 
    INSERT INTO user_sdo_geom_metadata VALUES ('TEST_TABLE_A','GEOMETRY', 
    SDO_DIM_ARRAY(
    SDO_DIM_ELEMENT('X', -10000000, 10000000, .001),
    SDO_DIM_ELEMENT('Y', -10000000, 10000000, .001),
    SDO_DIM_ELEMENT('Z', -100000, 100000, .001))
    , 262152);
    -- Create an index with sdo_indx_dims=3
    CREATE INDEX TEST_TABLE_A_SPIND ON TEST_TABLE_A (GEOMETRY)
    INDEXTYPE IS MDSYS.SPATIAL_INDEX
    PARAMETERS ('sdo_indx_dims=3');
    INSERT INTO TEST_TABLE_A (VALUE, GEOMETRY) VALUES
    ('POINT1', SDO_GEOMETRY(3001, 262152, SDO_POINT_TYPE(561802.689, 839675.061, 1), NULL, NULL));
    INSERT INTO TEST_TABLE_A (VALUE, GEOMETRY) VALUES
    ('POINT2', SDO_GEOMETRY(3001, 262152, SDO_POINT_TYPE(561802, 839675, 1), NULL, NULL));
    INSERT INTO TEST_TABLE_A (VALUE, GEOMETRY) VALUES
    ('POINT3', SDO_GEOMETRY(3001, 262152, SDO_POINT_TYPE(561808.234, 839662.731, 1), NULL, NULL));
    -- TEST_TABLE_A
    CREATE TABLE TEST_TABLE_B (
    VALUE          VARCHAR2(100),
    GEOMETRY     MDSYS.SDO_GEOMETRY);
    -- Metadata
    INSERT INTO user_sdo_geom_metadata VALUES ('TEST_TABLE_B','GEOMETRY', 
    SDO_DIM_ARRAY(
    SDO_DIM_ELEMENT('X', -10000000, 10000000, .001),
    SDO_DIM_ELEMENT('Y', -10000000, 10000000, .001),
    SDO_DIM_ELEMENT('Z', -100000, 100000, .001))
    , 262152);
    -- Create an index with sdo_indx_dims=3
    CREATE INDEX TEST_TABLE_B_SPIND ON TEST_TABLE_B (GEOMETRY)
    INDEXTYPE IS MDSYS.SPATIAL_INDEX
    PARAMETERS ('sdo_indx_dims=3');
    INSERT INTO TEST_TABLE_B (VALUE, GEOMETRY) VALUES
    ('NON-FLAT POLYGON',
    SDO_GEOMETRY(3003, 262152, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(561902.814, 839647.609, 10.022,
    561891.19, 839652.227, 10.424, 561879.129, 839656.427, 10.932, 561867.892, 839659.927, 11.136, 561851.813, 839664.222, 11.594,
    561831.714, 839668.612, 11.797, 561802.689, 839675.061, 11.975, 561778.461, 839680.155, 12.611, 561753.474, 839685.085, 12.153,
    561750.606, 839685.756, 12.026, 561748.963, 839671.963, 15.309, 561747.899, 839659.764, 16.35, 561798.912, 839651.036, 15.801,
    561808.702, 839650.973, 15.225, 561844.265, 839648.912, 14.62, 561874.846, 839647.57, 13.018, 561897.681, 839647.338, 10.704, 561902.814, 839647.609, 10.022))
    INSERT INTO TEST_TABLE_B (VALUE, GEOMETRY) VALUES
    ('FLAT POLYGON',
    SDO_GEOMETRY(3003, 262152, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(561902.814, 839647.609, 1,
    561891.19, 839652.227, 1, 561879.129, 839656.427, 1, 561867.892, 839659.927, 1, 561851.813, 839664.222, 1,
    561831.714, 839668.612, 1, 561802.689, 839675.061, 1, 561778.461, 839680.155, 1, 561753.474, 839685.085, 1,
    561750.606, 839685.756, 1, 561748.963, 839671.963, 1, 561747.899, 839659.764, 1, 561798.912, 839651.036, 1,
    561808.702, 839650.973, 1, 561844.265, 839648.912, 1, 561874.846, 839647.57, 1, 561897.681, 839647.338, 1,
    561902.814, 839647.609, 1))
    COMMIT;So now, lets say I want to find out what polygon interacts with a particular point.
    I would write this query like:
    SELECT     /*+ORDERED*/ b.value
    FROM     TEST_TABLE_b b, TEST_TABLE_a a
    WHERE     sdo_relate (a.geometry, b.geometry, 'MASK=ANYINTERACT QUERYTYPE=WINDOW') = 'TRUE'
    AND      a.value = 'POINT1';Running this I get:
    SELECT  /*+ORDERED*/ b.value
    ERROR at line 1:
    ORA-29902: error in executing ODCIIndexStart() routine
    ORA-13243: specified operator is not supported for 3- or higher-dimensional R-tree
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 333But if I reverse the table order I get the correct answer
    SQL> SELECT      /*+ORDERED*/ b.value
      2  FROM       TEST_TABLE_a a, TEST_TABLE_b b
      3  WHERE      sdo_relate (a.geometry, b.geometry, 'MASK=ANYINTERACT QUERYTYPE=WINDOW') = 'TRUE'
      4  AND                a.value = 'POINT1';
    VALUE
    FLAT POLYGON
    1 row selected.Q1. Why do I get an error if I reverse the table order?
    Then if I try to find what points in the polygons:
    SQL> SELECT      /*+ORDERED*/ a.value
      2  FROM       TEST_TABLE_b b, TEST_TABLE_a a
      3  WHERE      sdo_relate (b.geometry, a.geometry, 'MASK=ANYINTERACT QUERYTYPE=WINDOW') = 'TRUE'
      4  AND                b.value = 'NON-FLAT POLYGON';
    no rows selected
    SQL> SELECT      /*+ORDERED*/ a.value
      2  FROM       TEST_TABLE_b b, TEST_TABLE_a a
      3  WHERE      sdo_relate (b.geometry, a.geometry, 'MASK=ANYINTERACT QUERYTYPE=WINDOW') = 'TRUE'
      4  AND                b.value = 'FLAT POLYGON';
    VALUE
    POINT1
    POINT2
    POINT3
    3 rows selected.So this suggests that the Z value is considered in the SDO_RELATE query.
    Q2. Is there anyway to run an SDO_RELATE query in 11g with 2.5D data, but get it to ignore the Z value?
    I have tried using sdo_indx_dims=2 when creating the indexes, but I get the same result.
    I'm using Enterprise Edition Release 11.1.0.6.0 on Windows server 2003 32bit.

    DBA-009 wrote:
    thx but how i can mask data with above give environment?What does "mask data" mean to you and what is the environment you are referring to?
    Telling us that you are using 11.1 helps. But it is far from a complete description of the environment. What edition of the database are you using? What options are installed? What Enterprise Manager packs are licensed? Is any of this changable? Could you license another option for the database or another pack for Enterprise Manager if that was necessary?
    What does it mean to you to "mask data"? Do you want to store the data on disk and then mask the data in the presentation layer when certain people query it (i.e. store the patient's social security number in the database but only present ***-**- and the last 4 digits to certain sets of employees)? Do you want to hide entire fields from certain people? Do you want to change the data stored in the database when you are refreshing a lower environment with production data? If so, do you need and/or want this process to be either determinisitic or reversable or both?
    Justin

  • How to add Administrative Groups(Roles) in 11g

    Hi,
    I am migrating the 9i query to 11g query. In 9i query I saw gpp table join to get the group owners. In 11g I didn't find the Administrative Groups(Roles) tab or section to assign administarive group to the group(Role in 11g). Where we can find this tab, if tab is not avilable then how can we assign the same group(role)? when data will populate into gpp table in 11g? Please guide me on this.
    Thanks
    Kishore T

    hi,
    are you saying you want to add custom Roles to 11G?
    it's either on the Advanced page or the Administration where you can add new custom Roles.
    there is also the RoleManager Service (API) that can add them programatically.

  • Problem with a query with a BLOB data type

    Hi i've a problem with this query in 11g. R1
    SELECT
          LOGTIMESTAMP,
          LOGTIMEMILLIS,
          MSGID,
          XMLTYPE(MESSAGEBODY, nls_charset_id('AL32UTF8')).getClobVal()  as LLamada
    FROM
        vordel.AUDIT_MESSAGE_PAYLOAD,
        vordel.AUDIT_LOG_POINTS
    WHERE
        AUDIT_LOG_POINTS.LOGPOINTSPK = AUDIT_MESSAGE_PAYLOAD.MP_LOGPOINTSPK AND
        LOGTIMESTAMP between TO_TIMESTAMP('03-12-2011 00:00','DD-MM-YYYY HH24:MI') and  TO_TIMESTAMP('03-12-2011 12:00','DD-MM-YYYY HH24:MI')
         and filtertype = 'LogMessagePayloadFilter'
      and filtername like 'Log Llamada%'MESSAGEBODY: data type of the Column is BLOB
    throw this error after execute the query
    Error:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00200: could not convert from encoding UTF-8 to UCS2
    Error at line 1
    ORA-06512: at "SYS.XMLTYPE", line 283
    ORA-06512: at line 1

    Could you check the BLOB really contains UTF-8 encoded XML?
    What's your database character set?The BLOB contains UTF-8 Encoded
    and the database where i am connectes have AL32UTF8 character set, but my internal instance have "AMERICAN_AMERICA.WE8ISO8859P1"
    that is a problem?
    How could I change the character set of the oracle local client to the character set of the remote oracle data base?

Maybe you are looking for

  • Serial Number Use

    Dear Experts, This is regarding the captioned subject. It has been observed that serial numbers created by the Manufacturing Units for the Production Purpose are being consumed by the Marketing Plants for Making GR at their end. Logically in Our Scen

  • Java syntax error : RFC Lookup

    My UDF Source code has an syntax error: missing return statement } but i can´t find the error. any ideas ? //write your code here String content = ""; MappingTrace importanttrace; importanttrace = container.getTrace(); // filling the string with our

  • Running Photoshop CS4 (and probably CS5) on the 2010 Mac Mini

    I'm looking to buy the new Mac Mini 2010 for use in my work as digital graphics designer. I already considered the base iMac but since I already have a good LCD monitor, keyboard and mouse, all I really need is a good desktop. I'd like to know if the

  • Spa508 firmware upgrade failed

    I bought a spa500ds and need to upgrade the firmware on my 508G to use it. When I try to upgrade to 7.5.4, or 7.5.3 I get a failure.  I was able to upgrade to 7.5.1a fine.  All firmware was downloaded from cisco this morning and unziped I see my tftp

  • Extremely pixelated videos

    I have a problem with CS4. My video files (AVI files captured from mini dv tapes with CS3), when imported into CS 4, they are so pixelated to the point that they are not recognizable. Still images appear to be oked when they are shown in the source m