How to implement "Filtered Indexes" in Oracle?

I know that function-based index can (kind-of) create index for only a portion of all the rows in a table,
create index idx_abc_01 on t_abc (case when end_dt > '01-APR-2008' then end_dt else null end);
/* to use the index, you have to use the same express in the filter clause */
select * from t_abc where xyz in ('O', 'S', 'X') and
     case when end_dt > '01-APR-2008' then end_dt else null end
          between '12-JUL-2008' and '15-JUL-2008';But this approach is very inflexible because the expression in the where clause has to exactly match the index creation, otherwise that filtered index will not be used.
MS SQL Server 2008 has a new feature called - Filtered Indexes
CREATE NONCLUSTERED INDEX fidx_abc_01
    ON t_abc ( EndDate )
WHERE EndDate > '20040401';
select * from t_abc where EndDate between '20050121' and '20050130';[url http://msdn.microsoft.com/en-us/library/cc280372.aspx]Filtered Indexes can be very helpful in both OLTP and DW. I'm wondering how to get the same thing done in Oracle.
Any suggestion beyond [url http://erturkdiriksoy.wordpress.com/2008/06/30/filtered-indexes-on-oracle/]Dunyada?

In 11.2, if you're building a data warehouse (and assuming that implies you have the partitioning option), you can declare that certain partitions of a local index are unusable which prevents Oracle from building them. If T_ABC were partitioned on END_DT, that would allow arbitrary queries where Oracle could perform partition pruning to make use of the index if it was available for those partitions without the need for an exact expression match.
Beyond that, if you are creating a function-based index, you would often want to create (or modify) the view that your application queries to specify the condition (i.e. a VW_RECENT_ABC that only has post-April, 2008 data) so that queries didn't have to specify the condition exactly.
Justin

Similar Messages

  • Anyone knows how to implement Decomposition Tree in Oracle BI products? to

    Hello Everybody
    Recently I'm trying to use Oracle BIEE plus to upgrade our old report service in our product. I'm a newbee to OracleBI products but I have a question that oracle support guys in our region also could figure out a clear answer. If anybody here can give me some clues it would be appreciated.
    I once used ProClarity BI product before, and ProClarity report service can provide a very powerful visualization tool like Decomposition Tree. I'm quite interested this function. But I searched many Oracle BIEE plus and ESSBASE documents, it seems Oracle BI can' implements the functional for which Proclrity Decomposition Tree can provided?
    Is there any body knows any other solution to implement Decomposition Tree in Oracle BI product?
    Thanks

    Appreciated the quick response:)
    Yes. I don't find the directory object .. I'm not very familiar with biee so far so might be me slight this object in my investigation.
    I need to check this object and see how it works.
    And thanks for your advise.

  • How to find unused indexes in oracle 10g r2

    Hi all,
    db:oracle 10.2.0.3
    os:solaris
    i want rebuilt the some of the indexes (due poor performence of db)
    how to find the unused indexes in oracle 10gr2 database.?
    can any one help me out plz.

    kk001 wrote:
    Hi all,
    db:oracle 10.2.0.3
    os:solaris
    i want rebuilt the some of the indexes (due poor performence of db)
    how to find the unused indexes in oracle 10gr2 database.?
    can any one help me out plz.You can use V$OBJECT_USAGE.
    But how you decide need rebuilding indexes?
    How you decide problem related indexes?
    What is exactly your mean "due poor performence of db"? some queries hang/long running or whole system hang or has poor performance?
    In generally do not need rebuilding index(unless specially cases),first give we above questions`s answers.

  • How to disable the index in oracle

    Hi,
    Is there any way we can disbal the index in oracle.
    For the performance issue,I want to disable some of the indexes which i have created earlier. I dont want to drop the index.
    I tried the below command
    Alter Index <Schema>.<Index_name> Disable;
    I am getting the below error message:
    ORA-02243: invalid ALTER INDEX or ALTER MATERIALIZED VIEW option
    Thanks,
    Krishna
    .

    Hello,
    I have a question related to disabing index and thought I would post it in thread.
    I'm altering a column length to increase the size and getting "ORA-30556: functional index is defined on the column to be modified".
    On searching more about this error, it seems like the function index must be dropped before altering the column.
    The table I'm dealing with is huge.
    Question 1:
    In case of dropping and recreating the index, should the following steps be done:
    - Drop Index
    - Alter the column to increase the size
    - Recreate the index with NOLOGGING and NOPARALLEL clause
    - ALTER INDEX to turn on LOGGING
    - Gather Statistics on that index
    Question 2:
    Is there anything else that should be done when the index is dropped and re-created?
    Question 3:
    What are the side-effects of carrying out the above steps in a huge table with around 15 million rows?
    Question 4:
    Would it work if I disable the index, alter the column and reenable the index?
    Do I have to rebuild the index and gather Stats upon reenabling it?
    Thanks!

  • How to implement invoker rights in oracle 9i

    implement invoker rights in oracle 9i

    Invoker rights is a new model for resolving references to database elements in a PL/SQL program unit. From Oracle 8i onwards, we can decide if a program unit should run with the authority of the definer or of the invoker. This means that multiple schemas, accessing only those elements belonging to the invoker, can share the same piece of code.
    To enable code to run with Invoker rights, an AUTHID clause needs to be used before the IS or AS keyword in the routine header. The AUTHID clause tells Oracle whether the routine is to be run with the invoker rights (CURRENT_USER), or with the Owner rights (DEFINER). If you do not specify this clause, Oracle by default assumes it to be AUTHID DEFINER.
    create or replace procedure update_par(pi_parcod  in     varchar2,
                                           pi_val     in     varchar2,
                                           pio_status in out varchar2)
    authid current_user is
    begin
      pio_status = 'OK';
      update appparmst
      set    parval = pi_val
      where  parcod = pi_parcod
      and    rownum = 1;
      if sql%notfound then
        pio_status = 'Error in resetting the parameter';
      end if;
    end; Restriction in using Invoker rights
    1. When compiling a new routine, direct privileges are only considered to resolve any external references. Grants through roles are ignored. The same applies when executing a routine created with invoker rights.
    2. AUTHID is specified in the header of a program unit. The same cannot be specified for individual programs or methods within a package or object type.
    3. Definer rights will always be used to resolve any external references when compiling a new routine.
    4. Maintain extra caution on privileges being assigned to a different user. If the wrong privileges are assigned, a routine with invoker rights may have a mind of its own! Such issues would be difficult to debug. So ensure that the grants are perfectly in place.
    5. For an invoker rights routine referred in a view or a database trigger, the owner of these objects is always considered as the invoker, and not the user triggering it.
    ~ Madrid.

  • How to Implement User Area in Oracle Forms 6i

    Hi,
    Could anyone please let me know how to implement Item Type *"User Area"* ?
    How to add User Area in layout Editor?,
    Thanks and Regards,
    Manasa

    Hi,
    Please post your question in the appropriate forum.
    Forms
    Forms
    Thanks,
    Hussein

  • How to implement SubType/SuperType in Oracle ?

    Hi,
    I have a supertype and three subtypes, as attached below, how is the
    best approach to implement it in Oracle (9i/10g) ?
    Thank you for your help,
    Krist
    Supertype : Employee
    Employee_Number
    Employee_Name
    Address
    Employee_Type
    Date_Hired
    SubType : Hourly_Employee
    Hourly_Rate
    SubType : Salaried_Employee
    Annual_Salary
    Stock_Options
    SubType : CONSULTANT
    Contract_Number
    Billing_Rate

    Assuming you want to model this relationally, try something like this.
    http://groups-beta.google.com/group/comp.databases.oracle.server/msg/a23ffb19bfde2f20?hl=en
    Note its a generic SQL approach, and somewhat over fussy but I think the genral approach holds up for this type of relationship.
    I would sort of stay away from objects in the database, it over complicates everything else you will ever do.

  • How to implement C2 Audit in Oracle 10g Express Edition?

    Hi,
    I am developing a database using 10g Express Edition in which I need to implement c2 audit. I am planning to use triggers for this. Does anyone have a better method to implement audit in Express Edition?
    Thanks.

    I don't know what C2 audit exactly is, but before programming anything read this Security Guide chapters on Database Auditing http://download.oracle.com/docs/cd/B19306_01/network.102/b14266/auditing.htm#i1011984 and http://download.oracle.com/docs/cd/B19306_01/network.102/b14266/cfgaudit.htm#i1014788.
    All this should be available in XE also, except for Fine Grained Auditing, which is in Enterprise Edition only.
    If you are only interested in knowing when, who, did what command, including failed attempts than you don't have to program anything - you just define what activities you want to audit and set AUDIT_TRAIL initialization parameter to start auditing.
    You only need to write triggers if you need to catch column values before/after the change.

  • How to implement Dual Authentication in Oracle Apex

    Currently I am learning an oracle Apex tools. I am pretty confuse and not able to find any help for authentication scheme offered from oracle Apex. Like I would like to implement dual authentication scheme i.e. I want to implement Database Authentication and LDAP authentication. If user is fail in authenticate in Database Credential then I would like to check him in LDAP Credential. If user is present in LDAP credential then User is able to login. But if user is not present in any of them then again Login page should get displayed.
    Edited by: user2074688 on Jun 24, 2010 3:27 PM

    Dual Authentication doesn't exist as predefined Authentication Scheme, you need to program that yourself.
    So what you need to do is create a custom Authentication Scheme where you at first check user credentials against Database and then against LDAP.
    Have fun,
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    Work: http://www.click-click.at

  • How to create clustered index in Oracle ?

    I need to Create unique clustered index idx_col1 on table1(col1) in Oracle 9i.
    Should I declare it at creation of table as index-organized ? My table is created with the code like Create table table1 as select ..... from ....
    Can anybody post an example ?
    Thanks

    Oracle does not have the concept of a clustered index from SQL Server. You may get something similar if you create your table as an index organized table, i.e.
    CREATE TABLE my_iot (
      col1 number primary key,
      col2 number
    organization index;or you may get similar benefits by creating a cluster. It really depends on what functionality you're trying to replicate and what problem your trying to solve. Either way, though, you'll have to have separate steps to create the table and then to insert the data.
    Justin

  • How can implement running total in oracle forms

    I want to implement a running total in oracle form
    like
    100 100
    300 400
    200 600
    500 1100
    200 1300
    100 1400
    PROCEDURE calculate_srno IS
    current_rownum     integer:=:System.Cursor_Record;
    starting_srno integer:=:rs_1;
    last_rownum integer;
    BEGIN
         last_record;
         last_rownum:=:system.cursor_record;
         go_record(1);
         FOR counter IN 1..last_rownum LOOP
              :sum_1:=:rs_1;
              :rs_1:=:sum_1+:rs_1;
         --     :offered_srno_to:=starting_srno;
              if last_rownum=:System.Cursor_Record then exit;
              end if;
         END LOOP;
    END;
    it is not working after want to insert between in the table

    Why write code for this? Oracle Forms 10g has Calculated/Summary fields that will do this for you without the need of writing any PL/SQL.
    Simply add a non-table item to the data block with the item you want to keep the running total for. Then change the following properties of the item:
    Data Type: Number
    Calculation Mode: Summary
    Summary Function: Sum
    Summarized Block: <Your Data Block>
    Summarized Item: <Your Block Item>
    Number of Items Displayed: 1 (if your item is in a Multi-Record (Tabular) layout else you don't need to change this property.
    You will also need to change the following property of the block: Query All Records: Yes
    If changing the Block's "Query All Records" property causes your form to be too slow because of the number of records in your block, then you could keep a running total manually by using a combination of the Post-Query and When-Validate-Item (WVI) triggers. If your block does not allow data entry, then you could do this with just the Post-Query trigger. For example:
    BEGIN
      /* This code sample assumes you have added a non-table item */
      /* to your block called SUMMARY.  */
      :YOUR_BLOCK.SUMMARY := :YOUR_BLOCK.SUMMARY + NVL(:RS_1,0);
    END;If your block allows data entry, then you would add the following to your existing WVI trigger.
    BEGIN
      /* Perform your data entry validation logic first... */
      IF ....
      ELSE
        ...Validation is successful...
        :YOUR_BLOCK.SUMMARY := :YOUR_BLOCK.SUMMARY + NVL(:RS_1,0);
      END IF;
    END;Hope this helps.
    Craig...

  • How to implement hasing algorithm in oracle

    implement hasing algorithm in oracle

    Assuming you're using the enterprise edition of the database and that you've licensed the partitioning option, you specify the number of hash partitions you want when you create the table. The SQL Reference for the CREATE TABLE statement has the following example
    CREATE TABLE hash_products
        ( product_id          NUMBER(6)
        , product_name        VARCHAR2(50)
        , product_description VARCHAR2(2000)
        , category_id         NUMBER(2)
        , weight_class        NUMBER(1)
        , warranty_period     INTERVAL YEAR TO MONTH
        , supplier_id         NUMBER(6)
        , product_status      VARCHAR2(20)
        , list_price          NUMBER(8,2)
        , min_price           NUMBER(8,2)
        , catalog_url         VARCHAR2(50)
        , CONSTRAINT          product_status_lov_demo
                              CHECK (product_status in ('orderable'
                                                      ,'planned'
                                                      ,'under development'
                                                      ,'obsolete')
    PARTITION BY HASH (product_id)
    PARTITIONS 5
    STORE IN (tbs_01, tbs_02, tbs_03, tbs_04); You'd just specify 4 or 8 partitions, your partition key, etc.
    It doesn't make sense, however, to try to join two hash-partitioned tables on the hash key value. What is it, exactly, that you're trying to accomplish.
    Justin

  • How to implement parallel processing in oracle.

    Hi Gurus,
    In one our procedures we are calling 7 procedures internally. We want to execute them parallely insted of sequentially.
    Please help me to resolve this issue.
    thanks in advance...

    Hi,
    You have dbms_job package in Oracle 9i and dbms_scheduler from Oracle 10g.
    Though you can run all these procedures parallel submitting via dbms_job, any exception/error out in any of these procedures need to be handled explicitly. Just be aware that once you submit these jobs, your application loses control of the execution and you have to build a whole infrastructure for rerun in case of an exception(log/exception tables, monitoring application to periodically check the exception tables, alerts from procedures in case of an exception and so on ...)
    It's going to become more complex if you have any dependencies between these procedures.

  • How to implement simple replication with Oracle 8.0.5 ?

    Hello,
    I want to replicate some tables of my database's tables with simple replication :
    I use local naming configuration.
    Both databases have the same default ID ORCL.
    But every time I create a database link and I want to test it, I receive the message : "The link is not active!".
    So, if some DBA could help me, I will be very grateful.
    Thank you.

    Hi,
    In our project we are using this type. Since in this project server in UNIX(DEC) and client is running on windows. We have created a listener which always listen requests from client and doing the according to the request.
    Step1. create a request table, where u are inserting ur request.
    step2. create PRO*C proram, which is listening request on the table. If there is any request, call the imp (executable). This is happening on server side.
    Benifit. U can make a request from cleint and ftp the file client sit.
    Are u interested in more details and code, pls send a mail to me
    ---- Boby Jose Thekkanath
    [email protected]
    Dharma Computers(p) Ltd. Bangalore.
    null

  • How to implement Custom Authentication and Authorization in Oracle SOA 11g

    Can anyone please tell me, how to implement Custom Authentication in Oracle SOA 11g ?
    Because in Oracle SOA 10.1.3.4 , i have implemented this custom authentication and authorization by implementing BPMAuthenticationService, BPMAuthorizationService, BPMIdentityService to verify againt my database systems.
    implementation classes like the mentioned below
    1).
    public class SampleAuthenticationService extends SampleServiceBase implements BPMAuthenticationService {
    2).
    public class SampleAuthorizationService extends SampleServiceBase implements BPMAuthorizationService {
    3).
    public class SampleIdentityService extends SampleServiceBase implements BPMIdentityService {
    Please help me to implement the authentication and authorization in Oracle SOA 11g .
    thanks in advance

    To start with please go through following document
    http://docs.oracle.com/cd/E21764_01/integration.1111/e10231/adptr_jms.htm
    http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/adptr_file.htm
    Regards
    Arpit

Maybe you are looking for

  • How do I get all my music back on my iphone 4?

    Cracked the screen on my iphone 4, went to apple shop, they changed it (lovely) and restored all the settings from icloud, all went very well, except I noticed that the music doesn't get restored from itunes Match. In fact it was completely empty. Yo

  • HT4623 Trying to update my ipad that already has iOS 7 on it to the iOS 7.0.4

    Everything i try and download iOS7.0.4 onto my ipad it says error right before it is about to finish. I can't plug it into my computer to update it with iTunes because it is out getting fixed since my macbook pro that is 2 years old won't turn on or

  • Can't check aol email in ios7

    When I updated to ios7 it says i have the wrong username or password. Does anyone know how to fix this? Thanks.

  • Portege M400 - WLan issues connecting Orange Livebox

    Hi My landlord recently upgraded our WLan by introducing an Orange Livebox. I have tried everything possible to connect wirelessly to the router but to no avail. All the other machines have connected with no/little issue/s. I have installed Configfre

  • Upto 4 decimal value?

    Hi, I am getting value up to 6 decimals from database like this 123.234566.I want to display upto 4 decimal of this value like 123.2345. I have used format method of NumberFormat class as below: format( obj.getBigDecimal("colName").doubleValue()) But