Start to monitor a whild using Index table?

Thank you for taking my question!

I have a very long running job and I first followed the clues he uses. Each index that I try to follow Gets a RESOURCE BUSY error when I try to change the index.


Can someone tell me - is - this means that the index is in use OR you can not change the index when the table is in use?

Thank you!
Kathie

You will need an exclusive lock on the table (or clue?-in this case, it's the same for me) to do ALTER INDEX MYINDEX CONTROL USE

This means that you can not enable monitoring as long as there are other sessions/transactions performing DML against the table.

Tags: Database

Similar Questions

  • SQL, not not using index on a partitioned table

    I partitioned table that has rows over 15 million
    I have a query that selects records based on the flag = 1
    There are only 2 possible values for the flag, it is 0 or 1
    I tried two index and local bitmap index on this field.
    The query always uses full table scan
    any suggestions?

    Assuming that you have an index

    CREATE INDEX idx_maint_chg_flag
       ON a_maintenance( CASE WHEN record_changed = 1 THEN 1 ELSE NULL END);
    

    your request would be

    SELECT *
      FROM a_maintenance
     WHERE (CASE WHEN record_changed = 1 THEN 1 ELSE NULL END) = 1
    

    Of course, it may be easier to follow if you create a function is_record_changed

    CREATE FUNCTION is_record_changed( p_flag NUMBER )
      RETURN NUMBER
    IS
    BEGIN
      IF( p_flag = 1 )
      THEN
        RETURN p_flag;
      ELSE
        RETURN NULL;
      END IF;
    END;
    

    create an index on this function

    CREATE INDEX idx_maint_chg_flag
       ON a_maintenance( is_record_changed( record_changed ) );
    

    and use this function in your query

    SELECT *
      FROM a_maintenance
     WHERE is_record_changed( record_changed ) = 1
    

    Justin

  • Can I get the total number of records that meet the conditions of a query using the Table API?

    Hello

    A < row > TableIterator is returned when I ask operations using the index of tables. If I want to get the total number of records, I count one by one using the returned TableIterator < row >.


    Can I get the total number of records directly meets the conditions of the query?

    I can get the total number of records directly the request of the meeting of the conditions of CLI using the command Global table - name tableName - count - index index-name-field fieldName - start startValue-end endValue.

    Can I get the same results using the Table API?

    I used MongoDB and NoSQL Oracle for about a year. According to the experience of the use of these dbs, I think mongoDB querying interface is powerful. In the contras, the query interface is relatively simple, which results is a lot of work that is usually a long time in the client side.

    Hello

    Counting records in a database is a tricky thing.  Any system that gives you an accurate count of the records will have a hotspot of concurrency on updates, namely the place where the counting is maintained.  Such a count is a problem of performance in addition to competitive access problem.   The problem is even more difficult in a system widely distributed such a NoSQL database.

    The CLI has overall command that counts, but does so by brutal force - iterate keys that correspond to the parameters of the operation.  This is how you must do this within the API.  There is not a lot of code, but you have to write.  You certainly want to use TableIterator TableAPI.tableKeysIterator (), because a key iteration is significantly faster than the iteration of lines.  Just one iteration and count.

    If you use TableAPI.multiGet () and a key with a touch of brightness full then, in fact, count the results as they are returned in a single piece (a list).

    Kind regards

    George

  • [59053] use of follow-up was stopped because the tracking of use specified table

    Immideatly after starting the server, I'm gettting this newspaper in the NQServer.log.


    [59053] use of follow-up stopped because the specified use following table contained an incorrect number of columns or a column with a type of inappropriate data.

    No idea how I know what table needs to update?

    Thank you

    -SJ

    Here are the details of the paintings I have in the scheme of follow-up to its use:


    CREATE TABLE 'RMI. "" S_NQ_ACCT ".
    ("USER_NAME" VARCHAR2 (128 BYTE),
    VARCHAR2 (128 BYTE) "REPOSITORY_NAME."
    VARCHAR2 (128 BYTE) "SUBJECT_AREA_NAME."
    "NODE_ID" VARCHAR2 (15 BYTE),
    TIMESTAMP 'START_TS' (6).
    TIMESTAMP 'START_DT' (6).
    'START_HOUR_MIN' CHAR (5 BYTES),
    TIMESTAMP 'END_TS' (6).
    "END_DT" TIMESTAMP (6).
    'END_HOUR_MIN' CHAR (5 BYTES),
    'QUERY_TEXT' VARCHAR2 (1024 BYTE),
    NUMBER (10,0) "SUCCESS_FLG."
    "ROW_COUNT" NUMBER (10.0).
    NUMBER (10,0) "TOTAL_TIME_SEC."
    NUMBER (10,0) "COMPILE_TIME_SEC."
    NUMBER (10,0) "NUM_DB_QUERY."
    NUMBER (10,0) "CUM_DB_TIME_SEC."
    NUMBER (10,0) "CUM_NUM_DB_ROW."
    'CACHE_IND_FLG' CHAR (1 BYTE) DEFAULT ' ACTIVATE NOT NULL,.
    "QUERY_SRC_CD" VARCHAR2 (30 BYTES) BY DEFAULT ",
    "SAW_SRC_PATH" VARCHAR2 (250 BYTES) BY DEFAULT ",
    "SAW_DASHBOARD" VARCHAR2 (150 BYTES) BY DEFAULT ",
    "SAW_DASHBOARD_PG" VARCHAR2 (150 BYTES) BY DEFAULT ",
    "PRESENTATION_NAME" VARCHAR2 (128 BYTES) BY DEFAULT ",
    "TEXTE_ERREUR" VARCHAR2 (250 BYTES) BY DEFAULT ",
    "RUNAS_USER_NAME" VARCHAR2 (128 BYTES) BY DEFAULT ",
    NUMBER (10.0) 'NUM_CACHE_INSERTED' DEFAULT NULL,
    NUMBER (10.0) 'NUM_CACHE_HITS' DEFAULT NULL
    ) PCTFREE, PCTUSED, INITRANS 40 10 1 MAXTRANS 255 NOCOMPRESS SLAUGHTER
    STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645)
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 DEFAULT USER_TABLES)
    TABLESPACE "RMI_DATA";


    CREATING INDEX 'RMI. "' S_NQ_ACCT_M1 ' ON 'RMI. "" S_NQ_ACCT "("START_DT","START_HOUR_MIN","USER_NAME")
    PCTFREE, INITRANS 10 2 MAXTRANS 255
    STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645)
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 DEFAULT USER_TABLES)
    TABLESPACE "RMI_DATA";

    CREATING INDEX 'RMI. "' S_NQ_ACCT_M2 ' ON 'RMI. "" S_NQ_ACCT "("START_HOUR_MIN","USER_NAME")
    PCTFREE, INITRANS 10 2 MAXTRANS 255
    STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645)
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 DEFAULT USER_TABLES)
    TABLESPACE "RMI_DATA";

    CREATING INDEX 'RMI. "' S_NQ_ACCT_M3 ' ON 'RMI. "' S_NQ_ACCT ' ('USERNAME')
    PCTFREE, INITRANS 10 2 MAXTRANS 255
    STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645)
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 DEFAULT USER_TABLES)
    TABLESPACE "RMI_DATA";



    CREATE OR REPLACE FORCE VIEW "RMI". "' NQ_LOGIN_GROUP ' ('LOGIN', 'RESP') AS
    Select USER_NAME DISTINCT as "LOGIN", as S_NQ_ACCT RESP. RUNAS_USER_NAME
    ;

    Published by: SachinJ on August 3, 2009 07:54

    Compare the S_NQ_ACCT table that you created with the structure of the table defined in the RPD under the 'Oracle Analytics use' database of physical layer object.

  • HP dv5 does not start with monitor plugged

    Hello

    I have a HP Pavilion dv5 1130ea. I have an external monitor that I use as a second screen. However, this week yet he refuses to start when I plug in the monitor, it keeps cycling of the boot sequence prior (I don't get the option to press ESC to see a menu). If I plug it after it is initialized in this will work, but it will not correctly identify the monitor and I can't make it work with the correct screen resolution.

    Since these two problems are associated with monitor and appeared at the same time, I assume that they are related.

    I am running Windows 7, but since it won't even be the bios (or what is called the replacement of HP) I don't know it's relevance.

    Thank you

    David

    OK, solved the problem, it was not the laptop, it is the monitor.

  • View does not use index Mview underlying but mview uses indexes

    Hello

    I faced a situation where, while querying data to display based on mview does not use the index, but when we wonder of mview it uses index and produce quick results.

    Here are the details:

    
    querying from view: (completes in more than a minute even after passing hint)
    ================================
    explain plan for select /*+ index(  ITGI_CREDITOR_LEDGER_CMV ITGI_CREDITOR_LEDGER_INDX) */ * from CR_LEDGER_REP_V where vendor_id='1474911';
    
    Plan hash value: 463951623
    
    ---------------------------------------------------------------------------------------------------
    | Id  | Operation              | Name                     | Rows  | Bytes | Cost (%CPU)| Time     |
    ---------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT       |                          |  9056K|  5648M| 97644   (1)| 00:00:04 |
    |*  1 |  VIEW                  | CR_LEDGER_REP_V          |  9056K|  5648M| 97644   (1)| 00:00:04 |
    |   2 |   COUNT                |                          |       |       |            |          |
    |   3 |    MAT_VIEW ACCESS FULL| ITGI_CREDITOR_LEDGER_CMV |  9056K|  2159M| 97644   (1)| 00:00:04 |
    ---------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       1 - filter("VENDOR_ID"=1474911)
    
    
    
    Querying from mview: (completes within a second)
    ==============================
    
    explain plan for select /*+ index(  ITGI_CREDITOR_LEDGER_CMV ITGI_CREDITOR_LEDGER_INDX) */ * from ITGI_CREDITOR_LEDGER_CMV where vendor_id='1474911';
    
    
    Plan hash value: 1726512073
    
    --------------------------------------------------------------------------------------------------------------------
    | Id  | Operation                              | Name                      | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT                       |                           |    21 |  5880 |    21   (0)| 00:00:01 |
    |   1 |  MAT_VIEW ACCESS BY INDEX ROWID BATCHED| ITGI_CREDITOR_LEDGER_CMV  |    21 |  5880 |    21   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN                     | ITGI_CREDITOR_LEDGER_INDX |    22 |       |     3   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       2 - access("VENDOR_ID"=1474911)
    
    
    
    View DDL
    ========================
    
    CREATE OR REPLACE FORCE VIEW SANJAY.CR_LEDGER_REP_V
    (
       QRY,
       SR_NO,
       VENDOR_ID,
       VENDOR_TYPE,
       VENDOR_NUMBER,
       VENDOR_NAME,
       VENDOR_SITE_ID,
       VENDOR_SITE_CODE,
       GL_DATE,
       ACCOUNTING_DATE,
       PO,
       INVOICE_TYPE,
       AP_INVOICE_NO,
       INVOICE_DOC_CAT,
       AP_INVOICE_DATE,
       INVOICE_VOUCHER_NO,
       PAYMENT_VOUCHER_NO,
       CHQ_NO,
       DESCRIPTION,
       PAYMENT_DATE,
       ACC_CODE,
       PAYMENT_METHOD,
       CURR_CODE,
       DEBIT,
       CREDIT
    )
    AS
       SELECT qry,
              ROWNUM srn,
              vendor_id,
              vendor_type_lookup_code,
              vendor_no,
              vendor_name,
              vendor_site_id,
              vendor_site_code,
              gl_date,
              accounting_date,
              po_distribution_id,
              invoice_type_lookup_code,
              invoice_num,
              doc_category_code,
              invoice_date,
              inv_voucher_num,
              payment_num,
              check_number,
              description,
              pay_accounting_date,
              account_code,
              payment_method_code,
              invoice_currency_code,
              debit,
              credit
         FROM sanjay.itgi_creditor_ledger_cmv;
    
    
    
    

    The plan does not change even if I do not use advice.

    Although I said developer to use mview directly, but I did not understand this behavior.

    DB version: 12.1

    OPERATING SYSTEM: AIX 6.1

    Kind regards

    Gerard

    Note that the query on the view plan is only to apply your filter predicates on line 1, rather than against the mview in line 3. Line 2 said you that enforcement must correspond to a kind of County before it can filter which is due to the virtual rownum in your point of view.

    You need this column? In my opinion, it's meaningless. Remove the column from the view would mean that the view doesn't have to be assessed in its entirety (if not, how it will calculate rownums?) before allowing you to filter. You asked the developer to implement the work is likely to come with a different value of sr_no (if the developer is even using it?) than what he would have obtained by using the view.

    The column tries to catch a unique key for the view? Are you aware that rownum values can and will change between requests to the same table as the order lines are selected is not guaranteed. If the column is actually useful (and it is correct to calculate at this level) you then could it sense it is calculated inside the mview? This means that you can only refresh the mview completely and rownum values can (and will) only change on refresh.

  • SQL not using indexes at runtime, but by using the index in "explain plan".

    Hi all

    I am facing a problem here that I don't get to think.

    I have a SQL that makes a FULL ACCESS of TABLE into two tables and its costs are very high, but it occurs only when I run it in my program (I saw it in the session trace). If I do a "explain plan" sqlplus (SQL Navigator or PLSQL Developer) it shows that he use indexes and have a low cost. I already checked the statistics from both tables, and they are up to date.

    Did someone never facing a similar problem or knows something I can do to find my problem?

    Thank you all very much.

    Hello

    As far as I KNOW, optimizer Oracle never guarantees that an Index scan in query explain plan will be necessarily used during query execution.

    ORACLE-BASE - DBMS_XPLAN: Oracle display execution Plans

    Could you please read the above, run the query, as described and check the execution using DBMS_XPLAN plan. The cursor cache DISPLAY_CURSOR and not PLAN_TABLEs.

  • I get "failed to set the refresh attribute COMMIT for the materialized view" when I try to create a MV using a table and another MV

    Experts,

    I'm trying to create a YOUNG refreshable ON COMMIT MV (xyz) using a table (circuit) and quickly updateable on validation MV (abc), but get an error:

    SQL error: ORA-12054: cannot set the attribute ON COMMIT refresh for the materialized view

    12054 00000 - "cannot set the refresh attribute COMMIT for the materialized view.

    * Cause: The materialized view did not meet the requirements for update to

    moment of validation.

    * Action: Specify only valid options.

    1] MV abc
    = MV abc defined as below =.

    CREATE MATERIALIZED view abc_MV

    Immediate CONSTRUCTION

    REFRESH QUICKLY YOU COMMIT using constraints of trust

    WITH ROWID AS SELECT n.*,.

    n.ROWID noderowid

    node n

    where n.nodetype in (1610000069,1610007267);


    -Above works OK and MV connect you on table node is created successfully

    =====================================================

    [ 2] Circuit Board

    ======================================================

    CREATE MATERIALIZED VIEW LOG ON Cramer.Circuit WITH SEQUENCE, ROWID ( ) -all columns of table ofcircut parentheses

    INCLUDING THE NEW VALUES;

    -More top works OK and MV connect you on table circuit is created successfully

    ======================================================



    [3] trying to create MV xyz

    ======================================================

    CREATE MATERIALIZED VIEW LOG ON cramer.abc_MV WITH SEQUENCE, ROWID ( ) -all columns of abc_MV brackets

    INCLUDING THE NEW VALUES;

    -Above works OK and log on ABC MV MV gets created successfully

    -Problematic step below

    Xyz_MV CREATE MATERIALIZED VIEW

    IMMEDIATE CONSTRUCTION

    REFRESH QUICKLY YOU COMMIT using constraints of trust

    AS

    SELECT c., c.rowid circuit_rowid, n.rowid tr_rowid

    the circuit c, abc_mv n

    where circuit2startnode = n.nodeid

    and c.rpplanId = n.rpplanId;
    ==========================================================

    Clues on how to solve this problem and make quickly updatable ON Commit MV xyz

    Thanks in advance.

    Chanchal,

    If you can read my original post carefully you may have noticed that all these restrictions will not apply in my case.

    All,

    In any case I found the solution to my problem.

    There are a few additional restrictions for materialized views multilayer

    Additional Restrictions for master materialized views

    The following types of materialized views may not be masters of editable materialized views:

    • ROWIDmaterialized views
    • Complex materialized views
    • Read-only materialized views

    I've updated the underlying MV abc below and everything worked like a charm

    CREATE MATERIALIZED view abc_MV

    Immediate CONSTRUCTION

    REFRESH QUICKLY YOU COMMIT using constraints of trust

    IN SELECT

    n.*, n.rowid noderowid, nt.rowid nodetyperowid

    the node n, nodetype_m nt

    where n.node2nodetype = nt.nodetypeid

    and nt.nodetypeid in (1610000069,1610007267);

    Note: To ADD a join without which I was getting error below (although had primary key on the table of the node)

    SQL error: ORA-23415: materialized view log for "NODE" does not save the primary key

    23415 00000 - "view the log for materialized \"%s\".\"%s\"does not save the primary key.

    * Cause: A primary key materialized view is refreshed quickly, but the

    The materialized view log does not record the primary key information.

    * Action: Use CREATING MATERIALIZED VIEW LOG... Command to add a PRIMARY KEY to

    start recording of the primary key information in the materialized view

    Newspaper.

  • [SQL] Tuning why he can't use indexes?

    Here's a SQL that cannot use indexes

    SELECT T.FID FID,

    t.cfsignState SIGNSTATE,

    T.FNUMBER WBNUMBER,

    T1. CFCUSTOMERTRANSNUMBER CUNUMBER,

    T2. CFCOMPANYNAME CUSTOMERNAME,

    T.CFATTACHMENTFILE ATTFILE,

    T.CFATTACHMENT ATT

    OF CT_OPE_SIGNBILL T

    LEFT OUTER JOIN CT_OPE_WAYBILL T1

    ON T1. FID = T.CFWAYBILLID

    LEFT OUTER JOIN T2 CT_MAR_CUSTOMER

    ON T2. FID = T1. CFCUSTOMERID

    WHERE ((T.FNUMBER ('1410582816' N)) OR (T1.) CFCUSTOMERTRANSNUMBER (N '1410582816')));

    Elapsed time: 00:00:12.15

    Execution plan

    ----------------------------------------------------------

    Hash value of plan: 2925502694

    ------------------------------------------------------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Bytes | TempSpc | Cost (% CPU). Time | Pstart. Pstop |

    ------------------------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                 |     2.   420.       | 48996 (3) | 00:01:16 |       |       |

    |   1.  NESTED EXTERNAL LOOPS |                 |     2.   420.       | 48996 (3) | 00:01:16 |       |       |

    |*  2 |   FILTER |                 |       |       |       |            |          |       |       |

    |*  3 |    EXTERNAL RIGHT HASH JOIN |                 |     2.   310.    67 M | 48995 (3) | 00:01:16 |       |       |

    |   4.     RANGE OF PARTITION ALL THE |                 |  1241K |    53 M |       | 36422 (3) | 00:00:57 |     1.    63.

    |   5.      TABLE ACCESS FULL | CT_OPE_WAYBILL |  1241K |    53 M |       | 36422 (3) | 00:00:57 |     1.    63.

    |   6.     TABLE ACCESS FULL | CT_OPE_SIGNBILL |   907K |    95 M |       |  8217 (5) | 00:00:13 |       |       |

    |   7.   TABLE ACCESS BY INDEX ROWID | CT_MAR_CUSTOMER |     1.    55.       |     1 (0) | 00:00:01 |       |       |

    |*  8 |    INDEX UNIQUE SCAN | PK_MAR_CUSTOMER |     1.       |       |     1 (0) | 00:00:01 |       |       |

    ------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    2 - filter("T".") FNUMBER ' = U ' 1410582816 "OR 'T1'. '. CFCUSTOMERTRANSNUMBER '= U '1410582816')

    3 - access("T1".") IDF"(+) ="T ". ("' CFWAYBILLID")

    8 - access("T2".") IDF"(+) ="T1 ". ("' CFCUSTOMERID")

    Statistics

    ----------------------------------------------------------

    1 recursive calls

    19 db block Gets

    234698 compatible Gets

    191546 physical reads

    0 redo size

    1035 bytes sent via SQL * Net to client

    524 bytes received via SQL * Net from client

    2 SQL * Net back and forth to and from the client

    0 sorts (memory)

    0 sorts (disk)

    1 rows processed

    but, if I rewrite it as below, it can use indexes

    SELECT T.FID FID,

    t.cfsignState SIGNSTATE,

    T.FNUMBER WBNUMBER,

    T1. CFCUSTOMERTRANSNUMBER CUNUMBER,

    T2. CFCOMPANYNAME CUSTOMERNAME,

    T.CFATTACHMENTFILE ATTFILE,

    T.CFATTACHMENT ATT

    OF CT_OPE_SIGNBILL T

    LEFT OUTER JOIN CT_OPE_WAYBILL T1

    ON T1. FID = T.CFWAYBILLID

    LEFT OUTER JOIN T2 CT_MAR_CUSTOMER

    ON T2. FID = T1. CFCUSTOMERID

    WHERE ((T.FNUMBER (N '1410582816')))

    Union

    SELECT T.FID FID,

    t.cfsignState SIGNSTATE,

    T.FNUMBER WBNUMBER,

    T1. CFCUSTOMERTRANSNUMBER CUNUMBER,

    T2. CFCOMPANYNAME CUSTOMERNAME,

    T.CFATTACHMENTFILE ATTFILE,

    T.CFATTACHMENT ATT

    OF CT_OPE_SIGNBILL T

    LEFT OUTER JOIN CT_OPE_WAYBILL T1

    ON T1. FID = T.CFWAYBILLID

    LEFT OUTER JOIN T2 CT_MAR_CUSTOMER

    ON T2. FID = T1. CFCUSTOMERID

    WHERE ((T1. CFCUSTOMERTRANSNUMBER (N '1410582816')));

    Elapsed time: 00:00:00.02

    Execution plan

    ----------------------------------------------------------

    Hash value of plan: 2215743926

    -----------------------------------------------------------------------------------------------------------------------------------

    | ID | Operation | Name                     | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |

    -----------------------------------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                          |     2.   420.    11 (64) | 00:00:01 |       |       |

    |   1.  UNIQUE FATE |                          |     2.   420.    11 (64) | 00:00:01 |       |       |

    |   2.   UNION-ALL |                          |       |       |            |          |       |       |

    |   3.    NESTED EXTERNAL LOOPS |                          |     1.   210 |     4 (0) | 00:00:01 |       |       |

    |   4.     NESTED EXTERNAL LOOPS |                          |     1.   155.     3 (0) | 00:00:01 |       |       |

    |   5.      TABLE ACCESS BY INDEX ROWID | CT_OPE_SIGNBILL |     1.   110.     2 (0) | 00:00:01 |       |       |

    |*  6 |       INDEX RANGE SCAN | IDX_CT_OPE_SIGNBILL_IT01 |     1.       |     1 (0) | 00:00:01 |       |       |

    |   7.      TABLE ACCESS BY INDEX ROWID | CT_OPE_WAYBILL |  1241K |    53 M |     1 (0) | 00:00:01 | ROWID | ROWID |

    |*  8 |       INDEX UNIQUE SCAN | CPK_OPE_WAYBILLBP7 |     1.       |     1 (0) | 00:00:01 |       |       |

    |   9.     TABLE ACCESS BY INDEX ROWID | CT_MAR_CUSTOMER | 25598 |  1374K |     1 (0) | 00:00:01 |       |       |

    | * 10 |      INDEX UNIQUE SCAN | PK_MAR_CUSTOMER |     1.       |     1 (0) | 00:00:01 |       |       |

    |  11.    NESTED LOOPS |                          |     1.   210 |     5 (0) | 00:00:01 |       |       |

    |  12.     NESTED EXTERNAL LOOPS |                          |     1.   100.     4 (0) | 00:00:01 |       |       |

    |  13.      TABLE ACCESS BY INDEX ROWID | CT_OPE_WAYBILL |     1.    45.     3 (0) | 00:00:01 | ROWID | ROWID |

    | * 14 |       INDEX RANGE SCAN | IDX$ $_47CB0003 |     1.       |     2 (0) | 00:00:01 |       |       |

    |  15.      TABLE ACCESS BY INDEX ROWID | CT_MAR_CUSTOMER |     1.    55.     1 (0) | 00:00:01 |       |       |

    | * 16.       INDEX UNIQUE SCAN | PK_MAR_CUSTOMER |     1.       |     1 (0) | 00:00:01 |       |       |

    |  17.     TABLE ACCESS BY INDEX ROWID | CT_OPE_SIGNBILL |     1.   110.     2 (0) | 00:00:01 |       |       |

    | * 18.      INDEX RANGE SCAN | IDX$ $_47C30001 |     1.       |     1 (0) | 00:00:01 |       |       |

    -----------------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    6 - access("T".") FNUMBER "= U '1410582816')

    8 - access("T1".") IDF"(+) ="T ". ("' CFWAYBILLID")

    10 - access("T2".") IDF"(+) ="T1 ". ("' CFCUSTOMERID")

    14 - access("T1".") CFCUSTOMERTRANSNUMBER '= U '1410582816')

    16 - access("T2".") IDF"(+) ="T1 ". ("' CFCUSTOMERID")

    18 - access("T1".") IDF '=' T '. ("' CFWAYBILLID")

    Statistics

    ----------------------------------------------------------

    1 recursive calls

    0 db block Gets

    Gets 11 coherent

    0 physical reads

    0 redo size

    1035 bytes sent via SQL * Net to client

    524 bytes received via SQL * Net from client

    2 SQL * Net back and forth to and from the client

    1 sorts (memory)

    0 sorts (disk)

    1 rows processed

    SQL >

    My Question is why the first statement cannot use indexes? What is its mechanism?

    as Maria Colgan explains in his commentary on https://blogs.oracle.com/optimizer/entry/or_expansion_transformation: "since OR expansion is a transformation focused on costs, it cannot always take place." It cannot take place, then it can be forced by using the indicator, USE_CONCAT. "Fundamentally OR expansion is

    a transformation that can be used to optimize the disjunctive queries (queries that contain clauses of GOLD). The basic idea of in the expansion of the GOLD is to transform a query containing the disjunctions in the form of a query UNION ALL of two or more branches. This is done by dividing the disjunction in components and by associating each component with a branch of a query UNION all.

    So, you can use the USE_CONCAT flag to check if OR expansion is an option at all for the optimizer in your example. The strategy itself is quite old and mentioned by Tom Kyte in https://asktom.oracle.com/pls/apex/f?p=100:11:0:P11_QUESTION_ID:921229345078.

  • Need quick help! The use of tables

    I just started using flash a few weeks ago, and for one of my school projects I am creating a pokedex which will display information, when the user clicks on some buttons. for example 'If you click the attack button, then 4 attacks will appear. I currently use frame skipping to my application; but my teacher suggested I use tables to make them all appear on a single image, but I don't know how to do this. Can anyone help?

    Thanks in advance.

    Tables are variables that contain several elements. A common use for tables is to make collections of items so that items can be related to each other by their relative position in each table. For example:

    var letters: Array = new Array ("A", "B", "C", "D");

    Table of figures: var = new Array (1,2,3,4).

    Now, you can find an element in a table by searching for here:

    var thisOne:int = letters.indexOf ('B');

    trace (thisOne);

    var thatOne:Number = numbers [letters.indexOf ('B')];

    trace (thatOne);

    The first trace shows that the letter B is in position 1 of the table letters. The trace of the second shows that the item in the table of figures in position 1 is number 2.

    Who help me? You can learn more about the use of arrays in Flash here: ActionScript 3 fundamentals: paintings | Adobe Developer Connection

  • Why the feature multiple column indexes using index skip scan?

    Hi all

    I have just been hired by a new company and I explored its database infrastructure. Interestingly, I see several function based indexed column used for all the tables. I found it strange, but they said ' we use Axapta to connect Axapta with Oracle, function index according to should be used to improve performance. Therefore, our DBAs create several indexes of feature based for each table in the database. "Unfortunately, I can not judge their business logic.

    My question is, I just created similar to my local database tables in order to understand the behavior of the function index according to several columns. In order to create indexes of based function (substr and nls_lower), I have to declare the columns as varchars2. Because in my business our DBAs had created a number of columns as a varchar2 data type. I created two excatly same table for my experience. I create miltiple function according to index on the my_first table, and then I create several normal index on the my_sec table. The interesting thing is, index skip scan cannot be performed on more than one basic function index (table my_first). However, it can be performed to normal several index on my_sec table. I hope that I have to express myself clearly.

    Note: I also ask the logic of the rule function based index, they said when they index a column they don't ((column length) * 2 + 1) formula. For example, I want to create indexes on the zip code column, column data type VARCHAR2 (3), so I have to use 3 * 2 + 1 = 7, (substr (nls_lower (areacode), 1, 7). substr (nls_lower ()) notation is used nested for any function function index. I know that these things are very illogical, but they told me, they use this type of implementation for Axapta.

    Anyway, in this thread, my question is reletad to function function with index index skip scan, not logical bussiness, because I can not change the business logic.

    Also, can you please give hints or clues for multiple function based indexes?

    Thanks for your help.


    SQL > create table my_first as select '201' codeZone, to_char (100 + rownum) account_num, dbms_random.st
    Ring name ('A', 10) from dual connect by level < = 5000;

    Table created.

    SQL > create table my_sec as select '201' codeZone, to_char (100 + rownum) account_num, dbms_random.st

    Ring name ('A', 10) from dual connect by level < = 5000;

    Table created.

    SQL > alter table my_first change account_num varchar2 (12);

    Modified table.


    SQL > alter table my_sec change account_num varchar2 (12);

    Modified table.

    SQL > alter table my_first change codeZone VARCHAR2 (3);

    Modified table.

    SQL > alter table my_sec change codeZone VARCHAR2 (3);

    Modified table.

    SQL > create index my_first_i on my_first (substr (nls_lower (areacode), 1, 7), substr (nls_lower (account_num), 1, 15));

    The index is created.

    SQL > create index my_sec_i on my_sec (area code, account_num);

    The index is created.

    SQL > analyze table my_first computing statistics for all columns indexed for all indexes.

    Parsed table.

    SQL > analyze table my_sec computing statistics for all columns indexed for all indexes.

    Parsed table.

    SQL > exec dbms_stats.gather_table_stats (USER, 'MY_FIRST');

    PL/SQL procedure successfully completed.

    SQL > exec dbms_stats.gather_table_stats (USER, 'MY_SEC');

    PL/SQL procedure successfully completed.

    SQL > my_first desc;
    Name                                      Null?    Type
    ----------------------------------------- -------- ----------------------------
    CODEZONE VARCHAR2 (3)
    ACCOUNT_NUM VARCHAR2 (12)
    NAME VARCHAR2 (4000)

    SQL > desc my_sec
    Name                                      Null?    Type
    ----------------------------------------- -------- ----------------------------
    CODEZONE VARCHAR2 (3)
    ACCOUNT_NUM VARCHAR2 (12)
    NAME VARCHAR2 (4000)

    SQL > select * from my_sec where account_num = '4000';


    Execution plan
    ----------------------------------------------------------
    Hash value of plan: 1838048852

    --------------------------------------------------------------------------------
    --------

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). TI
    me |

    --------------------------------------------------------------------------------
    --------

    |   0 | SELECT STATEMENT |          |     1.    19.     3 (0) | 00
    : 00:01 |

    |   1.  TABLE ACCESS BY INDEX ROWID | MY_SEC |     1.    19.     3 (0) | 00
    : 00:01 |

    |*  2 |   INDEX SKIP SCAN | MY_SEC_I |     1.       |     2 (0) | 00
    : 00:01 |

    --------------------------------------------------------------------------------
    --------


    Information of predicates (identified by the operation identity card):
    ---------------------------------------------------

    2 - access ("ACCOUNT_NUM" = '4000')
    Filter ("ACCOUNT_NUM" = '4000')


    Statistics
    ----------------------------------------------------------
    1 recursive calls
    0 db block Gets
    Gets 7 compatible
    0 physical reads
    0 redo size
    543 bytes sent via SQL * Net to client
    384 bytes received via SQL * Net from client
    2 SQL * Net back and forth to and from the client
    0 sorts (memory)
    0 sorts (disk)
    1 rows processed

    SQL > select * from my_first where substr (nls_lower (account_num), 1: 25) = '4000';


    Execution plan
    ----------------------------------------------------------
    Hash value of plan: 1110109060

    ------------------------------------------------------------------------------
    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
    ------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT |          |     1.    20.     9 (12) | 00:00:01 |
    |*  1 |  TABLE ACCESS FULL | MY_FIRST |     1.    20.     9 (12) | 00:00:01 |
    ------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):
    ---------------------------------------------------

    1 Filter (SUBSTR (NLS_LOWER ("MY_FIRST". "" "" ACCOUNT_NUM")(, 1, 15) ="4000"
    AND SUBSTR (NLS_LOWER ("ACCOUNT_NUM"), 1, 25) = '4000')


    Statistics
    ----------------------------------------------------------
    15 recursive calls
    0 db block Gets
    Gets 26 consistent
    0 physical reads
    0 redo size
    543 bytes sent via SQL * Net to client
    384 bytes received via SQL * Net from client
    2 SQL * Net back and forth to and from the client
    0 sorts (memory)
    0 sorts (disk)
    1 rows processed

    SQL > Select / * + INDEX_SS (MY_FIRST) * / * from my_first where substr (nls_lower (account_num), 1: 25) = '4000';


    Execution plan
    ----------------------------------------------------------
    Hash value of plan: 2466066660

    --------------------------------------------------------------------------------
    ----------

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU).
    Time |

    --------------------------------------------------------------------------------
    ----------

    |   0 | SELECT STATEMENT |            |     1.    20.    17 (6) |
    00:00:01 |

    |*  1 |  TABLE ACCESS BY INDEX ROWID | MY_FIRST |     1.    20.    17 (6) |
    00:00:01 |

    |*  2 |   INDEX SCAN FULL | MY_FIRST_I |     1.       |    16 (7) |
    00:00:01 |

    --------------------------------------------------------------------------------
    ----------


    Information of predicates (identified by the operation identity card):
    ---------------------------------------------------

    1 - filter (SUBSTR (NLS_LOWER ("ACCOUNT_NUM"), 1, 25) = '4000')
    2 - access (SUBSTR (NLS_LOWER ("ACCOUNT_NUM"), 1, 15) = '4000')
    Filter (substr (NLS_LOWER ("ACCOUNT_NUM"), 1, 15) = '4000')


    Statistics
    ----------------------------------------------------------
    15 recursive calls
    0 db block Gets
    857 consistent gets
    0 physical reads
    0 redo size
    543 bytes sent via SQL * Net to client
    384 bytes received via SQL * Net from client
    2 SQL * Net back and forth to and from the client
    0 sorts (memory)
    0 sorts (disk)
    1 rows processed

    Check MoS for a bug with the FBI and Skip Scan - it sounds like it could be a bug.

    On 11.2.0.4 with your sample code 10053 trace shows the optimizer whereas an index FULL scan to the point where she should consider an index SKIP scan for "unique table path".

    A person with 12.1.0.1 practice would like to run your test and see if it's fixed in this version.

    Concerning

    Jonathan Lewis

  • How Oracle use Index?

    RDBMS 11.2.0.3

    Hi all

    Suppose I have create the following table and the primary key:
    CREATE TABLE DUMMY_I( BOC NUMBER, START_TIME DATE, END_TIME DATE);
    
    ALTER TABLE DUMMY_I  
    MODIFY (BOC NOT NULL);
    
    ALTER TABLE DUMMY_I  
    MODIFY (START_TIME NOT NULL);
    
    ALTER TABLE DUMMY_I
    ADD CONSTRAINT DUMMY_I_PK PRIMARY KEY 
    ( BOC, START_TIME) ENABLE;
    A query with Oracle will use a PK Index:
    SELECT * FROM
    DUMMY_I 
    WHERE BOC = :v01
    AND START_TIME = :v02
    But the my dobout is when I need to add field in my query:
    SELECT * FROM
    DUMMY_I
    WHERE  BOC = :v01
    AND START_TIME = :v02
    AND END_TIME != :v03
    In the example above: how to create an Index to optimize my request?

    Given that BOC and START_TIME already have an index. Then I should create an Index unique addition field END_TIME and Oracle will use both indexes to optimize my request?
    Or
    I need to create a new Index with BOC, START_TIME, END_TIME?

    Hello

    Take a look at this, especially the Index scan to the chapter

    http://docs.Oracle.com/CD/E29597_01/server.1111/e16638/optimops.htm#autoId9

    Oracle uses indexes in several different ways, which will have much more to understand than a forum thread
    of course, if you have a specific question, pull :)

    on your original question:

    both cases are possible, but

    (a) index on BOC, START_TIME, END_TIME - its pretty simple so that it works and as simple good

    (b) index on BOC, START_TIME and END_TIME index
    Oracle can (but not necessarily will!) use both indexes in a JOIN INDEX, also a long time that you reference that these and any additional unindexed columns (if there is one)

    Given this example with queries, one is more appropriate here, but he cannot say in general.

  • using plsql table and ref cursor in oracle's 10 g

    Hi all
    Can someone give me an example of a scenario where we need to create a form manually based on a stored database procedure.
    And in this process, I created a pl/sql table and a Ref cursor at the database level.

    CREATE OR REPLACE PACKAGE SCOTT. TYPE BONUS_PKG IS bonus_rec
    IS (RECORD
    EmpNo bonus_EMP.empno%TYPE,
    Ename bonus_EMP.ename%TYPE,
    employment bonus_EMP.job%TYPE,
    SAL bonus_EMP.sal%TYPE,
    Comm bonus_EMP.comm%TYPE);

    TYPE b_cursor IS REF CURSOR RETURN bonus_rec;
    TYPE bontab IS TABLE OF bonus_rec INDEX DIRECTORY.

    PROCEDURE bonus_refcur (bonus_data IN OUT b_cursor);
    PROCEDURE bonus_query (bonus_data IN OUT bontab);
    END bonus_pkg;


    CREATE OR REPLACE PACKAGE BODY SCOTT. BONUS_PKG IS
    PROCEDURE bonus_query (bonus_data IN OUT bontab) IS
    II NUMBER;
    CURSOR bonselect IS
    SELECT empno, ename, job, sal, comm bonus_EMP ORDER BY empno;
    BEGIN
    OPEN bonselect.
    II: = 1;
    LOOP
    Look FOR bonselect IN
    .EmpNo bonus_data (ii),
    .ename bonus_data (ii),
    .job bonus_data (ii),
    .Sal bonus_data (ii),
    .comm bonus_data (ii);
    EXIT WHEN bonselect % NOTFOUND;
    II: = ii + 1;
    END LOOP;
    END bonus_query;

    PROCEDURE bonus_refcur (bonus_data IN OUT b_cursor) IS
    BEGIN
    Bonus_data OPEN to SELECT empno, ename, job, sal, comm bonus_EMP ORDER BY empno;
    END bonus_refcur;

    END bonus_pkg;

    I want to fill in the data in the forms manually is not using Forms data block Wizard and by program.

    Please answer...

    Can someone give me an example of a scenario where we need to create a form manually based on a stored database procedure.

    In general, you will use a block of proceedings based when you have a collection of data from several tables presented in a form and your username must be able to update the information displayed.

    In your sample code, looks like you are using Oracle Support document "Melting a block on a Stored Procedure - examples of Code [ID 66887.1]". If this is the case, continue to follow the document - it guides you through all the steps. There is no need to manually configure things that the data block Wizard will work for you!

    I want to fill in the data in the forms manually is not using Forms data block Wizard and by program.

    Why? Let the wizard block configuration data of your block based on a procedure for you. There is no need to manually browse the data! I did what you're trying, and it's more work needed. Leave forms to do the work for you. :)

    If you absolutely have to do things manually, I recommend that you use the PROCEDURE bonus_query (bonus_data IN OUT bontab) instead of bonus_refcur (bonus_data IN OUT b_cursor) . Then, in your code create a variable of type BONTAB, and then call the bonus_query procedure. Then, it's a simple case of a loop in the table of records returned by the bonus_query procedure. For example:

    DECLARE
       t_bonus    bonus_pkb.bontab;
    BEGIN
       bonus_pkg.bonus_query(t_bonus);
    
       FOR i in 1 .. t_bonus.count LOOP
          :YOUR_BLOCK.EMPLOYEE_NUMBER := t_bonus(i).empno;
          :YOUR_BLOCK.EMPLOYEE_NAME := t_bonus(i).ename;
          :YOUR_BLOCK.EMPLOYEE_JOB := t_bonus(i).job;
          :YOUR_BLOCK.EMPLOYEE_SALARY := t_bonus(i).sal;
          :YOUR_BLOCK.EMPLOYEE_COMMISSION := t_bonus(i).comm;
       END LOOP;
    END;
    

    This code example shows the basics, but as is the sample code - you will need to adapt to your situation.

    Also, I highly recommend that you look at the article inol listed. It is a very thorough debate on the REF CURSOR. If you have set up using a procedure based on the data source - it is more effective to spend the record table to your form that it must pass a ref cursor Using a ref cursor, you might as well just using a standard called cursor and loops on your named cursor. The effect is the same (a line returned at the same time creating lots of network traffic). Using the table of records is more efficient because the data set is returned if the network traffic is reduced.

    Hope this helps,
    Craig B-)

    If someone useful or appropriate, please mark accordingly.

  • Increase in size of database extremely - need to monitor the size of the table

    Hi all

    I need help in the growth of the follow-up tables. It's that the database grows enormously from 192 G at 200 over five days, representing 5% increase in database size. The general scenario is that is that the db is growing 20% annually, but this increase in a week will cause future hardware problems.

    Please advice to find the tables that is still growing.

    Thank you
    DBA Junr.

    Hi Georges s/n, do not know if this will help you now, but I did something like this on a daily basis for about 3 years. Literally, I have the size of each segment on a daily basis for this time and can go back in the graphic history of growth. If I had the question you ask the subject that I would be able to tell you exactly what segments are developed. If you need this on a smaller time frame, you can change the data stored in the column "created_date' to all the hours I guess.

    Anyway, here's the create statement.

    create table db_segment_history
    (
      db_segment_history_id     integer not null,
      owner                 varchar2(30),
      segment_name          varchar2(81),
      partition_name        varchar2(30),
      segment_type          varchar2(18),
      created_date          date default trunc(sysdate) not null,
      tablespace_name       varchar2(30),
      header_file           number,
      header_block          number,
      bytes                 number,
      blocks                number,
      block_size            number,
      extents               number,
      initial_extent        number,
      next_extent           number,
      min_extents           number,
      max_extents           number,
      pct_increase          number,
      freelists             number,
      freelist_groups       number,
      relative_fno          number,
      buffer_pool           varchar2(7)
    );
    
    create sequence db_segment_history_seq cache 1000;
    
    create unique index xpkdb_segment_history on db_segment_history( db_segment_history_id );
    
    alter table db_segment_history add ( constraint xpkdb_segment_history primary key ( db_segment_history_id )
    using index );
    
    create unique index ak1db_segment_history on db_segment_history(
         owner, segment_name, partition_name, segment_type, created_date );
    
    create trigger db_segment_history_bir
    before insert on db_segment_history
    for each row
    begin
         select     db_segment_history_seq.nextval
         into     :new.db_segment_history_id
         from     dual;
    end;
    /
    

    This is the insert / select that I use.

    insert into db_segment_history(
         owner, segment_name, created_date,
         partition_name, segment_type, tablespace_name,
         header_file, header_block, bytes,
         blocks, block_size, extents,
         initial_extent, next_extent, min_extents,
         max_extents, pct_increase, freelists,
         freelist_groups, relative_fno, buffer_pool )
    select  owner, segment_name, trunc( sysdate ),
         partition_name, segment_type, tablespace_name,
         header_file, header_block, bytes,
         blocks, bytes/blocks block_size, extents,
         initial_extent, next_extent, min_extents,
         max_extents, pct_increase, freelists,
         freelist_groups, relative_fno, buffer_pool
    from    dba_segments
    where   tablespace_name in(
              select tablespace_name from dba_tablespaces where contents = 'PERMANENT' );
    
    commit;
    

    I hope this helps.
    Michael Cunningham

    Published by: Michael C on February 21, 2012 14:19

  • How to use a table in a SQL query

    Hello

    I need to use a table of numbers as a VARRAY or table of associated Index so that I can do the following SQL code:

    Select *.
    of *.
    where the array is null or id is in table

    So that if the array is empty it returns all the records, and if the table is not empty, then it will return only the rows associated with the ID of the table.

    Is this possible?

    Kind regards

    Nestor Boscan

    In fact, solution I posted returns all rows when VARRAY is empty, not when it is null. To return all the rows when VARRAY is null, use:

    SQL> select  ename
      2    from  emp
      3    where deptno in (select * from table(cast(sys.OdciNumberList(10,30) as sys.OdciNumberList)))
      4       or sys.OdciNumberList(10,30) is null
      5  /
    
    ENAME
    ----------
    ALLEN
    WARD
    MARTIN
    BLAKE
    CLARK
    KING
    TURNER
    JAMES
    MILLER
    
    9 rows selected.
    
    SQL> select  ename
      2    from  emp
      3    where deptno in (select * from table(cast(null as sys.OdciNumberList)))
      4       or null is null
      5  /
    
    ENAME
    ----------
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    KING
    TURNER
    ADAMS
    
    ENAME
    ----------
    JAMES
    FORD
    MILLER
    
    14 rows selected.
    
    SQL> 
    

    SY.

Maybe you are looking for

  • How to stop an e-mail address to unwanted

    I have an e-mail address that is in a filter and the filter is supposed to work upstream of the junk e-mail filter. However, every single email from this email address goes into the spam folder. How can I get Thunderbird to:1. respect the filter that

  • Partition too small BOOTCAMP?

    Hello world I have a small question about Boot Camp. Yesterday, I installed Boot Camp on a 500GB partition created with Boot Camp. I realized that on Windows, it says that my Windows disc is only 465 GB and even with the HARD of Macintosh disk that i

  • How can I Log In to account in second Partition?

    On my Windows XP PRO, I have a side for the journal of my wife with a password that works very well. However, on the other side where I suppose that is to connect to be asked a password. I've never set up a password on my side of the partition. So, h

  • Add or remove programs will not fill

    In Control Panel, click Add/Remove programs. Nothing, just white.

  • Windows Vista (32 bit) backup

    I just realized a rapidespour complete my data files to PC hard drive for the first time, which took more than 3 hours. It's an external hard drive. It could be seen to copy the files on the external hard drive. But when I checked after (while there