Creating Index to a master table

Hello All,
I have a database table with the following fields
CLIENT 
MATNR
KORDX
KCATV
VARIANT_NBR
With the initial four fields making the primary key.  ( CLIENT, MATNR,  KORDX, KCATV).
I would like to put an index to the table with the fields  (CLIENT, VARIANT_NBR), because there are many reads in the program for the field VARIANT_NBR. Could you please put across on views on this. What all factors should I consider for creating an index in performance perspective.
Thanks in advance
Sudha

Hi,
Regarding indexes information check this link...
http://help.sap.com/saphelp_nw04/helpdata/en/cc/7c58b369022e46b629bdd93d705c8c/content.htm
and
http://www.ncsu.edu/it/mirror/mysql/doc/maxdb/en/6a/c943401a306f13e10000000a1550b0/content.htm
And also go through the below information...
They may help you in optimizing your program.
The Optimizer
Each database system uses an optimizer whose task is to create the execution plan for SQL statements (for example, to determine whether to use an index or table scan). There are two kinds of optimizers:
1) Rule based
Rule based optimizers analyze the structure of an SQL statement (mainly the SELECT and WHERE clauses without their values) and the table index or indexes. They then use an algorithm to work out which method to use to execute the statement.
2) Cost based
Cost based optimizers use the above procedure, but also analyze some of the values in the WHERE clause and the table statistics. The statistics contain low and high values of the fields, or a histogram containing the distribution of data in the table. Since the cost based optimizer uses more information about the table, it usually leads to faster database access. Its disadvantage is that the statistics have to be periodically updated.
Minimize the Search Overhead
You minimize the size of the result set by using the WHERE and HAVING clauses. To increase the efficiency of these clauses, you should formulate them to fit with the database table indexes.
Database Indexes
Indexes speed up data selection from the database. They consist of selected fields of a table, of which a copy is then made in sorted order. If you specify the index fields correctly in a condition in the WHERE or HAVING clause, the system only searches part of the index (index range scan). The primary index is always created automatically in the R/3 System. It consists of the primary key fields of the database table. This means that for each combination of fields in the index, there is a maximum of one line in the table. This kind of index is also known as UNIQUE. If you cannot use the primary index to determine the result set because, for example, none of the primary index fields occur in the WHERE or HAVING clause, the system searches through the entire table (full table scan). For this case, you can create secondary indexes, which can restrict the number of table entries searched to form the result set. You specify the fields of secondary indexes using the Abap Dictionary. You can also determine whether the index is unique or not. However, you should not create secondary indexes to cover all possible combinations of fields. Only create one if you select data by fields that are not contained in another index, and the performance is very poor. Furthermore, you should only create secondary indexes for database tables from which you mainly read, since indexes have to be updated each time the database table is changed. As a rule, secondary indexes should not contain more than four fields, and you should not have more than five indexes for a single database table. If a table has more than five indexes, you run the risk of the optimizer choosing the wrong one for a particular operation. For this reason, you should avoid indexes with overlapping contents. Secondary indexes should contain columns that you use frequently in a selection, and that are as highly selective as possible. The fewer table entries that can be selected by a certain column, the higher that column's selectivity. Place the most selective fields at the beginning of the index. Your secondary index should be so selective that each index entry corresponds to at most five percent of the table entries. If this is not the case, it is not worth creating the index. You should also avoid creating indexes for fields that are not always filled, where their value is initial for most entries in the table. If all of the columns in the SELECT clause are contained in the index, the system does not have to search the actual table data after reading from the index. If you have a SELECT clause with very few columns, you can improve performance dramatically by including these columns in a secondary index.
Formulating Conditions for Indexes
You should bear in mind the following when formulating conditions for the WHERE and HAVING clauses so that the system can use a database index and does not have to use a full table scan. Check for Equality and Link Using AND The database index search is particularly efficient if you check all index fields for equality (= or EQ) and link the expressions using AND.
Use Positive conditions
The database system only supports queries that describe the result in positive terms, for example, EQ or LIKE. It does not support negative expressions like NE or NOT LIKE. If possible, avoid using the NOT operator in the WHERE clause, because it is not supported by database indexes; invert the logical expression instead.
Using OR
The optimizer usually stops working when an OR expression occurs in the condition. This means that the columns checked using OR are not included in the index search. An exception to this are OR expressions at the outside of conditions. You should try to reformulate conditions that apply OR expressions to columns relevant to the index, for example, into an IN condition.
Using Part of the Index
If you construct an index from several columns, the system can still use it even if you only specify a few of the columns in a condition. However, in this case, the sequence of the columns in the index is important. A column can only be used in the index search if all of the columns before it in the index definition have also been specified in the condition.
Checking for Null Values
The IS NULL condition can cause problems with indexes. Some database systems do not store null values in the index structure. Consequently, this field cannot be used in the index.
Avoid Complex Conditions
Avoid complex conditions, since the statements have to be broken down into their individual components by the database system.
Hope this information had helped you.
Regards
Narin Nandivada.

Similar Messages

  • Creating index on large partitioned table

    Is anyone aware of a method for telling how far along is the creation of an index on a large partitioned table? The statement I am executing is like this:
    CREATE INDEX "owner"."new_index"
    ON "owner"."mytable"(col_1, col_2, col_3, col_4)
    PARALLEL 8 NOLOGGING ONLINE LOCAL;
    This is a two-node RAC system on Windows 2003 x64, using ASM. There are more than 500,000,000 rows in the table, and I'd estimate that each row is about 600-1000 bytes in size.
    Thank you.

    you can know the progress from v$session_longops.
    select
    substr(SID ||','||SERIAL# ,1,8) "sid,srl#",
    substr(OPNAME ||'>'||TARGET,1,50) op_target,
    substr(trunc(SOFAR/TOTALWORK*100)||'%',1,5) progress,
    TIME_REMAINING rem,
    ELAPSED_SECONDS elapsed
    from v$session_longops
    where SOFAR!=TOTALWORK
    order by sid;
    hth

  • Errors creating indexes on Binary XML Tables

    Hi,
    Oracle details are as follows:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE 11.2.0.2.0 Production"
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    I'm currently having an issue when attempting to create a suitable index on a binary xml table. I have a Binary xml table that stores a number of xml documents. I have created an index on this table as follows:
    create index TEST_WQI_idx_1 on TEST_WEB_QUOTE_INDX1(OBJECT_VALUE)
    INDEXTYPE IS XDB.XMLINDEX
    PARAMETERS ('PATHS (INCLUDE
    (/webPolicy/QuoteId))');
    Querying the table with the following:
    SQL> l
    1 select xmlcast(xmlquery('/webPolicy/Sections/interopSection[1]/PolicyItems/item/Version/text()' PASSING OBJECT_VALUE RETURNING CONTENT)
    2 as number) "VERSION",
    3 xmlcast(xmlquery('/webPolicy/QuoteId/text()' PASSING OBJECT_VALUE RETURNING CONTENT)
    4 as number) "QUOTEID"
    5 FROM TEST_WEB_QUOTE_INDX1
    6 where xmlcast(xmlquery('/webPolicy/QuoteId/text()' PASSING OBJECT_VALUE RETURNING CONTENT)
    7* as number) = 22824
    SQL> /
    VERSION QUOTEID
    1 22824
    Execution Plan
    Plan hash value: 3559428808
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 545 | 1071K| 1030 (1)| 00:00:19 |
    | 1 | SORT AGGREGATE | | 1 | 3022 | | |
    |* 2 | TABLE ACCESS BY INDEX ROWID | SYS895336_TEST_WQI__PATH_TABLE | 1 | 3022 | 2 (0)| 00:00:01 |
    |* 3 | INDEX RANGE SCAN | SYS895336_TEST_WQI__PIKEY_IX | 1 | | 1 (0)| 00:00:01 |
    |* 4 | FILTER | | | | | |
    | 5 | TABLE ACCESS FULL | TEST_WEB_QUOTE_INDX1 | 545 | 1071K| 4 (0)| 00:00:01 |
    | 6 | SORT AGGREGATE | | 1 | 3022 | | |
    |* 7 | TABLE ACCESS BY INDEX ROWID| SYS895336_TEST_WQI__PATH_TABLE | 1 | 3022 | 2 (0)| 00:00:01 |
    |* 8 | INDEX RANGE SCAN | SYS895336_TEST_WQI__PIKEY_IX | 1 | | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - filter(SYS_XMLI_LOC_ISTEXT("SYS_P0"."LOCATOR","SYS_P0"."PATHID")=1)
    3 - access("SYS_P0"."RID"=:B1 AND "SYS_P0"."PATHID"=HEXTORAW('5E6C') )
    4 - filter(CAST( (SELECT "SYS"."STRAGG"("SYS_P2"."VALUE") FROM
    "WEB_STAGING"."SYS895336_TEST_WQI__PATH_TABLE" "SYS_P2" WHERE "SYS_P2"."PATHID"=HEXTORAW('5E6C') AND
    "SYS_P2"."RID"=:B1 AND SYS_XMLI_LOC_ISTEXT("SYS_P2"."LOCATOR","SYS_P2"."PATHID")=1) AS number)=22824)
    7 - filter(SYS_XMLI_LOC_ISTEXT("SYS_P2"."LOCATOR","SYS_P2"."PATHID")=1)
    8 - access("SYS_P2"."RID"=:B1 AND "SYS_P2"."PATHID"=HEXTORAW('5E6C') )
    Note
    - dynamic sampling used for this statement (level=2)
    - Unoptimized XML construct detected (enable XMLOptimizationCheck for more information)
    However, I also need to add an additional field to this index to allow appropriate queries against the data in the table, version number. This field can be seen from the statement above (VERSION) which runs OK and returns the data I’d expect. However, when I attempt to add this index using the following statement I get an error returned and the index becomes corrupted:
    alter index TEST_WQI_idx_1 rebuild
    parameters ('PATHS (INCLUDE ADD
    (/webPolicy/Sections/interopSection[1]/PolicyItems/item/Version))');
    After some investigation, the issue seems to revolve around the use of the [1] condition in the statement /interopSection[1]. I can create the index by removing the [1] condition, but this does not return the expected result. In actual fact, as there are 2 interopSection elements in the xml file, both with a version number of 1, the statement returns 11, which would appear to be the two version numbers concatenated together. I need to be able to reference the version number from the first interopSection in the queries against the table, and I need to be able to index this column correctly for performance issues.
    I'm unsure why this xpath statement is not working correctly in the alter index statement, but returns ok when used within the query against the table and was wondering if you would be able to help me to have a working index against this element.
    Thanks in advance for any help you can provide in relation to this.

    Sorry, here is the error:
    Error starting at line 20 in command:
    alter index TEST_WQI_idx_1 rebuild
    parameters ('PATHS (INCLUDE ADD
    (/webPolicy/Sections/interopSection[1]/PolicyItems/item/Version))')
    Error report:
    SQL Error: ORA-29858: error occurred in the execution of ODCIINDEXALTER routine
    ORA-64131: XMLIndex Metadata: failure during the looking up of the dictionary
    ORA-30968: invalid XPATH or NAMESPACE option for XML Index
    29858. 00000 - "error occurred in the execution of ODCIINDEXALTER routine"
    *Cause:    Failed to successfully execute the ODCIIndexAlter routine.
    *Action:   Check to see if the routine has been coded correctly.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Creating index for standard SAP tables

    Hi!
    What are the advantages and disadvantages of creating addtional indexes for tables with massive amount of data (BSEG, BKPF, COEP, etc...).
    If I create a new index it supposed to make the table access faster, for the cost of hard disk space.
    Am I right?
    Thank you
    Tamá

    Hi,
    Primary and secondary indexes
    Index: Technical key of a database table.
    Primary index: The primary index contains the key fields of the table and a pointer to the non-key fields of the table. The primary index is created automatically when the table is created in the database.
    Secondary index: Additional indexes could be created considering the most frequently accessed dimensions of the table.
    Structure of an Index
    An index can be used to speed up the selection of data records from a table.
    An index can be considered to be a copy of a database table reduced to certain fields. The data is stored in sorted form in this copy. This sorting permits fast access to the records of the table (for example using a binary search). Not all of the fields of the table are contained in the index. The index also contains a pointer from the index entry to the corresponding table entry to permit all the field contents to be read.
    When creating indexes, please note that:
    An index can only be used up to the last specified field in the selection! The fields which are specified in the WHERE clause for a large number of selections should be in the first position.
    Only those fields whose values significantly restrict the amount of data are meaningful in an index.
    When you change a data record of a table, you must adjust the index sorting. Tables whose contents are frequently changed therefore should not have too many indexes.
    Make sure that the indexes on a table are as disjunctive as possible.
    (That is they should contain as few fields in common as possible. If two indexes on a table have a large number of common fields, this could make it more difficult for the optimizer to choose the most selective index.)
    Accessing tables using Indexes
    The database optimizer decides which index on the table should be used by the database to access data records.
    You must distinguish between the primary index and secondary indexes of a table. The primary index contains the key fields of the table. The primary index is automatically created in the database when the table is activated. If a large table is frequently accessed such that it is not possible to apply primary index sorting, you should create secondary indexes for the table.
    The indexes on a table have a three-character index ID. '0' is reserved for the primary index. Customers can create their own indexes on SAP tables; their IDs must begin with Y or Z.
    If the index fields have key function, i.e. they already uniquely identify each record of the table, an index can be called a unique index. This ensures that there are no duplicate index fields in the database.
    When you define a secondary index in the ABAP Dictionary, you can specify whether it should be created on the database when it is activated. Some indexes only result in a gain in performance for certain database systems. You can therefore specify a list of database systems when you define an index. The index is then only created on the specified database systems when activated
    Thanks and Regards
    Arun Joseph

  • How to create index on Global Temporary Table?

    Hi,
    Can i create index with storage parameters on global temporary table? If possible, how?
    Thanks

    Yes. You can create an index on a global temporary table (GTT) with the regular 'CREATE INDEX' statement.
    Not sure though if you are allowed to locate it in a specific tablespace. Why would you want to do that anyway?
    My guess is, like the GTT, indexes on GTT's also default to the temporary tablespace.

  • BUG ? Create index on a partitioned table drops the complete table !

    Hi ...
    now i had twice the problem when i tried to create a local index (with 2 fields) on a partitioned table .
    I set initrans to 1 and maxtrans to 255 (i know - initrans has to be at least 2).
    I got an error - and the table (including the data) was gone ... :-((
    Has anybody the same behavior and is it a bug ??
    Christian

    See 1.5 Bad bug when creating index fails.
    Have fun,
    K.

  • Problem creating index on global temporary table

    Running Oracle DB Oracle9i Release 9.2.0.7.0.
    I'm trying to create 3 indexes on a temporary table, the first index creates fine but the other remaining 2 result in the following error:
    ERROR at line 1: ORA-00600: internal error code, arguments: [kftts2bz_many_files], [0], [20], [], [], [], [], []
    Have tried searching with not much success, any pointers, tips, hints would be appreciated, below is the table and the indexes:-
    create global temporary TABLE contacts (
    ID VARCHAR2(20) NOT NULL,
    DOB VARCHAR2(8),
    HH_LASTNAME VARCHAR2(90),
    PERSON VARCHAR2(10) NOT NULL,
    CONT_JOB VARCHAR2(90) NOT NULL,
    SOURCE VARCHAR2(8) NOT NULL,
    ADS VARCHAR2(8) NOT NULL,
    CONT VARCHAR2(8) NOT NULL,
    SRCPERSONID VARCHAR2(15),
    FIRSTNAME VARCHAR2(90),
    MIDDLENAME VARCHAR2(90),
    LASTNAME VARCHAR2(90),
    FULLNAME VARCHAR2(90),
    TITLE VARCHAR2(50),
    SALUTATION VARCHAR2(90),
    ) on commit delete rows;
    create index i_contact_1 on contacts(dob, soundex(hh_lastname ));
    create index i_contact_pk on contacts(id, person, cont_job, source, ads, cont);
    create index i_contact_2 on contacts(srcpersonid, source);

    Bug 3238525 - Upgrade from 9.0 can leave corruptdata for global temporary table indices
    ORA-600 [kftts2bz_many_files]
         Doc ID:      285592.1

  • Create Index on another schema table stored in my table

    Hi,
    I want to create index on a table column which is in another schema from my schema and the index to be stored in my schema.
    ex: current user 'hr'
    sql>create index idx1 on scott.emp(eno);
    Does the above query works??
    thanks,
    Sri

    Why cant you give a try?
    Are you getting any error message?
    See below..
    SQL> show user
    USER is "SCOTT"
    SQL> grant select on emp to hr;
    Grant succeeded.
    SQL> conn
    Enter user-name: hr@***
    Enter password:
    Connected.
    SQL> show user
    USER is "HR"
    SQL> create index ndx on scott.emp(sal);
    create index ndx on scott.emp(sal)
    ERROR at line 1:
    ORA-01031: insufficient privileges
    SQL> conn
    Enter user-name: system@*******
    Enter password:
    Connected.
    SQL> create index ndx on scott.emp(sal);
    Index created.
    SQL> drop index ndx;
    Index dropped.
    SQL> grant create any index to hr;
    Grant succeeded.
    SQL> conn
    Enter user-name: hr@*******
    Enter password:
    Connected.
    SQL> create index ndx on scott.emp(sal);
    Index created.Edited by: jeneesh on Oct 8, 2012 3:53 PM

  • Create Index on a huge table

    Hi,
    We have a huge table and there is no index on this table, I want to create index on this table, we are working on Oracle 11g/Linux.
    Our business users are frequently accessing this table and select statement taking very long time.
    Please let me know which index type would be best suited for this and what would the command to create index on it.
    Would appreciate your assistance.
    Regards.

    >
    We have a huge table and there is no index on this table, I want to create index on this table, we are working on Oracle 11g/Linux.
    Our business users are frequently accessing this table and select statement taking very long time.
    Please let me know which index type would be best suited for this and what would the command to create index on it.
    >
    We need loads of information to suggest anything useful
    a) What database version is yours? (if 11g, you have good more options)
    b) What type of environment is it? OLTP or Warehouse?
    c) How big is the table?
    d) How many distinct values are there in that column that you want to index?
    e) Would this index undergo lots of inserts/deletes/updates? That is, is this table used mainly for querying or will it undergo continous inserts/updates/deletes?
    In case your environment is warehouse type where you load once and then mainly used for queries and more importantly, if that column has very few distinct columns (typical example is a GENDER column where you have only two distinct values), you will be largely benefitted from BITMAP index. If it's an OLTP environment where multiple processes will be inserting into the table, you never ever go near BITMAP index but do only B-Tree index.
    Finally, have you arrived at a concrete reason on why you want to build that index now rather than when you designed the table? If you don't need an index for sure, better not have it. If you are on 11g, you can have INVISIBLE index.
    Also, if it's a very large table, you may create the index nologging to avoid loads of redo generation (not recommended on production environment though). But you have to be aware that in the event of disaster recovery you will have to recreate the index after you restore the database. Also if you are on Dataguard environment, you have to take necessary precautions while doing NOLOGGING operations.
    Edited by: user12035575 on Sep 11, 2011 12:37 PM

  • Create index partition in the table partition tablespace

    Hello,
    I am running a custom job that
    * Creates a tablespace daily
    * Creates the daily table partition in the tablespace created
    * Drops the tablepartition X days old
    * Drops the tablespace for that partition on X+1 day.
    The above job runs perfectly, but 'm having issues with managing the indexes for these partitioned tables. In the old database (10g - Single Node), all the partitions/indexes existed in one BIG tablespace and when I imported the table creation script into the new database, I modified all the table partitions & indexes to go into their respective tablespace.
    Eg:
    Table_name........Partition_name.....................Index_Part_name..........................Tablespace_name
    ============...================............====================...........=================
    TABL1...................TABL1_2012_07_16............TABL1_IDX_2012_07_16............TBS_2012_07_16
    TABL1...................TABL1_2012_07_15............TABL1_IDX_2012_07_15............TBS_2012_07_15
    But now when the job runs, it creates the index into the default tablespace TBS_DATA.
    Table_name........Partition_name.....................Index_Part_name..........................Tablespace_name
    ============...================.............====================...........=================
    TABL1...................TABL1_2012_08_16............TABL1_IDX_2012_08_16............TBS_DATA
    TABL1...................TABL1_2012_08_15............TABL1_IDX_2012_08_15............TBS_DATA
    I can issue alter index rebuild to move the indexes to its default tablespace, but how can I ensure that the index gets created in its designated tablespace?
    NOTE - the partition/tablespace management job that I run only creates the table partition and not the index.
    The new env is a 2-Node 11gR2 RAC cluster on Linux x86_64.
    Thanks in advance,
    aBBy.

    Excerpt from the job -
    This creates the partition into the new tablespace.
    v_sql_new_part := 'alter table '||tab_owner||'.'||tab_name||' add partition '||v_new_part_nm||'
    values less than (to_date('''||v_new_part_dt_formatted||''',''DD-MON-YYYY'')) tablespace '||part_tbs;
    execute immediate v_sql_new_part;New tablespace for new partition - because this is a 10T database and having multiple tablespaces helps with backup/recovery.
    Thanks,
    aBBy.

  • How to create index on specific partition table?

    Hi Experts,
    we created 4 partitions on table .
    Table Name : test
    partitions : Test_prt1
                       Test_prt2
                       Test_prt3
                      Test_prt4
    Our requiremnt  create the index on specific partition (ex : Test_prt2) only.

    Creating Partitioned Tables and Indexes
    http://technet.microsoft.com/en-us/library/ms187526(v=sql.105).aspx
    you can create a aligned index, the index will be spread over the filegroups
    Create NonClustered Index IX_orders_aligned
    On dbo.orders(order_id)
    On test_monthlyDateRange_ps(orderDate);
    OR
    Unaligned parition, you can create index on any filegroups
    Create NonClustered Index IX_orders_unpartitioned
    On dbo.orders(order_id)
    On [Test_prt2_FileGroup];
    For more information refer the below link
    http://sqlfool.com/2008/12/indexing-for-partitioned-tables/
    Or
    You can try Creating a filtered index (I've not tried it though)
    http://www.mssqltips.com/sqlservertip/1785/sql-server-filtered-indexes-what-they-are-how-to-use-and-performance-advantages/
    --Prashanth

  • Creating index for a big table

    Hello,
    We have Oracle 9.2
    I have two tables TableA and TableB. TableB is created by copying part of the content of TableA. Inorder to speed up the coping process, I dropped the primary index of TableB. Now TableB has 94 million records.
    Now I was trying to create the primary index for TableB with the following script:
    CREATE UNIQUE INDEX USR3."TableB~0"
    ON USR3.TableB(ID,COUNTER)
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    TABLESPACE INDEX1
    STORAGE(FREELISTS 1
    FREELIST GROUPS 1
    BUFFER_POOL DEFAULT)
    LOGGING
    NOPARALLEL
    NOCOMPRESS
    And I get the Oracle catch all error (ora-00600: internal error....)
    And I only have the following error message: "kcbvmap: unable to find victim buffer"
    The tablespace is a locally managed tablespace
    Please help, how do I fix this problem.

    CREATE UNIQUE INDEX USR3."TableB~0"
    What's with the wacky name?

  • How to create index for Telecom large table

    Hi ,
    I'm working on DB 10G on REHL 5 for telecom company with more than 1 million recorded per day , we need to speed the query result ,
    we know there are many types of the INDEX and I'm need a professional advice to create a suitable one ,
    many of our queries depend on the MSID ( the MAC address of the Modem ) column ,
    Name           Null Type        
    STREAMNUMBER        NUMBER(9)   
    MSID                VARCHAR2(20)
    USERNAME            VARCHAR2(20)
    DOMAIN              VARCHAR2(20)
    USERIP              VARCHAR2(16)
    CORRELATION_ID      VARCHAR2(64)
    ACCOUNTREASON       NUMBER(3)   
    STARTTIME           VARCHAR2(14)
    PRIORTIME           VARCHAR2(14)
    CURTIME             VARCHAR2(14)
    SESSIONTIME         NUMBER(9)   
    SESSIONVOLUME       NUMBER(9)   
    .please any help ,

    really i have 3 queries for the subscriber activity like (usage details , the date of bundle start the the total of the download , he's working out of bundle or not )
    and any of the subscribers can check those queries at any time thorw web ,
    select nvl(min(substr(a.starttime,1,8)),0) Service_Start_Time, nvl(sum(a.sessionvolume),0) Total_Traffic_KB
    FROM aaa_bill a
    where msid='84A8E46E929D'
    and starttime >=(select  max(fee) FROM aaa_bill
    where msid='84A8E46E929D' and accountreason=5);and the expected result is
    service_start_date  totoal_traffic_KB
    20120225                   440554the MSIDs examples
    (84A8E46E7F43,
    84A8E46E7A82,
    84A8E46E7C84,
    84A8E46E7CBF,
    also i have this query ,
    select
    substr(nvl(
    (select nvl(starttime,'0') as starttime
    from (
    select nvl(starttime,0) starttime,sum(sessionvolume) over(partition by msid order by starttime) sum1
    from aaa_bill
    where msid='84A8E46E90BC' and starttime >=(select  max(fee) FROM aaa_bill
    where msid='84A8E46E90BC' and accountreason=5))
    where sum1>=44987000
    and rownum<2)
    ,0),1,8) Reached_45GB
    from dual;and this one ,
    select min(to_char(to_date(starttime,'yyyymmddhh24miss'),'yyyy-mm-dd hh24:mi:ss')) "Accounting Start Time",
    max(to_char(to_date(curtime,'yyyymmddhh24miss'),'yyyy-mm-dd hh24:mi:ss')) "Accounting Stop Time",sum(sessiontime) Duration1,
    TO_CHAR (TRUNC (SYSDATE) + NUMTODSINTERVAL (sum(sessiontime), 'second'),'hh24:mi:ss') hr,
    sum(sessionvolume) Traffic
    from aaa_bill
    where msid='84A8E46E78EF'
    and starttime >=(select  max(fee) FROM aaa_bill
    where msid='84A8E46E78EF' and accountreason=5)
    group by correlation_id
    order by min(starttime);

  • Create/drop index on a busy table

    Hello,
    It's kind-a of a funny question but how do you create or drop a index on a very busy table? (by making the users wait...)
    I tried:
    lock table <table> in exclusive mode
    then in another session (session2)
    update <table> set col1 = 'a';
    (this session now waits)
    then back a the first session:
    create index bla on <table> (col1);
    And what happens is that the lock is released immediatelly, and in session2 the update updates and I get the standard "RESOURCE BUSY" error.
    Any ideas on how to do that ?
    Thanks

    Jozsef wrote:
    Hi there,
    I have done similar things couple of times before and I have used a pretty good method to obtain a rough (and it was really a rough, but enough) estimation.
    Sorry folks, it does not work properly for create index...this method only works for SELECT statments, SO IGNORE IT :(
    It nearly works in 10g:
    | Id  | Operation              | Name  | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | CREATE INDEX STATEMENT |       | 10000 | 40000 |    10   (0)| 00:00:01 |
    |   1 |  INDEX BUILD NON UNIQUE| T1_I1 |       |       |            |          |
    |   2 |   SORT CREATE INDEX    |       | 10000 | 40000 |            |          |
    |   3 |    TABLE ACCESS FULL   | T1    | 10000 | 40000 |     6   (0)| 00:00:01 |
    Note
       - estimated index size: 196K bytesThe "Note" tells you Oracle's estimate of the final space allocation needed for the index. There are various reasons why the estimate is not very accurate, and why it's not a good estimate of the space requirement in the TEMP tablespace, but it gives you a figure that is probably in the right ballpark (factor of 2 out, either way, probably).
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    "For every expert there is an equal and opposite expert."
    Arthur C. Clarke

  • Create an index on a huge table

    hi gurus
    I am going to create an index on a very large table(194GB) with the temporary tablespace size is 80G.
    I am afraid that during the index creation the temporary tablespace is not enouth to hold the data needed
    to create the index,because i only have 80g in temporary tablespace. How do i estimated the size i need to create a such large index and is there an effcient way to do such index creation?
    thank u in advance.

    Jozsef wrote:
    Hi there,
    I have done similar things couple of times before and I have used a pretty good method to obtain a rough (and it was really a rough, but enough) estimation.
    Sorry folks, it does not work properly for create index...this method only works for SELECT statments, SO IGNORE IT :(
    It nearly works in 10g:
    | Id  | Operation              | Name  | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | CREATE INDEX STATEMENT |       | 10000 | 40000 |    10   (0)| 00:00:01 |
    |   1 |  INDEX BUILD NON UNIQUE| T1_I1 |       |       |            |          |
    |   2 |   SORT CREATE INDEX    |       | 10000 | 40000 |            |          |
    |   3 |    TABLE ACCESS FULL   | T1    | 10000 | 40000 |     6   (0)| 00:00:01 |
    Note
       - estimated index size: 196K bytesThe "Note" tells you Oracle's estimate of the final space allocation needed for the index. There are various reasons why the estimate is not very accurate, and why it's not a good estimate of the space requirement in the TEMP tablespace, but it gives you a figure that is probably in the right ballpark (factor of 2 out, either way, probably).
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    "For every expert there is an equal and opposite expert."
    Arthur C. Clarke

Maybe you are looking for

  • How do you install HP Photosmart Apple software with just an iPad?

    I have an iPad 2 with iOS 7 and a new HP Photosmart 7520 all in one printer. How do you install the Apple software on the CD if you don't have a computer to do so? Is there some kind of wifi internet install of the CD's software or do I have to go fi

  • How to get the return message after running BD20 tranaction ?

    Hi Gurus, My requirement is to Post vendor invoice through ALE/IDOC ( Inbound IDOC ). - For that I had generated the IDOC using  Function module 'IDOC_INBOUND_WRITE_TO_DB ' - Then I had processed that generated IDOC by calling the standard program rb

  • Default PR Type when convert from Planned Order

    Hi all, How can I default my PR Type when convert from Planned Order after MRP run. This can done via MRP Group control but how to go about controlling via Planned Order profile? Which planned object type and planned order profile to be used? assumin

  • ACS and AD groups

    I have ACS v5 connected to a Windows 2008 AD. Why cant I see any other groups besides the default builtin or Users?  If I set my Base DN to search for groups :  CN=Groups,DC=LAB,DC=LOCAL, I do not see any groups listed within it. But if I do CN=Built

  • Are others finding AAMEE 3.0 install packages failing on Macs

    I'm able to create install packages with AAMEE 3.0 without issue.  However, when I go to install the packages on machines (so far, through no automated process), I get an "The installation failed" screen.