The DIMINFO affects query performance?

Hi all

A USER_SDO_GEOM_METADATA can. DIMINFO well defined to improve the query performance?


For all the tables in my system, I have the USER_SDO_GEOM_METADATA view like this:
DIMINFO
X; -2147483648; 2147483648; 5TH-5
Y; -2147483648; 2147483648; 5TH-5
Z; -2147483648; 2147483648; 5TH-5




Thanks to you all

The simple answer is Yes - it provides an alternative and faster I/O path.

The real question is whether it is supposed that was the data model and its use.

So your question is similar to asking if a varchar2 column indexing is good or not. The answer is "+ depends on +".

Tags: Database

Similar Questions

  • The BLASTP_ALIGN query performance decreases as increases the size table Ref?

    Newbie here.

    I'm using Oracle 11.2.0.3.

    I am currently running and a loop through the cursor according to who uses the tool BLASTP_ALIGN from Oracle:

    FOR MyALIGN_TAB IN

    (

    Select a.query_string, H.AA_SEQUENCE target_string, t_seq_id, pct_identity, alignment_length, incompatibilities, positive, gap_openings, gap_list, q_seq_start, q_frame, q_seq_end, t_seq_start, t_seq_end, t_frame, score, wait

    from (select t_seq_id, pct_identity, alignment_length, incompatibilities, positive, gap_openings, gap_list, q_seq_start, q_frame, q_seq_end, t_seq_start, t_seq_end, t_frame, score, wait

    table (BLASTP_ALIGN ((p_INPUT_SEQUENCE SELECT query_string FROM DUAL),

    CURSOR (Select GB_ACCESSION, AA_SEQUENCE from HUMAN_DB1. HUMAN_PROTEINS),

    1-1, 0, 0, 'PAM30',. 1, 10, 1, 2, 0, 0)

    )

    ),

    (SELECT p_INPUT_SEQUENCE FROM DUAL Query_string).

    HUMAN_DB1. HUMAN_PROTEINS H

    WHERE UPPER (t_seq_id) = UPPER (H.gb_accession) and gap_openings = 0

    )

    LOOP


    This initial query works relatively well (about 2 seconds) on a table target of approximately 20,000 documents (reproduced above, as the HUAMN_DB1. Table HUMAN_PROTEINS. However, if I had to choose a selected target table that contains approximately 170 000 records, the query performance are significantly reduced in about 45 seconds. The two tables have identical ratings.


    I was wondering if there are ways to improve the performance of BLASTP_ALIGN on large tables? There only seems to be a lot of documentation on BLASTP_ALIGN. I could find this (http://docs.oracle.com/cd/B19306_01/datamine.102/b14340/blast.htm), but it wasn't that useful.


    Any ideas would be greatly appreciated.



    In case one is interested... it looked like the AA_SEQUENCE column in the following slider: SLIDER (Select GB_ACCESSION, AA_SEQUENCE from HUMAN_DB1. HUMAN_PROTEINS) was a CLOB field. In my second target, my column correspodoning table was VARCHAR2. One hypothesis is that BLASTP_ALIGN made a VARCHAR2-> CLOB conversion internally. I changed the table to have a CLOB column and with success against BLASTP_ALIGN 170 000 documents about 8 seconds (not much, but better than 45).

    I will mark it as answered.

  • 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
    UNION

    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,
    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
    UNION

    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 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

  • FRM - 40603:Records is no longer reserved for the update. Query for changes

    Hi I have a form that has been developing 6i and upgraded to 11g form work well in 6i, but when I try to do the same function in 11g get this error

    FRM - 40603:Records is no longer reserved for the update. Query for changes
    When I commit this execute_query (for_update); It is the form to clear values when it loads, the error comes when I try to delete

    How can I do this

    Action: If you want to change the block, you will need to re - interview.

    Captureerror3.PNG

    I use When-Timer-Expired (WTE) trigger

    You have a 'relationship' defined between the blocks of your master and detail? If so, simply update your master block and the block of details will automatically be re-interviewed. If you cannot use a relationship, then you can use can create a timer in the trigger that updates the database, then in the trigger When-Timer-Expired (WTE) you can go to the retail block and run a query. For example: / * the sample on change trigger * /.

    DECLARE
      timer_id  TIMER;
    BEGIN
    ....your code here that performs the update....
      /* Now create an instance of a timer */
      timer_id := Create_Timer ('upd_detail',1,NO_REPEAT);
    END;/* Sample Form Level When-Timer-Expired trigger */
    DECLARE
      timer_id  TIMER;
    BEGIN
      -- Find the timer first
      timer_id := FIND_TIMER('upd_detail');
      IF NOT ID_NULL(timer_id) THEN
          GO_BLOCK('DETAIL_BLOCK');
          Execute_Query;
      END IF;
    END;
    
  • How knowledge/check if the RMAN backup was performed using a current control file or database catalog?

    Hello

    How knowledge/check if the RMAN backup was performed using a current control file or database catalog? I mean RMAN prompt or sqlplus is it possible to know.

    Thank you

    You're welcome my friend

    You can see them using two methods.

    as I mentioned above, you can see them connect to the catalog database and you can query using the view that I sent

    http://docs.Oracle.com/CD/E11882_01/backup.112/e10642/rcmreprt.htm#BRADV89601

    the other method is the list command, you must use the list command after connecting using rman "rman target / catalog cat_user/cat_pass@catdbtns" command

    http://docs.Oracle.com/CD/E11882_01/backup.112/e10642/rcmreprt.htm#BRADV8136

    Check the value of the control_file_record_keep_time parameter. The default value is 7 days. in the output of the list command, if you can see the old backups to the value, you must be sure that the backup information comes from the catalogue database

    SELECT * FROM parameter $ v where name = 'control_file_record_keep_time '.

    an example of command list

    the list of completed database before backup ' sysdate-10'.

    Concerning

  • Query performance

    CURSOR c_exercise_list IS
           SELECT
                  DECODE(v_mfd_mask_id ,'Y',' ',o.opt_id) opt_id,
                  DECODE(v_mfd_mask_id ,'Y',' ',o.soc_sec) soc_sec,
                  P.plan_id plan_id, E.exer_id exer_id, E.exer_num,
                  DECODE(G.sar_flag, 0, DECODE(G.plan_type, 0, '1', 1, '2', 2, '3', 3, ' ', 4,'5', 5, '6', 6, '7', 7, '8', 8, '9', '0'), ' ') option_type,
                  TO_CHAR(G.grant_dt, 'YYYYMMDD') grant_dt, TO_CHAR(E.exer_dt, 'YYYYMMDD') exer_dt,
                  E.opts_exer opts_exer,
                  E.mkt_prc   mkt_prc,
                  E.swap_prc  swap_prc,
                  E.shrs_swap shrs_swap, decode(e.exer_type,2,decode(xe.cash_partial,'Y','A','2'),TO_CHAR(E.exer_type)) exer_type,
                  E.sar_shrs  sar_shrs,
                  NVL(ROUND(((xe.sar_shrs_withld_optcost - (e.opts_exer * g.opt_prc) / e.mkt_prc) * e.mkt_prc),2),0)+e.sar_cash sar_cash,
                  NVL(f.fixed_fee1,0) fixed_fee1,
                  NVL(f.fixed_fee2,0) fixed_fee2,
                  NVL(f.fixed_fee3,0) fixed_fee3,
                  NVL(f.commission,0) commission,
                  NVL(f.sec_fee,0)    sec_fee,
                  NVL(f.fees_paid,0)  fees_paid,
                  NVL(ct.amount,0)     cash_tend,
                  E.shrs_tend  shrs_tend, G.grant_id grant_id, NVL(G.grant_cd, ' ') grant_cd,
                  NVL(xg.child_symbol,' ') child_symbol,
                  NVL(xg.opt_gain_deferred_flag,'N') defer_flag,
                  o.opt_num opt_num,
                  --XO.new_ssn,
                  DECODE(v_mfd_mask_id ,'Y',' ',xo.new_ssn) new_ssn,
                          xo.use_new_ssn
                  ,xo.tax_verification_eligible tax_verification_eligible
                  ,(SELECT TO_CHAR(MIN(settle_dt),'YYYYMMDD') FROM tb_ml_exer_upload WHERE exer_num = E.exer_num AND user_id=E.user_id AND NVL(settle_dt,TO_DATE('19000101','YYYYMMDD'))>=E.exer_dt) AS settle_dt
                  ,xe.rsu_type  AS rsu_type
                  ,xe.trfbl_det_name AS trfbl_det_name
                  ,o.user_txt1,o.user_txt2,xo.user_txt3,xo.user_txt4,xo.user_txt5,xo.user_txt6,xo.user_txt7
                  ,xo.user_txt8,xo.user_txt9,xo.user_txt10,xo.user_txt11,
                  xo.user_txt12,
                  xo.user_txt13,
                  xo.user_txt14,
                  xo.user_txt15,
                  xo.user_txt16,
                  xo.user_txt17,
                  xo.user_txt18,
                  xo.user_txt19,
                  xo.user_txt20,
                  xo.user_txt21,
                  xo.user_txt22,
                  xo.user_txt23,
                  xo.user_dt2,
                  xo.adj_dt_hire_vt_svc,
                  xo.adj_dt_hire_vt_svc_or,
                  xo.adj_dt_hire_vt_svc_or_dt,
                  xo.severance_plan_code,
                  xo.severance_begin_dt,
                  xo.severance_end_dt,
                  xo.retirement_bridging_dt
                  ,NVL(xg.pu_var_price ,0) v_pu_var_price
                  ,NVL(xe.ficamed_override,'N') v_ficmd_ovrride
                  ,NVL(xe.vest_shrs,0) v_vest_shrs
                  ,NVL(xe.client_exer_id,' ') v_client_exer_id
                  ,(CASE WHEN xg.re_tax_flag = 'Y' THEN pk_xop_reg_outbound.Fn_GetRETaxesWithheld(g.grant_num, E.exer_num, g.plan_type)
                         ELSE 'N'
                     END) re_tax_indicator -- 1.5V
                  ,xe.je_bypass_flag
                  ,xe.sar_shrs_withld_taxes   --Added for SAR july 2010 release
                  ,xe.sar_shrs_withld_optcost --Added for SAR july 2010 release
            FROM
            (SELECT exer.* FROM exercise exer WHERE NOT EXISTS (SELECT s.exer_num FROM suspense s
                WHERE s.exer_num = exer.exer_num AND s.user_id = exer.user_id AND exer.mkt_prc = 0))E,
                grantz G,  xop_grantz xg, optionee o, xop_optionee xo, feeschgd f, cashtendered ct, planz P,xop_exercise xe
            WHERE
                  E.grant_num  = G.grant_num
            AND   E.user_id    = G.user_id
            AND   E.opt_num    = o.opt_num
            AND   E.user_id    = o.user_id
            AND   (G.grant_num = xg.grant_num(+) AND G.user_id=xg.user_id(+))
            AND   (o.opt_num   = xo.opt_num(+)   AND o.user_id=xo.user_id(+))
            AND   E.plan_num = P.plan_num
            AND   E.user_id = P.user_id
            AND   E.exer_num = f.exer_num(+)
            AND   E.user_id = ct.user_id(+)
            AND   E.exer_num = ct.exer_num(+)
            AND   E.user_id = ct.user_id(+)
            AND   E.exer_num=xe.exer_num(+)
            AND   E.user_id=xe.user_id(+)
            AND   G.user_id = USER
            AND NOT EXISTS (
                        SELECT tv.exer_num
                          FROM tb_xop_tax_verification tv--,exercise ex
                         WHERE tv.exer_num = e.exer_num
                           AND tv.user_id = e.user_id
                           AND tv.user_id = v_cms_user
                           AND tv.status_flag IN (0,1,3,4, 5)) -- Not Processed
            ;
    How to tune the query performance, any1 help me to impropve... Thanks in advance

    Published by: BluShadow on February 21, 2013 08:14
    corrected {noformat}
    {noformat} tags. Please read {message:id=9360002} and learn how to post code correctly.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

    956684 wrote:
    I got the cost of CPU: 458.50 time: 1542.90 therefore anything can capture to improve performance, but there is no applied full table scan to put nothing in the mentioned table. . and most of the columns are index unique scan takes place... someone can help me to find the solution

    His request as "my car doesn't work, care color is gray. Can solve you this problem? »

    Please read the FAQ, I already posted and follow the instructions.

  • Query performance poor when they join CONTAINS to another table

    We just recently started evaluation Oracle Text for a search solution. We must be able to find a table which can have over 20 million lines. Each user can have visibility to a very small part of these lines. The goal is to have a single Oracle text index that represents all the columns of research in the table (multi column datastore) and provide a score for each search result so that we can sort the search results in descending score order. What we see is that the performance of the queries of TOAD are extremely fast, when we write a simple CONTAINS query against the table indexed Oracle text. However, when we first try reduce the lines from that CONTAINS query must search using a we find the query performance degrades significantly.

    For example, we can find all the records that a user has access from our base table of the following query:

    SELECT d.duns_loc
    DUNS d
    JOIN primary_contact pc
    ON d.duns_loc = pc.duns_loc
    AND pc.emp_id =: employeeID;

    This query may run in < 100 m in the example, this query returns close to 1200 lines of the duns_loc of primary key.

    Our search query looks like this:

    SELECT score (1), d.
    DUNS d
    WHERE CONTAINS (TEXT_KEY,: research, 1) > 0
    ORDER BY score (1) DESC;

    The: Find value in this example will be 'Highway '. The query can return 246 k lines in about 2 seconds.

    2 seconds is good, but we should be able to have a much quicker response if the request did not have to search the entire table, right? Since each user can only records from 'view' that they are assigned to as us if the search operation had to be analysed a tiny tiny percentage of the TEXT index, we should see results faster (and more relevant). If we now write the following query:

    WITH the subset
    AS
    (SELECT d.duns_loc
    DUNS d
    JOIN primary_contact pc
    ON d.duns_loc = pc.duns_loc
    AND pc.emp_id =: employeeID
    )
    SELECT score (1), d.
    DUNS d
    JOIN the subset s
    ON d.duns_loc = s.duns_loc
    WHERE CONTAINS (TEXT_KEY,: research, 1) > 0
    ORDER BY score (1) DESC;

    For reasons that we have not been able to identify this query actually takes longer to run than the sum times the contributing elements. This query takes more than 6 seconds to run. We, or our DBA can understand why this query runs worse than a large open research. Open research is not ideal because the query eventually folders back to the user, they do not have access to view.

    Has anyone ever encountered something like that? Any suggestions on what to watch or where to go? If someone wants more information to help diagnosis to let me know, and I'll be happy to produce it here.

    Thank you!!

    Since you're using two tables, you will get probably better performance on an index that uses a section group and a user_datastore that uses a procedure. He should be able to recover all the data with a simple query, and hit a single index. Please see the demo below. Indexing can be slower, but research should be faster. If you have your primary and foreign keys in place and current statistics before you create the index, it should speed up indexing.

    SCOTT@orcl_11gR2> -- tables:
    SCOTT@orcl_11gR2> CREATE TABLE duns
      2    (duns_loc       NUMBER,
      3       business_name  VARCHAR2 (15),
      4       business_name2 VARCHAR2 (15),
      5       address_line   VARCHAR2 (30),
      6       city            VARCHAR2 (15),
      7       state            VARCHAR2 (2),
      8       business_phone VARCHAR2 (15),
      9       contact_name   VARCHAR2 (15),
     10       contact_title  VARCHAR2 (15),
     11       text_key       VARCHAR2 (1),
     12       CONSTRAINT     duns_pk PRIMARY KEY (duns_loc))
     13  /
    
    Table created.
    
    SCOTT@orcl_11gR2> CREATE TABLE primary_contact
      2    (duns_loc       NUMBER,
      3       emp_id            NUMBER,
      4       CONSTRAINT     primary_contact_pk
      5                   PRIMARY KEY (emp_id, duns_loc),
      6       CONSTRAINT     primary_contact_fk FOREIGN KEY (duns_loc)
      7                   REFERENCES duns (duns_loc))
      8  /
    
    Table created.
    
    SCOTT@orcl_11gR2> -- data:
    SCOTT@orcl_11gR2> INSERT INTO duns (duns_loc, address_line) VALUES (1, 'highway')
      2  /
    
    1 row created.
    
    SCOTT@orcl_11gR2> INSERT INTO duns (duns_loc, address_line) VALUES (2, 'highway')
      2  /
    
    1 row created.
    
    SCOTT@orcl_11gR2> INSERT INTO primary_contact VALUES (1, 1)
      2  /
    
    1 row created.
    
    SCOTT@orcl_11gR2> INSERT INTO primary_contact VALUES (2, 2)
      2  /
    
    1 row created.
    
    SCOTT@orcl_11gR2> INSERT INTO duns (duns_loc, address_line)
      2  SELECT object_id, object_name
      3  FROM   all_objects
      4  WHERE  object_id > 2
      5  /
    
    76029 rows created.
    
    SCOTT@orcl_11gR2> INSERT INTO primary_contact
      2  SELECT object_id, namespace
      3  FROM   all_objects
      4  WHERE  object_id > 2
      5  /
    
    76029 rows created.
    
    SCOTT@orcl_11gR2> -- gather statistics:
    SCOTT@orcl_11gR2> EXEC DBMS_STATS.GATHER_TABLE_STATS (USER, 'DUNS')
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> EXEC DBMS_STATS.GATHER_TABLE_STATS (USER, 'PRIMARY_CONTACT')
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> -- procedure:
    SCOTT@orcl_11gR2> CREATE OR REPLACE PROCEDURE duns_proc
      2    (p_rowid IN ROWID,
      3       p_clob     IN OUT NOCOPY CLOB)
      4  AS
      5  BEGIN
      6    FOR d IN
      7        (SELECT duns_loc,
      8             '' ||
      9             business_name     || ' ' ||
     10             business_name2  || ' ' ||
     11             address_line  || ' ' ||
     12             city  || ' ' ||
     13             state     || ' ' ||
     14             business_phone  || ' ' ||
     15             contact_name  || ' ' ||
     16             contact_title ||
     17             ''
     18             AS duns_cols
     19         FROM      duns
     20         WHERE  ROWID = p_rowid)
     21    LOOP
     22        DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (d.duns_cols), d.duns_cols);
     23        FOR pc IN
     24          (SELECT '' || emp_id || '' AS pc_col
     25           FROM   primary_contact
     26           WHERE  duns_loc = d.duns_loc)
     27        LOOP
     28          DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (pc.pc_col), pc.pc_col);
     29        END LOOP;
     30    END LOOP;
     31  END duns_proc;
     32  /
    
    Procedure created.
    
    SCOTT@orcl_11gR2> SHOW ERRORS
    No errors.
    SCOTT@orcl_11gR2> -- user datastore, section group with field section:
    SCOTT@orcl_11gR2> begin
      2    ctx_ddl.create_preference ('duns_store', 'USER_DATASTORE');
      3    ctx_ddl.set_attribute ('duns_store', 'PROCEDURE', 'duns_proc');
      4    ctx_ddl.set_attribute ('duns_store', 'OUTPUT_TYPE', 'CLOB');
      5    ctx_ddl.create_section_group ('duns_sg', 'BASIC_SECTION_GROUP');
      6    ctx_ddl.add_field_section ('duns_sg', 'emp_id', 'emp_id', true);
      7  end;
      8  /
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> -- text index with user datastore and section group:
    SCOTT@orcl_11gR2> CREATE INDEX duns_context_index
      2  ON duns (text_key)
      3  INDEXTYPE IS CTXSYS.CONTEXT
      4  FILTER BY duns_loc
      5  PARAMETERS
      6    ('DATASTORE     duns_store
      7        SECTION GROUP     duns_sg
      8        SYNC          (ON COMMIT)')
      9  /
    
    Index created.
    
    SCOTT@orcl_11gR2> -- variables:
    SCOTT@orcl_11gR2> VARIABLE employeeid NUMBER
    SCOTT@orcl_11gR2> EXEC :employeeid := 1
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> VARIABLE search VARCHAR2(100)
    SCOTT@orcl_11gR2> EXEC :search := 'highway'
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> -- query:
    SCOTT@orcl_11gR2> SET AUTOTRACE ON EXPLAIN
    SCOTT@orcl_11gR2> SELECT SCORE(1), d.*
      2  FROM   duns d
      3  WHERE  CONTAINS
      4             (text_key,
      5              :search || ' AND ' ||
      6              :employeeid || ' WITHIN emp_id',
      7              1) > 0
      8  /
    
      SCORE(1)   DUNS_LOC BUSINESS_NAME   BUSINESS_NAME2  ADDRESS_LINE                   CITY            ST BUSINESS_PHONE
    ---------- ---------- --------------- --------------- ------------------------------ --------------- -- ---------------
    CONTACT_NAME    CONTACT_TITLE   T
    --------------- --------------- -
             3          1                                 highway
    
    1 row selected.
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 2241294508
    
    --------------------------------------------------------------------------------------------------
    | Id  | Operation                   | Name               | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT            |                    |    38 |  1102 |    12   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| DUNS               |    38 |  1102 |    12   (0)| 00:00:01 |
    |*  2 |   DOMAIN INDEX              | DUNS_CONTEXT_INDEX |       |       |     4   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       2 - access("CTXSYS"."CONTAINS"("TEXT_KEY",:SEARCH||' AND '||:EMPLOYEEID||' WITHIN
                  emp_id',1)>0)
    
    SCOTT@orcl_11gR2>
    
  • SQL query performance

    I have a table that lists the users visits to pages on our website. The information takes the type of structure within our next record table:

    VisitID | IDVisiteur | VisitPage | VisitDate
    Index | UniqueID. VisitPage | Date/time

    I need to get to IDVisiteur who visited in a user defined date range for a report that is to be written, and then get a count the days of separate visit that each user has visited our website. I have a request of work attached that will get me the result set, I want, but it's so _very_ slowly. Query Analyzer it shows that 84% included in table scans. I hope someone has a suggestion on how to optimize it. I am currently working on a MSSQL 8.0 Server, so I have no access to the function of tronque() that I would prefer to use on the dates, but that's a minor inconvenience.

    Thank you
    -Daniel

    Quote:
    Posted by: Dan Bracuk
    You have an index on visitdate?

    Visitdate contains real-time, or are all the parts of the time 0:00? If they are all from 00:00, you don't need the convert function. Otherwise, you might have better luck by selecting all data from your database and using Q of Q for the counties.

    Dan there on this one. Looking at the design table index was absent. Once I added an index my query performance dramatically, improved enough so that I don't have a lot of worries more. Thanks for the suggestion.

    -Daniel

  • The operation cannot be performed because the "Firefox" element is in use.

    Whenever I try to download the latest version of Firefox on my mac, I get the following error:

    "The operation cannot be performed because the"Firefox"element is in use."

    I close Firefox and still get this error. I tried this guy 100 times and may not know how to solve this problem. Help!

    I have Mac OS X 10.6.8 v.

    Download the full Firefox installation program and save the file to the desktop
    https://www.Mozilla.org/en-us/Firefox/all.html

    If he has problems with the update or with the permissions then best is to download the full version and trash the version currently installed to do a fresh install of the new version.

    Download a new copy of the Firefox application and save the file to disk on the desktop image

    Your personal data are stored in the Firefox profile folder, so you will not lose your bookmarks and other data to personal when you uninstall and (re) install Firefox.

  • Cannot update 3,010 FF.; Downloaded 3.6: impossible to copy in the app folder "the operation cannot be performed because you don't have sufficient privileges for some of the itemss.

    I had FF 3.0.10 for two years. My preferences are set to automatically check updates, my for a reason, it apparently never worked. I am the administrator for my Mac and have read/write permissions. The manual "check for update" under the menu help is disabled and will not work. " I tried to reset the permissions, quit and restart several times. At a given time, the window ' check for updates ' seems to be enabled, but froze when he started the download and came back to grey again. I tried to download 3.6 on your site, but when I try to drag FF in the app, I get a message that says "the operation cannot be performed because you don't have sufficient privileges for some of the items. Through it all, I noticed that my download folder is gone from the dock on my screen

    Your profile data is stored in the Firefox profile folder, so you will not lose your bookmarks and other personal data.

  • The upgrade of gaming performance

    I want to improve my computer performance when games. I would like to reach at least 60 fps on games such as Skyrim by running on the highest settings graphically. I don't know anything about other than some rudimentary knowledge material and would appreciate any ideas and links to hardware to buy. That is, graphics card, power supply.

    My comps Info:

    Model: h8-1000z

    : Processor Processor AMD Athlon (TM) II X 4 840 T

    RAM: 16 GB

    Graphics card: NVIDIA GeForce GT 530

    Power: 460 watts

    Hello

    Review this information on the system requirements of Skyrim.

    The only thing I see which is low with your current PC is the video card.

    Study it posted information onselection of a discrete graphics card Guide.

    The 660 NVIDIA would be an excellent choice with your current diet.

    The NVIDIA 670 or 680 would be better than the NVIDIA 660 if they adapt but should replace existing power. I recommend the Corsair CX600.

    You can do a search on the internet on Skyrim performance, tuning and FPS. There are many game tweeks and changes of the parameters that could be used to improve performance.  Be aware that if you play online then your interent speed and performance of the remote server will also effect your game performance.

    These articles HOWTO HPshould be useful.

  • Deleting files of Time Machine, "the operation cannot be performed because you have not granted access to some of the elements."

    I am trying to remove approximately two weeks (at a time), but I get "the operation cannot be performed because you have not granted access to some of the elements." How can I get around that?

    Thank you

    My OS is 10.11.3

  • Agilent 34401 react is not the * IDN? query

    I connected an Agilent 34401 via a GPIB cable. I saw the instrument in MAX. Her having a GPIB 9 address. But the device does not respond to the * IDN? query. What could be the reason?

    Implementation of command language? Page 165 of the instruments user manual. If you don't have it on paper, you can download it at http://cp.literature.agilent.com/litweb/pdf/34401-90004.pdf

  • Understand the * idn? query

    Hi all

    I just started using labview recently. I'm doing a vi that can connect to the oscilloscope, make measurements and save the data in a database.

    I have a VI in which the user can choose to activate up to 3 litters. Once it allows him, after you have entered the name of resource of Visa and scope model, I have a "sonnections chk" button which in effect 'ping' the instrument. For this I use the self test drivers found on ni.com/idnet. As far I could make out, self test drivers send the * tst? query.

    At the moment I am providing 2 varieties of scope and the agilant 34401 tektronix 1k2k series. the driver of the respective self-test according to which of the 2 user selects from a drop down list that I provided, is launched.

    Since I want to expand and include more extensive in the future, I thought universal way to check the connection. I read on the * idn? Query in the programmer of tek manual. I think that it is compatible with many instruments. I wasn't able to find any resource bad for the same thing and so I have a few questions.

    (1) what tools all support this request?

    (2) right now I use usb to connect, but it will make a difference if I use rs232 or gpib and then run the same query?

    (3) even if it is unrelated, the drivers scopes to ask for the run configuration. AFAIK in usb, which is fixed to the right connections?

    Thank you.

    The run configuration will get used only if the name of resource VISA points to a resource series.

  • Disabled user account control, when try to turn on the States of error message "you don't have the appropriate permissions to perform this action.

    Disabled user account control, when try to turn on the States of error message "you don't have the appropriate permissions to perform this action.

    What type of account selected for this account you upward?

    And your administrator account is now or not?

    go in Start > Control Panel > user accounts see what is written under your username.

Maybe you are looking for

  • Watch the battery draining quickly from ios3 in update

    Since the new watch iOS 3 update on my Apple Watch, my battery drains very quickly.  I don't have a lot of notifications, I've changed my face color to be just white, my activity level is the same as what it was before the update (30 minutes of work

  • Instructions immediately talk about Firefox window, but does not say how to get this window.

    It took me almost an hour to get to this point. I am technologically challenged. I have an old version of Firefox. The instructions immediately embark on the 'Firefox window' but says nothing about how to access this window. Where this window? Maybe

  • Can not go on the internet when everything seems to be OK.

    It is a mini Ipad. Was on the internet for a long time, then suddenly will not go on the internet. Everything seems to be correct. The checkbox to the left of the network and internet icon appears to the right of the network, but it will not go on th

  • Resolution of some 870 X gtx670m problems

    WARNING:I can not guarantee the accuracy, completeness or the assurance that it will work for you *. Hello forum,.My video card recently gave me problems, given the lack of amazing info on the web, I'll try to make this kind of a tutorial.* My rig:To

  • How will I know if my library's ePub files is stored in the iCloud?

    Hello everyone, I have a question: How can I know if the shape of pubs in my library are stored in the iCloud? Is there a sign or something to know? And if they are not stored in the iCloud, how can I do to save them, save them in the computer? Thank