[Solved] VCenter SQL query eat CPU resources
Does anyone else have a problem with an SQL query in the database of Vcenter eat lots of CPU resources?
We noticed that most of the time a core processor is 100% used by the SQL Server, dig deeper, we found that it is always the same query runs over and over again:
SELECT DISTINCT VPX_SCSI_LUN.UUID AS lunUuid, CASE VPX_HOST_BUS_ADAPTER.VPX_TYPE WHEN N'vim.host.BlockHba' THEN CAST(VPX_PSA_PATH.HOST_ID AS VARCHAR(255)) + '-' + VPX_SCSI_LUN.UUID WHEN N'vim.host.ParallelScsiHba' THEN CAST(VPX_PSA_PATH.HOST_ID AS VARCHAR(255)) + '-' + VPX_SCSI_LUN.UUID ELSE VPX_SCSI_LUN.UUID END AS scsiVolumeEntityId, VPX_DATASTORE.NAME AS datastore, VPXV_DS_LUN_INFO.DATASTORE_ID AS datastoreEntityId FROM VPX_DATASTORE INNER JOIN VPXV_DS_LUN_INFO INNER JOIN VPX_PSA_ADAPTER INNER JOIN VPX_PSA_PATH ON VPX_PSA_ADAPTER.HOST_ID = VPX_PSA_PATH.HOST_ID AND VPX_PSA_ADAPTER.KEY_VAL = VPX_PSA_PATH.ADAPTER_LINK_KEY INNER JOIN VPX_PSA_DEVICE ON VPX_PSA_PATH.LUN_LINK_KEY = VPX_PSA_DEVICE.KEY_VAL AND VPX_PSA_PATH.HOST_ID = VPX_PSA_DEVICE.HOST_ID INNER JOIN VPX_HOST_BUS_ADAPTER ON VPX_PSA_ADAPTER.HOST_ID = VPX_HOST_BUS_ADAPTER.HOST_ID AND VPX_PSA_ADAPTER.LINK_KEY = VPX_HOST_BUS_ADAPTER.KEY_VAL INNER JOIN VPX_SCSI_LUN ON VPX_PSA_DEVICE.HOST_ID = VPX_SCSI_LUN.HOST_ID AND VPX_PSA_DEVICE.LINK_KEY = VPX_SCSI_LUN.KEY_VAL ON VPXV_DS_LUN_INFO.UUID = VPX_SCSI_LUN.UUID AND VPXV_DS_LUN_INFO.HOST_ID = VPX_PSA_PATH.HOST_ID ON VPX_DATASTORE.ID = VPXV_DS_LUN_INFO.DATASTORE_ID WHERE (VPXV_DS_LUN_INFO.DATASTORE_ID IS NOT NULL)
sp_who2 SPID Status Login HostName BlkBy DBName Command CPUTime DiskIO LastBatch ProgramName SPID REQUESTID 52 RUNNABLE NT AUTHORITY\SYSTEM NIF-VCENTER02 . nif-vcenter02_vcdb SELECT 20273570 1436 10/20 12:38:26 Microsoft SQL Server JDBC Driver 52 0
Everyone has noticed this problem with Vcenter 5.5 Build 2183111 (update 2) and MSSQL 2012 SP2 + CU2?
Who like a lot of information storage, perhaps associated refresh "Views of storage" in the vSphere client.
For the mentioned tables, can you update the statistics on them and see if that helps?
Tags: VMware
Similar Questions
-
Find the sql query in statspack report
Salvation;
I have 11.5.10.2 and db version 9iR2... I took a statspack report, and I should find a sql query... But admin, is kill session and I can't see complite sorted SQL query by gets for DB...
so the question is find this query which is kiiled by admin?
Thank youHello
Its bad news to can not find this sql... So normally it istn killed by admin, I could find it from stats$ sql_summary or v$ sql_text?
It is possible.
Note: 153507.1 - Applications Oracle StatsPack
https://metalink2.Oracle.com/MetaLink/PLSQL/ml2_documents.showDocument?p_database_id=not&P_ID=153507.1And another question... If I have a sql printing is eating my cpu or my server resource, how do I find this sql? Under what title I can find in the statspack report
Refer to:
Note: 232443.1 - how to identify the resource intensive SQL for Tuning
https://metalink2.Oracle.com/MetaLink/PLSQL/ml2_documents.showDocument?p_database_id=not&P_ID=232443.1Kind regards
Hussein -
SQL query for the region of the tree
Hello
I was wondering if someone is able to help me work on a SQL query, to format the data in the table required in a part of the tree... I've never used a tree and I'm fighting to get the right data (if possible).
The data in the table looks like this:
I want to put it in a tree, using level 1 level6 with a final layout that would look like this:
As you can see, the data are formatted in level6 down in the tree, but are filled in the table from level 1. Not all of the columns will be filled, so level2 for anyone 4 (France) is the equivalent of level in the tree like level6 to person 1 (Spain).
This is Apex 4.2.5
Oracle 11.2.0.3.0
Sample data:
CREATE TABLE employees ( employee VARCHAR2(100), level1 VARCHAR2(100), level2 VARCHAR2(100), level3 VARCHAR2(100), level4 VARCHAR2(100), level5 VARCHAR2(100), level6 VARCHAR2(100) ); INSERT INTO employees (employee, level1, level2, level3, level4, level5, level6) VALUES ('Person1','Team One','Recruitment','Human Resources','Fictituous Company','Murcia','Spain'); INSERT INTO employees (employee, level1, level2, level3, level4, level5, level6) VALUES ('Person2','Team Four','Testing','IT','Big Corporate','Hanover','Germany'); INSERT INTO employees (employee, level1, level2, level3, level4, level5, level6) VALUES ('Person3','Big Corporate','Hanover','Germany', null, null, null); INSERT INTO employees (employee, level1, level2, level3, level4, level5, level6) VALUES ('Person4','Brittany','France', null, null, null, null); INSERT INTO employees (employee, level1, level2, level3, level4, level5, level6) VALUES ('Person5','Team Three','Testing','IT','Big Corporate','Hanover','Germany'); INSERT INTO employees (employee, level1, level2, level3, level4, level5, level6) VALUES ('Person6','Public Relations','Government Agency','Brittany','France', null, null);
Added example given.
Hello
Apex-user wrote:
Thanks Frank, this is a good example, I can work with that! Your assumptions are correct.
A question I came, however, is that I have a data segment that comes across poorly formatted so to speak... where only the lower levels (1-2, etc.) have been filled from the bottom up.
An example of this data would be:
- INSERT INTO employees (employee, level 1, 2, level3, level4, level5, level6) VALUES ('Person7', 'One Team', 'Test', null, null, null, null);
As you can see that if you rerun the select, the test team is now duplicated, both at the level of the root in the tree as it should.
You are not sure if the sql can be adjusted to account for this, or if it's too hard?
It is obviously a question of data and I am trying to solve this separately (extracted data from another system out of my control).
Thank you!
Sorry, I'm confused.
You say that my assumptions were correct. What includes supported that "If test ' occurs under 'IT' in a row, then the extent of the 'Testing' occurs, it must be under"IT "? Right after you say that assumptions are correct, you give an example where 'Testing' occurs under 'IT' to a single line, but it is not less 'IT' to another line and where is 'One Team' under 'Testing' in a line, but is 'One Team' under 'Recruitment' in another row.
When a situation like this occurs, how you cope? Whenever you have a problem, please post the exact results you want from the given sample data, and an explanation of how you get these results. If you don't know about what would be the ideal results, or if you are flexible on the exact results, then at least give an example and explain your reasons.
Maybe you want to change the got_parent of subquery like this:
WITH unpivoted_data AS
(
SELECT *.
Employees
UNPIVOT (node_name
FOR lvl (level1 AS 1
level2 AS 2
level3 AS 3
level4 AS 4
level5 AS 5
level6 AS-6
)
)
)
got_parent AS
(
SELECT c.node_name
MIN (p.node_name) AS a parent
Of unpivoted_data c
LEFT OUTER JOIN unpivoted_data p ON p.employee = c.employee
AND p.lvl = c.lvl + 1
GROUP BY c.node_name
)
SELECT LPAD (' ' ')
2 * (LEVEL - 1)
) || Node_name AS entity
OF got_parent
START WITH parent IS NULL
Parent = node_name PRIOR CONNECTION
;
In this way, if 'Test' is current 'IT' in one line, but not under what in another line, whether under would consider the 'IT' request and not to be a root. If 'One Team' sudden 'Testing' in a line, but under "Recruitment" in another line, it will be (arbitrarily) consider it under "recruitment".
-
AWR show this sql as more CPU consuming sql. Is - this need for sql tunning?
Hello
Awr showing this sql as the consumer of CPU above reports
Please consider me as a newbie and help me understand this.
Thanking you...
SQL full = >SQL ordered by CPU Time DB/Inst: Snaps: -> Resources reported for PL/SQL code includes the resources used by all SQL statements called by the code. -> % Total DB Time is the Elapsed Time of the SQL statement divided into the Total Database Time multiplied by 100 CPU Elapsed CPU per % Total Time (s) Time (s) Executions Exec (s) DB Time SQL Id ---------- ---------- ------------ ----------- ------- ------------- 2,658 2,665 1 2658.18 5.7 5aawbyzqjk8by select distinct trp.site_id from tas_receipts_process trp , tas_tsa_info tti, ta s_site ts where trp.tsa_id = tti.tsa_id and tti.status = 1 and ts.site_id = trp .site_id and (tti.max_install != trp.pushed_rsn and ((tti.max_install = 0 and (trp.pushed_rsn - trp.curr_rsn) < ts.workahead_count * :1) or (tti.max_install
get the plan of the explain for the above sql command = >select distinct trp.site_id from tas_receipts_process trp , tas_tsa_info tti, tas_site ts where trp.tsa_id = tti.tsa_id and tti.status = 1 and ts.site_id = trp.site_id and ( tti.max_install != trp.pushed_rsn and ( (tti.max_install = 0 and (trp.pushed_rsn - trp.curr_rsn) < ts.workahead_count * :1 ) or (tti.max_install > 0 and (trp.pushed_rsn - trp.curr_rsn) < ts.workahead_count * :2 ) or (tti.max_install = trp.pushed_rsn and tti.max_install <> 0 ) ) ) or (trp.pushed_time != ( to_date(tti.created_date,'dd-MON-yyhh24:mi:ss') + (1/24/60) * ts.workahead_time ) and ( ( to_date(sysdate,'dd-MON-yyhh24:mi:ss') + (1/24/60) * :3 ) > trp.pushed_time ) )
sizes of the objects concerned = >QL> SELECT plan_table_output FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR('g6c8y31xr06vp',0,'ALL')); PLAN_TABLE_OUTPUT ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ SQL_ID g6c8y31xr06vp, child number 0 ------------------------------------- select distinct trp.site_id from tas_receipts_process trp , tas_tsa_info tti, tas_site ts where trp.tsa_id = tti.tsa_id and tti.status = 1 and ts.site_id = trp.site_id and (tti.max_install != trp.pushed_rsn and ((tti.max_install = 0 and (trp.pushed_rsn - trp.curr_rsn) < ts.workahead_count * :1) or (tti.max_install > 0 and (trp.pushed_rsn - trp.curr_rsn) < ts.workahead_count * :2) or (tti.max_install = trp.pushed_rsn and tti.max_install <> 0 ) )) or (trp.pushed_time != (to_date(tti.created_date,'dd-MON-yy hh24:mi:ss') + (1/24/60) * ts.workahead_time) and ((to_date(sysdate,'dd-MON-yy hh24:mi:ss') + (1/24/60) * :3) > trp.pushed_time)) Plan hash value: 2862358316 ------------------------------------------------------------------------------------------------ | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ------------------------------------------------------------------------------------------------ | 0 | SELECT STATEMENT | | | | 601K(100)| | | 1 | HASH UNIQUE | | 4 | 216 | 601K (10)| 02:00:14 | | 2 | CONCATENATION | | | | | | | 3 | NESTED LOOPS | | 200M| 10G| 579K (6)| 01:55:52 | | 4 | MERGE JOIN CARTESIAN| | 2849 | 99715 | 12 (0)| 00:00:01 | | 5 | TABLE ACCESS FULL | TAS_SITE | 7 | 70 | 3 (0)| 00:00:01 | | 6 | BUFFER SORT | | 407 | 10175 | 9 (0)| 00:00:01 | |* 7 | TABLE ACCESS FULL | TAS_RECEIPTS_PROCESS | 407 | 10175 | 1 (0)| 00:00:01 | |* 8 | TABLE ACCESS FULL | TAS_TSA_INFO | 70411 | 1306K| 203 (6)| 00:00:03 | |* 9 | HASH JOIN | | 2 | 108 | 203 (2)| 00:00:03 | |* 10 | HASH JOIN | | 407 | 14245 | 7 (15)| 00:00:01 | | 11 | TABLE ACCESS FULL | TAS_SITE | 7 | 70 | 3 (0)| 00:00:01 | | 12 | TABLE ACCESS FULL | TAS_RECEIPTS_PROCESS | 407 | 10175 | 3 (0)| 00:00:01 | |* 13 | TABLE ACCESS FULL | TAS_TSA_INFO | 21474 | 398K| 196 (2)| 00:00:03 | ------------------------------------------------------------------------------------------------ Query Block Name / Object Alias (identified by operation id): ------------------------------------------------------------- 1 - SEL$1 5 - SEL$1_1 / TS@SEL$1 7 - SEL$1_1 / TRP@SEL$1 8 - SEL$1_1 / TTI@SEL$1 11 - SEL$1_2 / TS@SEL$1_2 12 - SEL$1_2 / TRP@SEL$1_2 13 - SEL$1_2 / TTI@SEL$1_2 Predicate Information (identified by operation id): --------------------------------------------------- 7 - filter("TRP"."PUSHED_TIME"<TO_DATE(TO_CHAR(SYSDATE@!),'dd-MON-yy hh24:mi:ss')+.000694444444444444444444444444444444444445*:3) 8 - filter("TRP"."PUSHED_TIME"<>TO_DATE(INTERNAL_FUNCTION("TTI"."CREATED_DATE"),'dd-M ON-yy hh24:mi:ss')+.000694444444444444444444444444444444444445*"TS"."WORKAHEAD_TIME") 9 - access("TRP"."TSA_ID"="TTI"."TSA_ID") filter(("TTI"."MAX_INSTALL"<>"TRP"."PUSHED_RSN" AND (("TTI"."MAX_INSTALL"=0 AND "TRP"."PUSHED_RSN"-"TRP"."CURR_RSN"<"TS"."WORKAHEAD_COUNT"*:1) OR ("TTI"."MAX_INSTALL">0 AND "TRP"."PUSHED_RSN"-"TRP"."CURR_RSN"<"TS"."WORKAHEAD_COUNT"*:2 ) OR ("TTI"."MAX_INSTALL"="TRP"."PUSHED_RSN" AND "TTI"."MAX_INSTALL"<>0)) AND (LNNVL("TRP"."PUSHED_TIME"<TO_DATE(TO_CHAR(SYSDATE@!),'dd-MON-yy hh24:mi:ss')+.000694444444444444444444444444444444444445*:3) OR LNNVL("TRP"."PUSHED_TIME"<>TO_DATE(INTERNAL_FUNCTION("TTI"."CREATED_DATE"),'dd-MON-yy hh24:mi:ss')+.000694444444444444444444444444444444444445*"TS"."WORKAHEAD_TIME")))) 10 - access("TS"."SITE_ID"="TRP"."SITE_ID") 13 - filter("TTI"."STATUS"=1) Column Projection Information (identified by operation id): ----------------------------------------------------------- 1 - "TRP"."SITE_ID"[NUMBER,22] 2 - "TS"."SITE_ID"[NUMBER,22], "TS"."WORKAHEAD_COUNT"[NUMBER,22], "TS"."WORKAHEAD_TIME"[NUMBER,22], "TRP"."TSA_ID"[NUMBER,22], "TRP"."SITE_ID"[NUMBER,22], "TRP"."CURR_RSN"[NUMBER,22], "TRP"."PUSHED_RSN"[NUMBER,22], "TRP"."PUSHED_TIME"[DATE,7], "TTI"."TSA_ID"[NUMBER,22], "TTI"."STATUS"[NUMBER,22], "TTI"."MAX_INSTALL"[NUMBER,22], "TTI"."CREATED_DATE"[DATE,7] 3 - "TS"."SITE_ID"[NUMBER,22], "TS"."WORKAHEAD_COUNT"[NUMBER,22], "TS"."WORKAHEAD_TIME"[NUMBER,22], "TRP"."TSA_ID"[NUMBER,22], "TRP"."SITE_ID"[NUMBER,22], "TRP"."CURR_RSN"[NUMBER,22], "TRP"."PUSHED_RSN"[NUMBER,22], "TRP"."PUSHED_TIME"[DATE,7], "TTI"."TSA_ID"[NUMBER,22], "TTI"."STATUS"[NUMBER,22], "TTI"."MAX_INSTALL"[NUMBER,22], "TTI"."CREATED_DATE"[DATE,7] 4 - "TS"."SITE_ID"[NUMBER,22], "TS"."WORKAHEAD_COUNT"[NUMBER,22], "TS"."WORKAHEAD_TIME"[NUMBER,22], "TRP"."TSA_ID"[NUMBER,22], "TRP"."SITE_ID"[NUMBER,22], "TRP"."CURR_RSN"[NUMBER,22], "TRP"."PUSHED_RSN"[NUMBER,22], "TRP"."PUSHED_TIME"[DATE,7] 5 - "TS"."SITE_ID"[NUMBER,22], "TS"."WORKAHEAD_COUNT"[NUMBER,22], "TS"."WORKAHEAD_TIME"[NUMBER,22] 6 - (#keys=0) "TRP"."TSA_ID"[NUMBER,22], "TRP"."SITE_ID"[NUMBER,22], "TRP"."CURR_RSN"[NUMBER,22], "TRP"."PUSHED_RSN"[NUMBER,22], "TRP"."PUSHED_TIME"[DATE,7] 7 - "TRP"."TSA_ID"[NUMBER,22], "TRP"."SITE_ID"[NUMBER,22], "TRP"."CURR_RSN"[NUMBER,22], "TRP"."PUSHED_RSN"[NUMBER,22], "TRP"."PUSHED_TIME"[DATE,7] 8 - "TTI"."TSA_ID"[NUMBER,22], "TTI"."STATUS"[NUMBER,22], "TTI"."MAX_INSTALL"[NUMBER,22], "TTI"."CREATED_DATE"[DATE,7] 9 - (#keys=1) "TRP"."TSA_ID"[NUMBER,22], "TTI"."TSA_ID"[NUMBER,22], "TS"."SITE_ID"[NUMBER,22], "TRP"."SITE_ID"[NUMBER,22], "TS"."WORKAHEAD_TIME"[NUMBER,22], "TS"."WORKAHEAD_COUNT"[NUMBER,22], "TRP"."PUSHED_RSN"[NUMBER,22], "TRP"."PUSHED_TIME"[DATE,7], "TRP"."CURR_RSN"[NUMBER,22], "TTI"."CREATED_DATE"[DATE,7], "TTI"."STATUS"[NUMBER,22], "TTI"."MAX_INSTALL"[NUMBER,22] 10 - (#keys=1) "TS"."SITE_ID"[NUMBER,22], "TRP"."SITE_ID"[NUMBER,22], "TS"."WORKAHEAD_TIME"[NUMBER,22], "TS"."WORKAHEAD_COUNT"[NUMBER,22], "TRP"."TSA_ID"[NUMBER,22], "TRP"."PUSHED_TIME"[DATE,7], "TRP"."CURR_RSN"[NUMBER,22], "TRP"."PUSHED_RSN"[NUMBER,22] 11 - "TS"."SITE_ID"[NUMBER,22], "TS"."WORKAHEAD_COUNT"[NUMBER,22], "TS"."WORKAHEAD_TIME"[NUMBER,22] 12 - "TRP"."TSA_ID"[NUMBER,22], "TRP"."SITE_ID"[NUMBER,22], "TRP"."CURR_RSN"[NUMBER,22], "TRP"."PUSHED_RSN"[NUMBER,22], "TRP"."PUSHED_TIME"[DATE,7] 13 - "TTI"."TSA_ID"[NUMBER,22], "TTI"."STATUS"[NUMBER,22], "TTI"."MAX_INSTALL"[NUMBER,22], "TTI"."CREATED_DATE"[DATE,7] 105 rows selected.
Please suggest how to tune this above SQLOWNER SEGMENT_NAME SEGMENT_TYPE TABLESPACE_NAME EXTENTS BYTES_ --------------- ------------------------------ -------------------- -------------------- ------- ---------------- AZD_SCHM TAS_TSA_INFO TABLE TATSU_DATA_TS 22 7,340,032 AZD_SCHM TAS_TSA_INFO_PK INDEX TATSU_DATA_TS 17 2,097,152 --------------- ------------------------------ -------------------- -------------------- ------- ---------------- AZD_SCHM TAS_RECEIPTS_PROCESS TABLE TATSU_DATA_TS 1 65,536 AZD_SCHM TAS_RECEIPTS_PROCESS_IDX INDEX TATSU_INDEX_TS 1 65,536 --------------- ------------------------------ -------------------- -------------------- ------- ---------------- AZD_SCHM TAS_SITE TABLE TATSU_DATA_TS 1 65,536 AZD_SCHM TAS_SITE_NAME_UNQ INDEX TATSU_INDEX_TS 1 65,536 AZD_SCHM TAS_SITE_PK INDEX TATSU_DATA_TS 1 65,536 --------------- ------------------------------ -------------------- -------------------- ------- ----------------
Above sql plan looks good
Any comment and help is appreciated highely.
Thank you and best regards,
IVWHello
It is a production system?
Are you a license to use the AWR?concerning
Alan
-
After migrating my APEX 4.1 application to a new environment, one classic report displays a "cannot parse the SQL query: ORA-00942: table or view does not exist" error when the page is displayed. Change the region to report SQL source to somehow (e.g., remove spaces, changing the order of the variables in the WHERE clause) immediately solves the problem, but by returning to the source of the region causes the report error again (the source region valid code without error, however).
Throw the error message:
Select v.id,
v.Col1
of view_vw v
where (: P1_FILTER is null or)
v.col2 = :P1_FILTER)
Do not throw error:
Select v.id,
v.Col1
of view_vw v
where (:P1_FILTER is null or)
v.col2 = :P1_FILTER)
Changing the order of column in the report has the same effect; i.e. He arranges, but return back to the original column order causes the error to display.
It's as if a cached result for the correct select statement used by the report is displayed. However, the application does not use the caching of page/region. Any ideas of what could be the cause?
He solved. Ultimately, all that was necessary was to clear the DB cache using:
alter system flush shared_pool;
-
Pool pane there problem with long sql query?
Hello
I use Jdeveloper 11.1.2.2.0
In the application I'm developing, there is a long sql query to call (it's a function from a package, which may take a few minutes to run) and I want to display a progress bar for the user.
The progress bar component is a "progress indicator" and the percentage of achivement is refreshed by a component 'pool' with 1-second interval.
The two components are connected in a javabean.
The function with the sql query is the javabean too.
To run the sql query that is long on background I am calling from a thread, and the pool component get the advancement of the percentage of a pipe filled with the sql function.
If the function to run is just a long loop of java operations the progress bar works fine, but if I put my long sql query instead, stop listener pool should be performed to stop long, s sql queryo progress are updated only at the end of the long sql query.
You have any ideas?
Thank you
Thanks for your replies. Unfortunately, it was not the solution to my case, sql procedures to block the entire application while ADF awaits them at the end...
To solve my problem, I finally used a PL SQL Job to call my sql procedure (dbms_job.submit).
The application is released right after the call and the component of the pool is not more secure!
Kind regards
Yann
-
Hi all..
It's SOA 11.1.1.7... I created the schema and storage via RCU but when I try to configure JDBS schema components... his throw this error:
CFGFWK-60850: the Test failed!
CFGFWK-60853: A connection to the database, but no lines have been returned to the examination of the SQL query.
I created 3 users of UCR and who were all successful, because I have no error... of these three alone is managed in the configuration tree SOA...
No idea why like that...
Thank you
Aerts
This that I solved it by installing EMP 11.1.2.2 with UCR and SOA 11.1.1.6...
-
performance issue with the Oracle SQL query
Dears
Good evening
I am new to begin to use Oracle SQL, I have a sql query which takes longer to run in production.
Each table in the query contains 1.2 million records and DBA suggested using the "Oracle - tips. I don't have good knowledge on this subject and the difficulties to implement this advice for imrpovise performance. In the product the jobs Informatica are failed and stuck with this problem of query performance.
I ask this forum for an emergency for me to solve this problem by using "advice". kindly help me.
SELECT
CASE.ID,
CASE. DTYPE,
CASE. Version
CASE. EXTERNAL_REF,
CASE. CREATION_TS,
RQ. TYPE
Of
PAS_CASE CASE,
AS_REQUEST RQ,
CN PAS_CONTEXT
where rq.case_id = case.id
AND rq.id = cn.request_id
and rq. DTYPE = "MAINREQUEST."
and rq. TYPE in
(
'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.)
and CN. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
AND CAST (CN. CREATION_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)
AND
CAST (CN. CREATION_TS AS DATE) < TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)-2nd request
SELECT
RA.ID,
RHEUMATOID ARTHRITIS. Version
RHEUMATOID ARTHRITIS. REQUEST_ID,
RA.NAME,
RHEUMATOID ARTHRITIS. VALUE,
RHEUMATOID ARTHRITIS. LOB_ID,
RHEUMATOID ARTHRITIS. DTYPE,
RHEUMATOID ARTHRITIS. CREATION_TS,
TASK. MAIN_REQ_TYPE
PAS_REQUESTATTRIBUTE RA
Join
(
Select tsk.ID, tsk. TYPE, main_req_type main_req.
of tsk PAS_REQUEST
Join
(
Select cn.id as context_id, rq. TYPE main_req_type
of PAS_REQUEST rq
Cn PAS_CONTEXT
where rq.id = cn.request_id
and rq. DTYPE = "MAINREQUEST."
and rq. TYPE in
(
'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.
)
and cn. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
and CAST (cn. END_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)
and CAST (cn. END_TS AS DATE) < = TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)
and cn.ID between the 20141999999999999 AND 20141800000000000
and rq.ID between the 20141999999999999 AND 20141800000000000) main_req
On tsk.parent_context_id = main_req.context_id
and tsk. DTYPE in ('ANALYSIS_TASK', 'DECISION_TASK')
and tsk.ID between $$ LOW_ID1 AND $$ HIGH_ID1
) task
on the RA REQUEST_ID = task.ID
and RA.ID between $$ LOW_ID1 AND $$ HIGH_ID1
UNIONSELECT
RA.ID,
RHEUMATOID ARTHRITIS. Version
RHEUMATOID ARTHRITIS. REQUEST_ID,
RA.NAME,
RHEUMATOID ARTHRITIS. VALUE,
RHEUMATOID ARTHRITIS. LOB_ID,
RHEUMATOID ARTHRITIS. DTYPE,
RHEUMATOID ARTHRITIS. CREATION_TS,
MAIN_REQ. TYPE
PAS_REQUESTATTRIBUTE RA
Join
(
Select rq.id, rq.type
of PAS_REQUEST rq
Cn PAS_CONTEXT
where rq.id = cn.request_id
and rq. DTYPE = "MAINREQUEST."
and rq. TYPE in
(
'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.
)
and cn. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
and CAST (cn. END_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)
and CAST (cn. END_TS AS DATE) < = TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)
and cn.ID between the 20141999999999999 AND 20141800000000000
and rq.ID between the 20141999999999999 AND 20141800000000000
) main_req
on the RA REQUEST_ID = main_req.ID-3rd request
SELECT
RB.ID,
RB. DTYPE,
RB. Version
RB. TYPE,
RB. CREATION_TS,
RB. TASK_ID,
RB. Color
RB. GLOBAL_RESULT,
TASK. MAIN_REQ_TYPE
Of
PAS_RESULTBLOCK RB
Join
(
Select tsk.ID, tsk. TYPE, main_req_type main_req.
of tsk PAS_REQUEST
Join
(
Select cn.id as context_id, rq. TYPE main_req_type
of PAS_REQUEST rq
Cn PAS_CONTEXT
where rq.id = cn.request_id
and rq. DTYPE = "MAINREQUEST."
and rq. TYPE in
(
'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.
)
and cn. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
and CAST (cn. END_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)
and CAST (cn. END_TS AS DATE) < = TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)
and cn.ID between the 20141999999999999 AND 20141800000000000
and rq.ID between the 20141999999999999 AND 20141800000000000
) main_req
On tsk.parent_context_id = main_req.context_id
and tsk. DTYPE in ('ANALYSIS_TASK', 'DECISION_TASK')
and tsk.ID between $$ LOW_ID1 AND $$ HIGH_ID1
) task
We rb.task_id = task.ID
and rb.ID between $$ LOW_ID1 AND $$ HIGH_ID1
and RB. TYPE is not null
and RB. TYPE IN
(
'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.
)
UNION
SELECT
RB.ID,
RB. DTYPE,
RB. Version
RB. TYPE,
RB. CREATION_TS,
RB. TASK_ID,
RB. Color
RB. GLOBAL_RESULT,
TASK. MAIN_REQ_TYPE
Of
PAS_RESULTBLOCK RB
Join
(
Select tsk.ID, tsk. TYPE, main_req_type main_req.
of tsk PAS_REQUEST
Join
(
Select cn.id as context_id, rq. TYPE main_req_type
of PAS_REQUEST rq
Cn PAS_CONTEXT
where rq.id = cn.request_id
and rq. DTYPE = "MAINREQUEST."
and rq. TYPE in
(
'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.
)
and cn. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
and CAST (cn. END_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)
and CAST (cn. END_TS AS DATE) < = TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)
and cn.ID between the 20141999999999999 AND 20141800000000000
and rq.ID between the 20141999999999999 AND 20141800000000000
) main_req
On tsk.parent_context_id = main_req.context_id
and tsk. DTYPE in ('ANALYSIS_TASK', 'DECISION_TASK')
and tsk.ID between $$ LOW_ID1 AND $$ HIGH_ID1
) task
We rb.task_id = task.ID
and rb.ID between $$ LOW_ID1 AND $$ HIGH_ID1
and RB. TYPE is nullSELECT
RB.ID,
RB. DTYPE,
RB. Version
RB. TYPE,
RB. CREATION_TS,
RB. TASK_ID,
RB. Color
RB. GLOBAL_RESULT,
TASK. MAIN_REQ_TYPE
Of
PAS_RESULTBLOCK RB
Join
(
Select tsk.ID, tsk. TYPE, main_req_type main_req.
of tsk PAS_REQUEST
Join
(
Select cn.id as context_id, rq. TYPE main_req_type
of PAS_REQUEST rq
Cn PAS_CONTEXT
where rq.id = cn.request_id
and rq. DTYPE = "MAINREQUEST."
and rq. TYPE in
(
'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.
)
and cn. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
and CAST (cn. END_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)
and CAST (cn. END_TS AS DATE) < = TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)
and cn.ID between the 20141999999999999 AND 20141800000000000
and rq.ID between the 20141999999999999 AND 20141800000000000
) main_req
On tsk.parent_context_id = main_req.context_id
and tsk. DTYPE in ('ANALYSIS_TASK', 'DECISION_TASK')
and tsk.ID between $$ LOW_ID1 AND $$ HIGH_ID1
) task
We rb.task_id = task.ID
and rb.ID between $$ LOW_ID1 AND $$ HIGH_ID1
and RB. TYPE is not null
and RB. TYPE IN
(
'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.
)
UNION
SELECT
RB.ID,
RB. DTYPE,
RB. Version
RB. TYPE,
RB. CREATION_TS,
RB. TASK_ID,
RB. Color
RB. GLOBAL_RESULT,
TASK. MAIN_REQ_TYPE
Of
PAS_RESULTBLOCK RB
Join
(
Select tsk.ID, tsk. TYPE, main_req_type main_req.
of tsk PAS_REQUEST
Join
(
Select cn.id as context_id, rq. TYPE main_req_type
of PAS_REQUEST rq
Cn PAS_CONTEXT
where rq.id = cn.request_id
and rq. DTYPE = "MAINREQUEST."
and rq. TYPE in
(
'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.
)
and cn. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
and CAST (cn. END_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)
and CAST (cn. END_TS AS DATE) < = TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)
and cn.ID between the 20141999999999999 AND 20141800000000000
and rq.ID between the 20141999999999999 AND 20141800000000000
) main_req
On tsk.parent_context_id = main_req.context_id
and tsk. DTYPE in ('ANALYSIS_TASK', 'DECISION_TASK')
and tsk.ID between $$ LOW_ID1 AND $$ HIGH_ID1
) task
We rb.task_id = task.ID
and rb.ID between $$ LOW_ID1 AND $$ HIGH_ID1
and RB. TYPE is null
-4th query
SELECT
RI.ID,
UII DTYPE,
UII Version
UII RESULTBLOCK_ID,
RI.NAME,
UII VALUE,
UII UNIT,
UII Color
UII LOB_ID,
UII CREATION_TS,
UII SEQUENCE,
UII DETAILLEVEL,
RES_BLK. MAIN_REQ_TYPE
Of
RI PAS_RESULTITEM
Join
(
Select
rb.ID, rb. TYPE rb_type, task. TYPE as the task_type, task. pas_resultblock rb main_req_type
Join
(
Select tsk.ID, tsk. TYPE, main_req_type main_req.
of tsk PAS_REQUEST
Join
(
Select cn.id as context_id, rq. TYPE main_req_type
of PAS_REQUEST rq
Cn PAS_CONTEXT
where rq.id = cn.request_id
and rq. DTYPE = "MAINREQUEST."
and rq. TYPE in
(
'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.
)
and cn. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
and CAST (cn. END_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)
and CAST (cn. END_TS AS DATE) < = TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)
and cn.ID between the 20141999999999999 AND 20141800000000000
and rq.ID between the 20141999999999999 AND 20141800000000000
) main_req
On tsk.parent_context_id = main_req.context_id
and tsk. DTYPE in ('ANALYSIS_TASK', 'DECISION_TASK')
and tsk.ID between the 20141999999999999 AND 20141800000000000
) task
We rb.task_id = task.ID
and rb.ID between the 20141999999999999 AND 20141800000000000
and RB. TYPE IN
(
'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.
)
) res_blk
On ri.resultblock_id = res_blk.ID
where IN RI.NAME
(
'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.
)
and RI.ID between the 20141999999999999 AND 20141800000000000
and RI.NAME is not null
UNIONSelect
RI.ID,
UII DTYPE,
UII Version
UII RESULTBLOCK_ID,
RI.NAME,
UII VALUE,
UII UNIT,
UII Color
UII LOB_ID,
UII CREATION_TS,
UII SEQUENCE,
UII DETAILLEVEL,
RES_BLK. MAIN_REQ_TYPE
of pas_resultitem ri
Join
(
Select
rb.ID, rb. TYPE rb_type, task. TYPE as the task_type, task. pas_resultblock rb main_req_type
Join
(
Select tsk.ID, tsk. TYPE, main_req_type main_req.
of tsk PAS_REQUEST
Join
(
Select cn.id as context_id, rq. TYPE main_req_type
of PAS_REQUEST rq
Cn PAS_CONTEXT
where rq.id = cn.request_id
and rq. DTYPE = "MAINREQUEST."
and rq. TYPE in
(
'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.
)
and cn. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
and CAST (cn. END_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)
and CAST (cn. END_TS AS DATE) < = TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)
and cn.ID between the 20141999999999999 AND 20141800000000000
and rq.ID between the 20141999999999999 AND 20141800000000000
) main_req
On tsk.parent_context_id = main_req.context_id
and tsk. DTYPE in ('ANALYSIS_TASK', 'DECISION_TASK')
and tsk.ID between the 20141999999999999 AND 20141800000000000
) task
We rb.task_id = task.ID
and rb.ID between the 20141999999999999 AND 20141800000000000
) res_blk
On ri.resultblock_id = res_blk.ID
where RI.ID between 20141800000000000 20141999999999999 AND
and RI.NAME is null-REQUEST OF 5HT
SELECT
TSK.ID,
TSK. Version
TSK. DTYPE,
TSK. CASE_ID,
TSK. TYPE,
TSK. CORRELATION_ID,
TSK. INITIATOR,
TSK. EXECUTOR,
TSK. CATEGORY,
TSK. PARENT_CONTEXT_ID,
TSK. CREATION_TS,
MAIN_REQ. MAIN_REQ_TYPE
Of
TSK PAS_REQUEST
Join
(
Select cn.id as context_id, rq. TYPE main_req_type
of PAS_REQUEST rq
Cn PAS_CONTEXT
where rq.id = cn.request_id
and rq. DTYPE = "MAINREQUEST."
and rq. TYPE in
(
'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.
)
and cn. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
and CAST (cn. END_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)
and CAST (cn. END_TS AS DATE) < = TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)
and cn.ID between the 20141999999999999 AND 20141800000000000
and rq.ID between the 20141999999999999 AND 20141800000000000
) main_req
On tsk.parent_context_id = main_req.context_id
and tsk. DTYPE in ('ANALYSIS_TASK', 'DECISION_TASK')
and tsk.ID between $$ LOW_ID1 AND $$ HIGH_ID1
UNION
Select
MREQ.ID,
MREQ. Version
MREQ. DTYPE,
MREQ. CASE_ID,
MREQ. TYPE,
MREQ. CORRELATION_ID,
MREQ. INITIATOR,
MREQ. EXECUTOR,
MREQ. CATEGORY,
MREQ. PARENT_CONTEXT_ID,
MREQ. CREATION_TS,
MREQ. TYPE
of PAS_REQUEST mreq
Cn PAS_CONTEXT
where mreq.id = cn.request_id
and mreq. DTYPE = "MAINREQUEST."
and mreq. TYPE in
(
'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.
)
and cn. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
and CAST (cn. END_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)
and CAST (cn. END_TS AS DATE) < = TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)
and cn.ID between the 20141999999999999 AND 20141800000000000
and mreq.ID between the 20141999999999999 AND 20141800000000000
Tips will be may not be necessary (proportional to the cardinalities need)
Select pc.id, pc.dtype, pc.version, pc.external_ref, pc.creation_ts, rq.type
from pas_case
as_request rq,
CN pas_context
where rq.case_id = pc.id
and rq.id = cn.request_id
and rq.dtype = 'MAINREQUEST. '
and rq.type in ('bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution', ' bgc.tbf.repair.vap',
'bgc.dar.e2etest ',' bgc.dar.e2etest.intermediate.execution', ' bgc.cbm ',.
'bgc.dar.e2etest.preparation ','bgc.chc.polling '.
)
and cn.status in ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
and cn.creation_ts > = to_timestamp ('2014-05-06 00:00:00 ',' yyyy-mm-dd hh24:mi:ss')
and cn.creation_ts<= to_timestamp('2014-05-06="" 23:59:59.999999','yyyy-mm-dd="">=>
-2nd request
with
main_request as
(select / * + materialize * /)
CN.ID as context_id, rq.type as main_req_type
of pas_request rq
Join
CN pas_context
On rq.id = cn.request_id
and rq.dtype = 'MAINREQUEST. '
and rq.type in ('bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution', ' bgc.chc.polling',
'bgc.tbf.repair.vap ',' bgc.dar.e2etest', ' bgc.dar.e2etest.intermediate.execution ',.
'bgc.cbm ','bgc.dar.e2etest.preparation '.
)
and cn.status in ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
and cn.end_ts > = to_timestamp ('2014-05-06 00:00:00 ',' yyyy-mm-dd hh24:mi:ss')
and cn.end_ts<= to_timestamp('2014-05-06="" 23:59:59.999999','yyyy-mm-dd="">=>
and cn.id between 20141800000000000 and 20141999999999999
and rq.id between 20141800000000000 and 20141999999999999
)
Select ra.id, ra.version, ra.request_id, ra.name, ra.value, ra.lob_id, ra.dtype, ra.creation_ts, task.main_req_type
of pas_requestattribute ra
Join
(select tsk.id, tsk.type, main_req.main_req_type
from pas_request tsk
Join
main_request main_req
On tsk.parent_context_id = main_req.context_id
and tsk.dtype in ('ANALYSIS_TASK', 'DECISION_TASK')
and tsk.id between $$ low_id1 and $$ high_id1
) task
We ra.request_id = task.id
and ra.id between $$ low_id1 and $$ high_id1
Union
Select ra.id, ra.version, ra.request_id, ra.name, ra.value, ra.lob_id, ra.dtype, ra.creation_ts, main_req.type
of pas_requestattribute ra
Join
main_request main_req
On ra.request_id = main_req.context_id
-3rd request
Select rb.id, rb.dtype, rb.version, rb.type, rb.creation_ts, rb.task_id, rb.color, rb.global_result, task.main_req_type
of pas_resultblock rb
Join
(select tsk.id, tsk.type, main_req.main_req_type
from pas_request tsk
Join
(select cn.id as context_id, rq.type as main_req_type
of pas_request rq
Join
CN pas_context
On rq.id = cn.request_id
and rq.dtype = 'MAINREQUEST. '
and rq.type in ('bgc.dar.vap.resolution.advice ','bgc.dar.e2etest.execution ',
'bgc.tbf.repair.vap ','bgc.dar.e2etest ',.
'bgc.dar.e2etest.intermediate.execution ','bgc.cbm ',.
'bgc.dar.e2etest.preparation ','bgc.chc.polling '.
)
and cn.status in ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
and cn.end_ts > = to_timestamp ('2014-05-06 00:00:00 ',' yyyy-mm-dd hh24:mi:ss')
and cn.end_ts<= to_timestamp('2014-05-06="" 23:59:59.999999','yyyy-mm-dd="">=>
and cn.id between 20141800000000000 and 20141999999999999
and rq.id between 20141800000000000 and 20141999999999999
) main_req
On tsk.parent_context_id = main_req.context_id
and tsk.dtype in ('ANALYSIS_TASK', 'DECISION_TASK')
and tsk.id between $$ low_id1 and $$ high_id1
) task
We rb.task_id = task.id
and rb.id between $$ low_id1 and $$ high_id1
where the type is null
or (type is not null
type in ('bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ', ' bgc.tbf.repair.vap',
'bgc.dar.e2etest ',' bgc.dar.e2etest.intermediate.execution', ' bgc.cbm ',.
'bgc.dar.e2etest.preparation ','bgc.chc.polling '.
)
)
-4th query
Select ri.id, ri.dtype, ri.version, ri.resultblock_id, ri.name, ri.value, ri.unit, ri.color, ri.lob_id.
RI.creation_ts, RI. Sequence, RI. DetailLevel, res_blk.main_req_type
of pas_resultitem ri
Join
(select rb.id, rb.type as rb_type, task.type as task_type, task.main_req_type)
of pas_resultblock rb
Join
(select main_req_type, tsk.id, tsk.type, main_req.)
from pas_request tsk
Join
(select cn.id as context_id, rq.type as main_req_type
of pas_request rq
Join
CN pas_context
On rq.id = cn.request_id
and rq.dtype = 'MAINREQUEST. '
and rq.type in ('bgc.dar.vap.resolution.advice ','bgc.dar.e2etest.execution ',
'bgc.tbf.repair.vap ','bgc.dar.e2etest ',.
'bgc.dar.e2etest.intermediate.execution ','bgc.cbm ',.
'bgc.dar.e2etest.preparation ','bgc.chc.polling '.
)
and cn.status in ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
and cn.end_ts > = to_timestamp ('2014-05-06 00:00:00 ',' yyyy-mm-dd hh24:mi:ss')
and cn.end_ts<= to_timestamp('2014-05-06="" 23:59:59.999999','yyyy-mm-dd="">=>
and cn.id between 20141800000000000 and 20141999999999999
and rq.id between 20141800000000000 and 20141999999999999
) main_req
On tsk.parent_context_id = main_req.context_id
and tsk.dtype in ('ANALYSIS_TASK', 'DECISION_TASK')
and tsk.id between 20141800000000000 and 20141999999999999
) task
We rb.task_id = task.id
and rb.id between 20141800000000000 and 20141999999999999
and rb.type in ('bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution', ' bgc.tbf.repair.vap',
'bgc.dar.e2etest ',' bgc.dar.e2etest.intermediate.execution', ' bgc.cbm ',.
'bgc.dar.e2etest.preparation ','bgc.chc.polling '.
)
) res_blk
On ri.resultblock_id = res_blk.id
and ri.id between 20141800000000000 and 20141999999999999
where ri.name is null
or (ri.name is not null
and ri.name in ('bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution', ' bgc.tbf.repair.vap',
'bgc.dar.e2etest ',' bgc.dar.e2etest.intermediate.execution', ' bgc.cbm ',.
'bgc.dar.e2etest.preparation ','bgc.chc.polling '.
)
)
-5th application
with
main_request as
(select / * + materialize * / )
mreq.ID, mreq.version, mreq.dtype, mreq.case_id, mreq.type, mreq.correlation_id, mreq. Initiator, mreq. Executor,
mreq. Category, mreq.parent_context_id, mreq.creation_ts, mreq.type
of pas_request mreq
Join
CN pas_context
On mreq.id = cn.request_id
and mreq.dtype = 'MAINREQUEST. '
and mreq.type in ('bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution', ' bgc.tbf.repair.vap',
'bgc.dar.e2etest ',' bgc.dar.e2etest.intermediate.execution', ' bgc.cbm ',.
'bgc.dar.e2etest.preparation ','bgc.chc.polling '.
)
and cn.status in ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
and cn.end_ts > = to_timestamp ('2014-05-06 00:00:00 ',' yyyy-mm-dd hh24:mi:ss')
and cn.end_ts<= to_timestamp('2014-05-06="" 23:59:59.999999','yyyy-mm-dd="">=>
and cn.id between 20141800000000000 and 20141999999999999
and mreq.id between 20141800000000000 and 20141999999999999
)
Select tsk.id, tsk.version, tsk.dtype, tsk.case_id, tsk.type, tsk.correlation_id, tsk.initiator, tsk.executor,
TSK. Category, tsk.parent_context_id, tsk.creation_ts, main_req.main_req_type
from pas_request tsk
Join
main_request main_req
On tsk.parent_context_id = main_req.id
and tsk.dtype in ('ANALYSIS_TASK', 'DECISION_TASK')
and tsk.id between $$ low_id1 and $$ high_id1
Union
SELECT id, version, dtype, case_id, type, correlation_id, initiator, executor,
category, type parent_context_id, creation_ts
of main_request
Concerning
Etbin
-
How to identify columns that have the same data in a SQL query or function?
Deal all,
How to identify columns that have the same data in a SQL query or function? I have the sample data as below
!DEPT_ID EMP_ID Come on CITY STATE COUNTRY 1 1 1 June 1983 DELHI HUMAN RESOURCES India 1 2 18 January 1987 DELHI HUMAN RESOURCES India 1 3 28 November 1985 DELHI HUMAN RESOURCES India 1 4 4 June 1985 DELHI HUMAN RESOURCES India 2 5 5 June 1983 MUMBAI HD India 2 6 6 June 1983 MUMBAI HD India 2 7 7 June 1983 MUMBAI HD India . 19832 8 8 Jun MUMBAI HD India . June 19833 9 9 GURGAON DL India 3 10 10 June 1983 GURGAON DL India Now, I want to Indify columns that have the same data for the same Department ID.
Is it possible in sql unique or do I have to write the function for this? Pls Help how to write?
Thanks in advance.
You can try this?
WITH T1)
DEPT_ID, EMP_ID, DATE OF BIRTH, CITY, STATE, COUNTRY
), ()
SELECT 1, 1, TO_DATE('1.) June 1983', 'JJ. LUN. (YYYY'), 'DELHI', 'HR', 'INDIA' OF THE DUAL UNION ALL
SELECT 1, 2, TO_DATE('18.) January 1987', 'JJ. LUN. (YYYY'), 'DELHI', 'HR', 'INDIA' OF THE DUAL UNION ALL
SELECT 1, 3, TO_DATE('28.) November 1985', 'JJ. LUN. (YYYY'), 'DELHI', 'HR', 'INDIA' OF THE DUAL UNION ALL
SELECT 1, 4, TO_DATE('4.) June 1985', 'JJ. LUN. (YYYY'), 'DELHI', 'HR', 'INDIA' OF THE DUAL UNION ALL
SELECT 2.5, TO_DATE('5.) June 1983', 'JJ. LUN. (YYYY'), 'BOMBAY', 'HD', 'INDIA' OF THE DUAL UNION ALL
SELECT 2.6, TO_DATE('6.) June 1983', 'JJ. LUN. (YYYY'), 'BOMBAY', 'HD', 'INDIA' OF THE DUAL UNION ALL
SELECT 2.7, TO_DATE('7.) June 1983', 'JJ. LUN. (YYYY'), 'BOMBAY', 'HD', 'INDIA' OF THE DUAL UNION ALL
SELECT 2.8, TO_DATE('8.) June 1983', 'JJ. LUN. (YYYY'), 'BOMBAY', 'HD', 'INDIA' OF THE DUAL UNION ALL
SELECT 3, 9, TO_DATE('9.) June 1983', 'JJ. LUN. (YYYY'), 'GURGAON', 'DL', 'INDIA' OF THE DUAL UNION ALL
SELECT 3.10, TO_DATE('10.) June 1983', 'JJ. LUN. (YYYY'), 'GURGAON', 'DL', 'INDIA' OF THE DOUBLE)
SELECT DEPT_ID,
RTRIM (XMLAGG (XMLELEMENT(A,VALS||',')). Extract ('//Text ()'), ',') COLUMNS_WITH_DUPLICATE
DE)
SELECT * FROM)
SELECT DEPT_ID,
EMP_ID,
Date of birth
CITY,
STATE,
COUNTRY
DE)
SELECT DEPT_ID,
EMP_ID,
Date of birth
CITY,
STATE,
COUNTRIES,
COUNT (*) OVER(PARTITION BY DEPT_ID ORDER BY EMP_ID DESC,DOB DESC,CITY DESC,STATE DESC, COUNTRY DESC) RN
DE)
SELECT DEPT_ID,
CASE WHEN(CEID>1) AND THEN 'YES' ELSE 'NO' END AS EMP_ID.
CASE WHEN(CDOB>1) THEN 'YES' ELSE 'NO' END AS DATE OF BIRTH,
CASE WHEN(CCITY>1) AND THEN 'YES' ELSE 'NO' END AS CITY.
CASE WHEN(CSTATE>1) AND THEN 'YES' ELSE 'NO' END AS STATE.
CASE WHEN(CCOUNTRY>1) THEN 'YES' ELSE 'NO' END AS A COUNTRY
DE)
SELECT DISTINCT
DEPT_ID,
CEID,
CDOB,
CITY,
CSTATE,
CCOUNTRY
DE)
SELECT DEPT_ID,
COUNT (*) TO THE CEID (DEPT_ID PARTITION, EMP_ID),.
COUNT (*) ON CDOB (DEPT_ID SCORE, DATE OF BIRTH),
COUNT (*) ON THE CITY (DEPT_ID PARTITION, CITY),
COUNT (*) ON CSTATE (DEPT_ID PARTITION, STATE).
COUNT (*) ON CCOUNTRY (DEPT_ID, COUNTRY PARTITION)
FROM T1)))
WHERE RN = 1)
UNPIVOT (CLO FOR (VALS) IN (EMP_ID, DATE OF BIRTH, CITY, STATE, COUNTRY)))
WHERE COLS = "YES".
DEPT_ID GROUP;
OUTPUT:
DEPT_ID COLUMNS_WITH_DUPLICATE
--------- ------------------------1 CITY, COUNTRY, STATE
2 CITY, COUNTRY, STATE
3 CITY, COUNTRY, STATEPost edited by: Parth272025
-
Hello
I want to run and store the results of a dynamic sql query in a strored procedure.
I get the following variables of the user running: v_column_names, v_table_name, v_col, v_value
The query will be like:
v_query: = 'SELECT'. v_column_names | ' A ' | v_table_name | ' WHERE ' | v_col |' = ' | v_value;
for example v_column_names: = 'ACCOUNT_NUM, SYSTEM_ID, ENTITY_ID ';
v_table_name: = 'ACCOUNT '.
v_col: = 'COUNTRY_CODE ';
v_value: = "USA";
Here is what I tried
DECLARE
v_column_names VARCHAR (200): = 'ENTITY_ID, SYSTEM_ID, ACCOUNT_NUM;
v_table_name VARCHAR (200): = 'ACCOUNT '.
v_col VARCHAR (200): = 'COUNTRY_CODE ';
v_value VARCHAR (200): = "'USA"';
TYPE column_record () IS RENDERING
VARCHAR2 (200) C1: = null;
C2 VARCHAR2 (200): = null;
C3 VARCHAR2 (200): = null
);
TYPE st_table IS TABLE OF column_record INDEX DIRECTORY.
pk_table st_table;
NUMBER of v1: = 1;
BEGIN
v_select: = 'SELECT'. v_column_names | ' A ' | v_table_name | ' WHERE ' | v_col |' = ' | v_value;
EXECUTE IMMEDIATE v_select COLLECT LOOSE pk_table.
I'm IN 1.pk_table.count LOOP
DBMS_OUTPUT. Put_line (pk_table (v1). (C1);
DBMS_OUTPUT. Put_line (pk_table (v1). (C2);
DBMS_OUTPUT. Put_line (pk_table (v1). (C3);
v1: = v1 + 1;
END LOOP;
END;
The number of column names in v_column_names is dynamic, so I need a way to store the results and then manipulate them.
I look forward to your reply.
EDIT: The real question:
1. in the settings I have pass the table name and the value of the primary key of the row I want to delete.
2. He then checks if this line is referenced anywhere, removes the reference, and then deletes the current line. This can go, until all the rows that are referenced are removed.
The above code, I have provided a small part of the largest of stored procedure.
Thank you all, I found the tips very helpful. I found a solution to my problem:
It generates all removal requests to remove a specific line. Not what I wanted, but this does not solve my problem.
The reason why is that I discovered that we do not use the ON DELETE CASCADE that we don't remove a record accidentally, I know we have an option to restore, but it is just in case something goes wrong.
-
limit of cpu resource manager problem
Hello world
I'm testing the resource limit of resource manager. in all the documents I read, after you create groups of consumers, if I gave a resource limit in terms of resources, it is said, this group of consumers won't be able to consume more cpu than that. for ex, 2 consumer group I have one of them gave 90% of cpu and the other (let's call it test_group) 5%, but when I connect with a user who is located in the test_group consumer group. After the execution of some sql/plsql, I noticed that it uses all the cpu.
EDIT: to the fifth message there is all the code samples and the test results with screenshots.
for ex in this page: http://pic.dhe.ibm.com/infocenter/mdm/v10r0m0/index.jsp?topic=%2Fcom.ibm.mdmhs.smpl.gd.doc%2Fr_oracle_db_resource_manager_working_example.html
There is a code example that explain the plan. It is said REPORTING_GROUP is not being able to occupy more than 5% of CPU times in total. I used this code, but reporting_group always be able to consume all the cpu. I tested this code (also I have created a new group and the plan of Enterprise manager) on windows 7 64-bit, intel i7 cpu with 4 core and on the same machine, using the virtual machine oralinux. as database, Enterprise edition 11.2.0.1
also resources plan is active and working, active session limit or cancel hen size for example, works when I tested it, but CPU limit is not. for testing I used the plsql code.
create or replace function sf_test(p number) return number as x number; begin select 1 into x from sh.sales where prod_id = p and rownum = 1; return 1; exception when no_data_found then return 0; end; / declare x number; begin for i in 1..50 loop for i in 1..10000 loop x := sf_Test(i); end loop; end loop; end;
I created four session of the Report1 user (in the link I mentioned before) and run this code plsql, at most 5% of cpu if they had but my CPU is overloaded almost every time.
I missed something here or I got all wrong concept?
PS: setting resource_limit is true and resouce_plan is the plan that I created. as I said before the plan is active and functional, I know, but may not limit the cpu. I would appreciate it if you help. Thank you very much.
Looks like the resource manager behave correctly.
If the session manager are not ask for 95 percent of the CPU resources, what remains will be the users of the report. Oracle will not starve the UC report sessions if there are a bunch of CPU idle.
If there are 8 Virtual cores and a bunch of single threaded sessions, you need at least 8 sessions before Manager the Manager could use 95% of the available CPU. Most likely, you would need 9 or 10.
If you have only a 6-wire Manager, these discussions could consume at least 6/8 = 75% of the available CPU but probably more than 67% (to pick a number that facilitates the calculation). There is 33% of the CPU for the report. There are 4 sessions of report in your screenshot with a little more than 2 cores available and each one seems to spend slightly more than 50% of their time on the CPU, which looks all right.
Justin
-
SQL query as a filter in OBIEE
I have a list of student_ID in a table (say A) and its subset in another table (table B)
I want a filter so that only the student_ID in table A that are not in table B are selected.
I'm selecting operator "not equal to / is not" of the student_id in table A and choose the option to SQL query to add value.
Select distinct student_id from DatabaseName.B
His does not work. His error after a large number of minor changes.
Can you help how to solve this problemTry something like
http://www.cool-bi.com/tweaks/JoinsinAnswers.phpUse not exists or not instead of join.
If brand aid
-
SQL Query + long running.
Dear gurus/masters/All,
I beg you all to help me with the setting of the SQL query that takes more time. DB version: 10.2.0.4
Query SQL WHERE condition:
Query execution plan:select column1, column2, ......... FROM SIEBEL.S_ORG_EXT T1, SIEBEL.S_PROD_INT T2, SIEBEL.S_VOD T3, SIEBEL.S_ORG_EXT T4, SIEBEL.S_ORG_EXT T5, SIEBEL.S_ORG_EXT_X T6, SIEBEL.S_PROD_LN T7, SIEBEL.S_ASSET_OM T8, SIEBEL.S_VOD_VER T9, SIEBEL.S_CTLG_CAT T10, SIEBEL.S_CONTACT T11, SIEBEL.S_PARTY T12, SIEBEL.S_PARTY T13, SIEBEL.S_PROD_INT T14, SIEBEL.S_ASSET_BU T15, SIEBEL.S_CTLG_CAT T16, SIEBEL.S_ORG_EXT T17, SIEBEL.S_ORG_EXT T18, SIEBEL.S_ASSET T19, SIEBEL.S_ADDR_PER T20, SIEBEL.S_ORG_EXT T21, SIEBEL.S_ASSET_X T22, SIEBEL.S_ASSET T23 WHERE T16.PAR_CAT_ID = T10.ROW_ID (+) AND T14.CG_PR_CTLG_CAT_ID = T16.ROW_ID (+) AND T3.ROW_ID = T9.VOD_ID AND T14.CFG_MODEL_ID = T3.OBJECT_NUM AND T23.OWNER_CON_ID = T11.ROW_ID (+) AND T23.OWNER_ACCNT_ID = T6.PAR_ROW_ID (+) AND T23.PER_ADDR_ID = T20.ROW_ID (+) AND T23.PROD_ID = T14.ROW_ID AND T23.OWNER_ACCNT_ID = T21.PAR_ROW_ID (+) AND T14.PR_PROD_LN_ID = T7.ROW_ID (+) AND T23.ROOT_ASSET_ID = T19.ROW_ID (+) AND T19.PROD_ID = T2.ROW_ID (+) AND T23.BILL_ACCNT_ID = T18.PAR_ROW_ID (+) AND T23.RTNG_DLR_ID = T1.PAR_ROW_ID (+) AND T23.PREF_SRV_DLR_ID = T17.PAR_ROW_ID (+) AND T23.DLR_ID = T4.PAR_ROW_ID (+) AND T23.ROW_ID = T22.PAR_ROW_ID (+) AND T23.ROW_ID = T8.PAR_ROW_ID (+) AND T23.PR_CON_ID = T12.ROW_ID (+) AND T23.BU_ID = T15.BU_ID (+) AND T23.ROW_ID = T15.ASSET_ID (+) AND T15.BU_ID = T13.ROW_ID (+) AND T15.BU_ID = T5.PAR_ROW_ID (+) AND ((T23.SERIAL_NUM IS NOT NULL AND T23.PAR_ASSET_ID IS NULL OR T23.X_PHONE_NUMBER IS NOT NULL AND T23.PAR_ASSET_ID IS NOT NULL) AND (T9.VER_NUM = :1));
PLAN_TABLE_OUTPUT ------------------------------------------------------------------------------------------------------------------------------------------------------ Plan hash value: 967177145 -------------------------------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | -------------------------------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 54117 | 92M| 4435K (1)| 01:58:43 | | 1 | NESTED LOOPS OUTER | | 54117 | 92M| 4435K (1)| 01:58:43 | | 2 | NESTED LOOPS OUTER | | 54117 | 87M| 4261K (1)| 01:54:04 | | 3 | NESTED LOOPS OUTER | | 54117 | 86M| 4154K (1)| 01:51:13 | | 4 | NESTED LOOPS OUTER | | 54117 | 85M| 4111K (1)| 01:50:03 | | 5 | NESTED LOOPS OUTER | | 54117 | 84M| 3980K (1)| 01:46:33 | | 6 | NESTED LOOPS OUTER | | 54117 | 83M| 3937K (1)| 01:45:24 | | 7 | NESTED LOOPS OUTER | | 54117 | 81M| 3763K (1)| 01:40:44 | | 8 | NESTED LOOPS OUTER | | 54117 | 81M| 3751K (1)| 01:40:25 | | 9 | NESTED LOOPS OUTER | | 54117 | 80M| 3621K (1)| 01:36:57 | | 10 | NESTED LOOPS OUTER | | 54117 | 73M| 3515K (1)| 01:34:07 | | 11 | NESTED LOOPS OUTER | | 54117 | 71M| 3410K (1)| 01:31:18 | | 12 | NESTED LOOPS OUTER | | 54117 | 69M| 3410K (1)| 01:31:18 | | 13 | NESTED LOOPS OUTER | | 54117 | 67M| 3410K (1)| 01:31:18 | | 14 | NESTED LOOPS OUTER | | 54117 | 66M| 3410K (1)| 01:31:18 | | 15 | NESTED LOOPS OUTER | | 54117 | 64M| 3324K (1)| 01:28:59 | | 16 | NESTED LOOPS OUTER | | 54117 | 62M| 3237K (1)| 01:26:40 | | 17 | NESTED LOOPS | | 54117 | 57M| 3106K (1)| 01:23:10 | | 18 | NESTED LOOPS OUTER | | 71 | 43665 | 381 (2)| 00:00:01 | | 19 | NESTED LOOPS OUTER | | 71 | 42316 | 323 (2)| 00:00:01 | | 20 | NESTED LOOPS OUTER | | 71 | 41322 | 322 (2)| 00:00:01 | | 21 | NESTED LOOPS | | 71 | 24708 | 265 (3)| 00:00:01 | | 22 | NESTED LOOPS | | 77 | 2772 | 141 (4)| 00:00:01 | |* 23 | TABLE ACCESS FULL | S_VOD_VER | 75 | 1350 | 72 (7)| 00:00:01 | | 24 | TABLE ACCESS BY INDEX ROWID| S_VOD | 1 | 18 | 1 (0)| 00:00:01 | |* 25 | INDEX UNIQUE SCAN | S_VOD_P1 | 1 | | 1 (0)| 00:00:01 | | 26 | TABLE ACCESS BY INDEX ROWID | S_PROD_INT | 1 | 312 | 2 (0)| 00:00:01 | |* 27 | INDEX RANGE SCAN | S_PROD_INT_F9 | 1 | | 1 (0)| 00:00:01 | | 28 | TABLE ACCESS BY INDEX ROWID | S_PROD_LN | 1 | 234 | 1 (0)| 00:00:01 | |* 29 | INDEX UNIQUE SCAN | S_PROD_LN_P1 | 1 | | 1 (0)| 00:00:01 | | 30 | TABLE ACCESS BY INDEX ROWID | S_CTLG_CAT | 1 | 14 | 1 (0)| 00:00:01 | |* 31 | INDEX UNIQUE SCAN | S_CTLG_CAT_P1 | 1 | | 1 (0)| 00:00:01 | | 32 | TABLE ACCESS BY INDEX ROWID | S_CTLG_CAT | 1 | 19 | 1 (0)| 00:00:01 | |* 33 | INDEX UNIQUE SCAN | S_CTLG_CAT_P1 | 1 | | 1 (0)| 00:00:01 | |* 34 | TABLE ACCESS BY INDEX ROWID | S_ASSET | 760 | 375K| 43753 (1)| 00:01:11 | |* 35 | INDEX RANGE SCAN | S_ASSET_U2 | 55873 | | 312 (3)| 00:00:01 | | 36 | TABLE ACCESS BY INDEX ROWID | S_ASSET_OM | 1 | 94 | 2 (0)| 00:00:01 | |* 37 | INDEX RANGE SCAN | S_ASSET_OM_U1 | 1 | | 2 (0)| 00:00:01 | | 38 | TABLE ACCESS BY INDEX ROWID | S_CONTACT | 1 | 39 | 2 (0)| 00:00:01 | |* 39 | INDEX UNIQUE SCAN | S_CONTACT_P1 | 1 | | 1 (0)| 00:00:01 | | 40 | TABLE ACCESS BY INDEX ROWID | S_ADDR_PER | 1 | 29 | 2 (0)| 00:00:01 | |* 41 | INDEX UNIQUE SCAN | S_ADDR_PER_P1 | 1 | | 1 (0)| 00:00:01 | | 42 | TABLE ACCESS BY INDEX ROWID | S_ORG_EXT | 1 | 32 | 1 (0)| 00:00:01 | |* 43 | INDEX UNIQUE SCAN | S_ORG_EXT_U3 | 1 | | 1 (0)| 00:00:01 | | 44 | TABLE ACCESS BY INDEX ROWID | S_ORG_EXT | 1 | 32 | 1 (0)| 00:00:01 | |* 45 | INDEX UNIQUE SCAN | S_ORG_EXT_U3 | 1 | | 1 (0)| 00:00:01 | | 46 | TABLE ACCESS BY INDEX ROWID | S_ORG_EXT | 1 | 32 | 1 (0)| 00:00:01 | |* 47 | INDEX UNIQUE SCAN | S_ORG_EXT_U3 | 1 | | 1 (0)| 00:00:01 | | 48 | TABLE ACCESS BY INDEX ROWID | S_ORG_EXT | 1 | 36 | 2 (0)| 00:00:01 | |* 49 | INDEX UNIQUE SCAN | S_ORG_EXT_U3 | 1 | | 1 (0)| 00:00:01 | | 50 | TABLE ACCESS BY INDEX ROWID | S_ORG_EXT | 1 | 139 | 2 (0)| 00:00:01 | |* 51 | INDEX UNIQUE SCAN | S_ORG_EXT_U3 | 1 | | 1 (0)| 00:00:01 | | 52 | TABLE ACCESS BY INDEX ROWID | S_ORG_EXT_X | 1 | 16 | 2 (0)| 00:00:01 | |* 53 | INDEX RANGE SCAN | S_ORG_EXT_X_U1 | 1 | | 2 (0)| 00:00:01 | |* 54 | INDEX UNIQUE SCAN | S_PARTY_P1 | 1 | 12 | 1 (0)| 00:00:01 | | 55 | TABLE ACCESS BY INDEX ROWID | S_ASSET_BU | 1 | 34 | 3 (0)| 00:00:01 | |* 56 | INDEX RANGE SCAN | S_ASSET_BU_U1 | 1 | | 2 (0)| 00:00:01 | |* 57 | INDEX UNIQUE SCAN | S_PARTY_P1 | 1 | 12 | 1 (0)| 00:00:01 | | 58 | TABLE ACCESS BY INDEX ROWID | S_ASSET | 1 | 37 | 2 (0)| 00:00:01 | |* 59 | INDEX UNIQUE SCAN | S_ASSET_P1 | 1 | | 2 (0)| 00:00:01 | | 60 | TABLE ACCESS BY INDEX ROWID | S_PROD_INT | 1 | 16 | 1 (0)| 00:00:01 | |* 61 | INDEX UNIQUE SCAN | S_PROD_INT_P1 | 1 | | 1 (0)| 00:00:01 | | 62 | TABLE ACCESS BY INDEX ROWID | S_ORG_EXT | 1 | 14 | 2 (0)| 00:00:01 | |* 63 | INDEX UNIQUE SCAN | S_ORG_EXT_U3 | 1 | | 1 (0)| 00:00:01 | | 64 | TABLE ACCESS BY INDEX ROWID | S_ASSET_X | 1 | 93 | 3 (0)| 00:00:01 | |* 65 | INDEX RANGE SCAN | S_ASSET_X_U1 | 1 | | 2 (0)| 00:00:01 | -------------------------------------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 23 - filter("T9"."VER_NUM"=TO_NUMBER(:1)) 25 - access("T3"."ROW_ID"="T9"."VOD_ID") 27 - access("T14"."CFG_MODEL_ID"="T3"."OBJECT_NUM") 29 - access("T14"."PR_PROD_LN_ID"="T7"."ROW_ID"(+)) 31 - access("T14"."CG_PR_CTLG_CAT_ID"="T16"."ROW_ID"(+)) 33 - access("T16"."PAR_CAT_ID"="T10"."ROW_ID"(+)) 34 - filter("T23"."PAR_ASSET_ID" IS NULL AND "T23"."SERIAL_NUM" IS NOT NULL OR "T23"."X_PHONE_NUMBER" IS NOT NULL AND "T23"."PAR_ASSET_ID" IS NOT NULL) 35 - access("T23"."PROD_ID"="T14"."ROW_ID") 37 - access("T23"."ROW_ID"="T8"."PAR_ROW_ID"(+)) 39 - access("T23"."OWNER_CON_ID"="T11"."ROW_ID"(+)) 41 - access("T23"."PER_ADDR_ID"="T20"."ROW_ID"(+)) 43 - access("T23"."RTNG_DLR_ID"="T1"."PAR_ROW_ID"(+)) 45 - access("T23"."DLR_ID"="T4"."PAR_ROW_ID"(+)) 47 - access("T23"."PREF_SRV_DLR_ID"="T17"."PAR_ROW_ID"(+)) 49 - access("T23"."BILL_ACCNT_ID"="T18"."PAR_ROW_ID"(+)) 51 - access("T23"."OWNER_ACCNT_ID"="T21"."PAR_ROW_ID"(+)) 53 - access("T23"."OWNER_ACCNT_ID"="T6"."PAR_ROW_ID"(+)) 54 - access("T23"."PR_CON_ID"="T12"."ROW_ID"(+)) 56 - access("T23"."ROW_ID"="T15"."ASSET_ID"(+) AND "T23"."BU_ID"="T15"."BU_ID"(+)) 57 - access("T15"."BU_ID"="T13"."ROW_ID"(+)) 59 - access("T23"."ROOT_ASSET_ID"="T19"."ROW_ID"(+)) 61 - access("T19"."PROD_ID"="T2"."ROW_ID"(+)) 63 - access("T15"."BU_ID"="T5"."PAR_ROW_ID"(+)) 65 - access("T23"."ROW_ID"="T22"."PAR_ROW_ID"(+)) Note ----- - dynamic sampling used for this statement 105 rows selected.
Hello
It is not necessary to display the trace file - everything is clear from the plans that you have posted. The optimizer is the selectivity calculation assuming the absence of correlation between the columns. You can do these calculations that yourself and you see that if the entries are correct and if the hypothesis of lack of correlation is also correct, then the results should be correct, too. Since they are not, it's one of two things: optimizer stats are wrong, or the columns are in fact related.
First of all check the optimizer statistics: i.e. take NUM_ROWS and NUM_NULLS of DBA_TAB_COL_STATISTICS and compare them with the actual rowcounts. If they are correct (in a reasonable error margin), then it means that the columns are correlated, and the optimizer will need additional assistance to obtain right of cardinalities.
Best regards
Nikolai -
SQL query for the set of data rows not values
Hello!
I use Oracle 10 g (10.2.0.1.0) and I need help to solve this difficult task. I have a huge table with more than 145000 records and I shows you only a sample of it:
ID TEAMNAME_EN DT TEAMNAME_EN HPROB AM APROB FT
324813 31/8 / 2012 DEN HAAG GRONINGEN 1.90 3.30 3.10 2
324823 31/8 / 2012 MAINZ GREUTHER FÜRTH 1.75 3.25 3.65 2
324805 31/8 / 2012 GAZELEC DIJON 1.60 3.15 4.75 1
324810 31/8 / 2012 ÖREBRO DJURGÅRDEN 2.80 3.25 2 2.05
324795 31/8 / 2012 FC KÖLN COTTBUS 1.85 3.20 3.35 2
324837 31/8 / 2012 PORTLAND WOOD COLORADO RAPIDS 2,00 3.20 2.95 1
324828 31/8 / 2012 DROGHEDA UNITED, DUNDALK 1.45 3.65 5.25 1
324827 31/8 / 2012 CORK CITY SHAMROCK ROVERS 3,30 3,80 1.70 2
324833 31/8 / 2012 BARUERI ASA 2.45 3.20 1-2.30
324798 31/8 / 2012 GENÇLERBIRLIGI ORDUSPOR'A 2.00 3,10 X 3.00
324814 31/8 / 2012 ALMERE CITY FC OSS 1,80 3,50 3,20 2
324830 31/8 / 2012 CRICIÚMA BRAGANTINO 1.25 4.35 1 8.00
324820 31/8 / 2012 VOLENDAM FC EINDHOVEN 1.80 3.25 3.45 1
324818 31/8 / 2012 MVV MAASTRICHT TELSTAR 1.40 4.00 X 5.25
324819 31/8 / 2012 DORDRECHT VEENDAM 1.80 3.25 3.45 1
324834 31/8 / 2012 CEARÁ GUARATINGUETÁ 1.40 3.85 X 5.50
If this table consists of
dates
teams (hometeam, awayteam)
numbers for homewin, shoot, awaywin probability
and the final result as 1, X, 2
What I want is a sql query that returns to me for each hometeam, awayteam and (if possible in a single line)
all documents of the hometeam which had the same number of prior probability. For example:
CEARÁ (last line), I would like to the sql to show me all the records of CEARA who had _1.40 3.85 or 5.50_ in each of the three issues of probability, BUT the problem is that I do want separate lines... I can do so far is to calculate a sum of House probability, probability of drawing, close probability for each team but the same records are calculated again in each game of probability!
This means if CEARÁ has 1.40-3.85-5.50 in the past it will return me this line only once, and not 3 times (one for each set of probability)
I hope that I've done my duty,
Thank you for your time and lights
N. SaridakisIs that what you are looking for:
select hometeam, awayteam, hw, hd, hl from (select hometeam, awayteam, ft, SUM(CASE ft WHEN '1' THEN 1 ELSE 0 END) OVER (PARTITION BY hometeam) hw, SUM(CASE ft WHEN 'X' THEN 1 ELSE 0 END) OVER (PARTITION BY hometeam) hd, SUM(CASE ft WHEN '2' THEN 1 ELSE 0 END) OVER (PARTITION BY hometeam) hl from plays) where ft is null
-
IOM sql Query to get the status of the failed task
Hello world
We have an obligation as we need to get the status of a particular task (say Create User in OID - Completed\Rejected status resource) for the particular user. We are able to get the status of the provisioed of resources to the user but not the status of the special mission which is trigerred for the user.can someone put some light on it. We must have the SQL query to do this.
Thanks in advance.
Kind regards
MKNHello
Use this query to get the status of the task, also check the coomentsSELECT USR. USR_LOGIN, OSI. SCH_KEY, ANN. SCH_STATUS, STA. STA_BUCKET OF
OSI, CHS, STA, MIL, TOS, PKG, OUEDRAOGO, USR, OBJ, OST
WHERE OSI.MIL_KEY = MIL.MIL_KEY
AND ANN. SCH_KEY = OSI. SCH_KEY
AND STA. STA_STATUS = SCH. SCH_STATUS
AND TOS. PKG_KEY = PKG. PKG_KEY
AND MIL. TOS_KEY = TOS. TOS_KEY
AND OUÉDRAOGO. USR_KEY = USR. USR_KEY
AND OUÉDRAOGO. OST_KEY = OST. OST_KEY
AND OST. OBJ_KEY = OBJ. OBJ_KEY
AND OSI. ORC_KEY = OUEDRAOGO. ORC_KEY
AND OBJ. OBJ_NAME = "User AD".
AND OST. OST_STATUS = "Provisioning" - filter accordinglly
AND STA. STA_BUCKET = 'pending' - filter accordinglly
AND PKG. PKG_NAME = "AD User" - filter accordinglly
AND MIL.MIL_NAME = 'System' - filter accordinglly Validation
;
Thank you
Kuldeep
Maybe you are looking for
-
I can't delete the locations in "recent" on the Apple on my iphone 6 s cards, as there is nothing to type that States remove?
-
Touch of Toshiba Journ E counts reset!
Hello good day You can reset my account because I wasn't in the virtual store of Toshiba am connected is not registered I have the Toshiba Journ e Touch gift from a friend and does not know his password or e-mail Personal account 30736 ask the push-b
-
No error message - just the red text: "Please enter a valid zip code." I have lived at the same address for 22 years and I know the postal code that I entered is correct! (Also, following a response prior to a similar question, I tried prefixed code
-
January 17, 2011 - Best Buy installed XP - Pro SP3 on the computer that previously had XP Home SP2. OE 6.0 has been used in the two operating systems. Using XP-Home Edition, no real problem OE. Within 24 hours using OE XP - Pro, I get the compact mes
-
I have a desktop Dell-540 in which my c drive is a Raid 1 configuration of 1 TB (two disks to not up to 1 TB, Raid 0, which is the backup) which has all my programs and data. I have a 2nd J: 1 TB (single drive - no raid) drive that I use as my back