Limit iView functionality based on user

I've got a few iViews where I need to limit the options or features based on the user/role/group.  The intention is to have a single iview that allows all users to view data and admin type users to edit. 
What is the consensus on the best way to do this?  It seems I should be able to do this with security zones and/or acl, but I can't find any examples.  Alternatively, I could add a component profile attribute of the admin role and check for it manually.
Any suggestions?
Thanks.

Hi,
avoid defining a security zone, as these are used only for making the component executable directly (without an iView).
How about this:
- define a profile property named 'editable'
- create an iView in the admin role, having the property to 'true'
- create an iView in the user role, having the property set to 'false'
Regards,
Armin

Similar Messages

  • Limit on number of function based indexes ?

    What is the limit on the number of function based indexes that can exist on a table ?
    I haven't been able to find this info in the Oracle docs yet . I'd RTFM, but which one ? There's so many ! :-)

    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14237/limits003.htm#sthref4186

  • Function based indexes on CLOB storage

    On a 10gR2 database, with schema-less CLOB storage for an XMLType column:
    (1) Can a function based index include a wildcard in the namespace ? Or do I need a new function based index for each specific namespace ?
    (2) I must create a new function based index for each different element that I want an indexed search on ?
    (3) What limit is there on the number of function based indexes per table ?
    (4) I believe XQuery can include a wildcard for namespaces, but XPath 1.x can't. Can I create a function based index using XQuery, rather than XPath ?
    Documents conforming to different versions of an XML schema will be present (schema versioning), but I want to search across all documents irrespective of a specific namespace - e.g. "Find any document with reference = 'some Value' , and amount = 1000".
    CLOB storage is proposed, due to the need to handle documents from multiple versions of an XML schema. The knowledge of the XSD is not known at development time, but is user definable, and it must be possible to change the structure without system down time. Structured storage is not suitable, due to Oracle's requirement for downtime if the schema changes (CopyEvolve drops/recreates tables), and Oracle doesn't support schema collections, so you can't bind an XML column to multiple schemas.
    Here is some sample code of what I'm trying to do:
    create table BulkTest
    ID NUMBER(10) not null primary key,
    USERFIELDS XMLTYPE
    create sequence S_BulkTest;
    --Document conforming to version 1 of schema
    INSERT INTO BulkTest(id, Userfields) VALUES
    (S_BulkTest.Nextval,
    '<?xml version="1.0" encoding="utf-8" ?>
    <mt395 xmlns="urn:incident:mt395-1">
         <reference>FH12345678</reference>
         <relatedReference>FH23456789</relatedReference>
         <queries>Here is some query text.</queries>
         <narrative>Here is some narrative text.</narrative>
         <relatedMessageType>300</relatedMessageType>
         <relatedMessageDate>2005-03-29</relatedMessageDate>
         <direction>R</direction>
         <sessionNumber>1234</sessionNumber>
         <isn>123456</isn>
         <relatedMessageDescription>This is the deal where I bought USD 1 million for GBP at 1.76.</relatedMessageDescription>
         <otherParty>232332</otherParty>
    </mt395>'
    --Document conforming to version 2 of schema
    INSERT INTO BulkTest(id, Userfields) VALUES
    (S_BulkTest.Nextval,
    '<?xml version="1.0" encoding="utf-8" ?>
    <mt395 xmlns="urn:incident:mt395-2">
         <guid>0f9a08f6-b052-4693-baba-8f7dc881e7e8</guid>
         <reference>333333</reference>
         <queries>Another query</queries>
         <narrative>Some narrative</narrative>
         <direction>R</direction>
         <sessionNumber>1234</sessionNumber>
         <isn>223456</isn>
    </mt395>'
    --It seems I need to create a new index for each field I want to search on
    create index iBulkTest_REFERENCE
    on BulkTest
    (extractValue(UserFields,'/mt395/reference', 'xmlns="urn:incident:mt395-1"'));
    --And that a new index is required for each specifc namespace that is present
    --Can't we include a wildcard in the namespace ?
    create index iBulkTest_REFERENCE_2
    on BulkTest
    (extractValue(UserFields,'/mt395/reference', 'xmlns="urn:incident:mt395-2"'));
    --If I want to query, I have to explicitly specify each namespace.
    --Can't I specify a wildcard ?
    --This will make it "fun" querying across namespaces!
    select
    id,
    extractValue(UserFields,'/mt395/reference', 'xmlns="urn:incident:mt395-2"') As Reference,
    t.userfields.getclobval() userfields
    from bulktest t
    WHERE extractValue(UserFields,'/mt395/reference', 'xmlns="urn:incident:mt395-2"') = '333333'

    Andy
    #1. You do not have scehma versioning here. Your model is totally incorrect. You shoud not change the namespace when versioning the XML Schema. You have 2 different and totally disjoint XML Schemas. The correct was to version, as distinct from evolve an XML Schema is to change the Schema Location Hint associated with your XML...
    Eg
    INSERT INTO BulkTest(id, Userfields) VALUES
    (S_BulkTest.Nextval,
    '<?xml version="1.0" encoding="utf-8" ?>
    <mt395 xmlns="urn:incident:mt395" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:incident:mt395 mt395-1.xsd">
    <reference>FH12345678</reference>
    <relatedReference>FH23456789</relatedReference>
    <queries>Here is some query text.</queries>
    <narrative>Here is some narrative text.</narrative>
    <relatedMessageType>300</relatedMessageType>
    <relatedMessageDate>2005-03-29</relatedMessageDate>
    <direction>R</direction>
    <sessionNumber>1234</sessionNumber>
    <isn>123456</isn>
    <relatedMessageDescription>This is the deal where I bought USD 1 million for GBP at 1.76.</relatedMessageDescription>
    <otherParty>232332</otherParty>
    </mt395>'
    --Document conforming to version 2 of schema
    INSERT INTO BulkTest(id, Userfields) VALUES
    (S_BulkTest.Nextval,
    '<?xml version="1.0" encoding="utf-8" ?>
    <mt395 xmlns="urn:incident:mt395 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:incident:mt395 mt395-2.xsd">
    <guid>0f9a08f6-b052-4693-baba-8f7dc881e7e8</guid>
    <reference>333333</reference>
    <queries>Another query</queries>
    <narrative>Some narrative</narrative>
    <direction>R</direction>
    <sessionNumber>1234</sessionNumber>
    <isn>223456</isn>
    </mt395>'
    This is the correct way of versioning an XML Schema. THe namespace stays the same, the SchemaLocationHint in the SchemaLocation tag changes.
    Bear in mind that if you use the technique you are currently using you will make any path expressions you need to write absolutely unmaintaining and the processing of them very inefficient.
    Some questions to consider
    Node 'X' in namespace 'X' is never the same as Node 'X' in namespace 'Y'.
    How would you write an Xpath or XQuery that targetted multiple versions, but not all versions ?
    What happens if you have other documents that are really in a different namespace ? Using wildcards can you differentiate them..
    From the problem you are describing and the terminolgy you are using it looks like you've been an early customer of Yukon. MSFT clearly didn't understand schema versioning in the early beta releases and used the 'change the namespace' schema for modelling schema versioning.
    We do have some technology coming down the pipe which can address the issue, regardless of whether or not it is too late for you to correct the versioning scheme you have selected. However I cannot discuss that in a public forum. If you want to learn about these features and are prepared to enter an NDA with Oracle in order to do so please contact me directly. You can do this a number of ways...
    Guess my email address @oracle.com
    Post your email address here and I'll delete the post as soon as I have it..
    Update your OTN Forum profile to include your email address
    Open a TAR and post the tar number here. You can then softclose the tar as this is simply a method for me to get your contact info.

  • How to Generate a Report Based on User's Parameters from Web Site

    Hi, all,
    I am trying to use Oracle Developer 6.0 Report Builder to generate report based on what user types in from the web site. Since I am a novice, I am wondering if anybody would help me with the following questions:
    1. How can I create a report based on user's parameters?
    Assuming that I have 2 text fields EMPNO and DEPT on the web site, after user types in some value, how can I pass these parameters into my query, can I do something like:
    select ENAME, JOB, EADDRESS from EMP
    where EMPNO =
    some_reference_of_parameters_from_user
    or is there any other way to achieve this functionality?
    2. How can I pass a PDF format report back to user after the report is generated?
    Any help is greately appreciated!!
    Best regards.
    Judy

    Hello,
    In the Report Builder, create two user parameters, and set the parameter name, datatype, width, and default values to what you want. Modify the query and put in a where clause (e.g., where deptno = :p_deptno). When you request the report with PARAMFORM=YES on the URL, it'll generate a default parameter form in HTML and allow the user to enter in the selected parameter values. Also set DESTYPE=CACHE&DESFORMAT=PDF on the URL to get the output back as PDF.
    If you upgrade to Reports 6i, you can customize the default HTML parameter form.
    Regards,
    The Oracle Reports Team --skw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Function-based indexes

    Oracle documentation on "How Function-Based Indexes Work" states that for the creation of a function-based index in the user's own schema, the user must be granted the QUERY REWRITE system privileges. And MUST have the following initialization parameters defined to create a function-based index:
    QUERY_REWRITE_INTEGRITY set to TRUSTED
    QUERY_REWRITE_ENABLED set to TRUE.
    I have created a function-based unique index, which uses the SQL function DECODE(). But the user doesn't have the QUERY REWRITE sytem privilege. The user has the following privileges:
    CREATE PROCEDURE
    CREATE SEQUENCE
    CREATE SESSION
    CREATE TABLE
    CREATE TRIGGER
    CREATE VIEW
    And also the initialization parameters for QUERY_REWRITE_INTEGRITY and QUERY_REWRITE_ENABLED are set to their DEFAULT values as follows:
    QUERY_REWRITE_INTEGRITY set to ENCFORCED
    QUERY_REWRITE_ENABLED set to FALSE.
    Note: The index is an unique index for data integrity purpose. I am using Oracle 9.2.0.6 version.
    Kindly explain me the reason how the function-based index is created without the system privilege and the initialization parmaters defined as stated in the Oracle9i Database Administrator's Guide Release 2 (9.2).

    You can change those parameter at session level as well.
    Following link would be helpful:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:2552324147195810457::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:667694821129
    Jaffar

  • How to create dynamic ed flash charts based on user selected fields in Orac

    Hi all,
    Can any of the experts please tellme "how to create dynamic ed flash charts based on user selected fields in Oracle apex".
    Thanks
    Manish

    Hello,
    Lots of different ways to do this, I blogged about one way (using a Pipelined function) here -
    http://jes.blogs.shellprompt.net/2006/05/25/generic-charting-in-application-express/
    Other options include using a PL/SQL function returning the string to use as the dynamic query etc.
    Hope this helps,
    John.
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!

  • Function-based index error due to fine-grained security

    Hi, i'm working on Oracle version 9.2.0.5.
    I'm trying to create a function-based index but i'm getting an error due to fine-grained security. I checked resource_view but if i'm not wrong I should have all necessary roles. I also added xdbadmin to this user to be sure.
    I tried also to alter my session but it didn't worked.
    Connected to Oracle9i Enterprise Edition Release 9.2.0.5.0
    Connected as test_ste
    SQL>
    SQL> create index fbidx_schede_xml
      2  on schede_progetti_xml p
      3  (p.PROGETTO.extract('/Project/Elenco_unita/Unita/Responsabile/Cognome/text()').getStringVal());
    create index fbidx_schede_xml
    on schede_progetti_xml p
    (p.PROGETTO.extract('/Project/Elenco_unita/Unita/Responsabile/Cognome/text()').getStringVal())
    ORA-28133: full table access is restricted by fine-grained security
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at line 1
    SQL>
    SQL> alter session set query_rewrite_enabled = true;
    Session altered
    SQL> alter session set query_rewrite_integrity = trusted;
    Session altered
    SQL> create index fbidx_schede_xml
      2  on schede_progetti_xml p
      3  (p.PROGETTO.extract('/Project/Elenco_unita/Unita/Responsabile/Cognome/text()').getStringVal());
    create index fbidx_schede_xml
    on schede_progetti_xml p
    (p.PROGETTO.extract('/Project/Elenco_unita/Unita/Responsabile/Cognome/text()').getStringVal())
    ORA-28133: full table access is restricted by fine-grained security
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at line 1
    SQL> select * from user_role_privs;
    USERNAME                       GRANTED_ROLE                   ADMIN_OPTION DEFAULT_ROLE OS_GRANTED
    TEST_STE                      CONNECT                        NO           YES          NO
    TEST_STE                      CTXAPP                         NO           YES          NO
    TEST_STE                      RESOURCE                       NO           YES          NO
    TEST_STE                      XDBADMIN                       NO           YES          NO
    SQL> This are ACL on my schema:
      <ACL>
        <acl description="Private:All privileges to OWNER only and not accessible to others" xmlns="http://xmlns.oracle.com/xdb/acl.xsd" xmlns:dav="DAV:"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd                           http://xmlns.oracle.com/xdb/acl.xsd">
          <ace>
            <principal>dav:owner</principal>
            <grant>true</grant>
            <privilege>
              <all/>
            </privilege>
          </ace>
        </acl>
      </ACL>I tried to create a similar function-based index on Oracle 10.2.0.3 without any problem and without touching any ACL, is an Oracle 9.2.0.5 problem?
    Thanks for your attention.

    I didn't really (production wise)work yet with VPD. I know a lot is based on DBMS_RLS and I guess (IF it is VPD related) it should be to hard to find in the doc's how you could check what is beyond your privileges. As a DBA I noticed that even the dba account SYSTEM isn't always allow to export the full content for the tables anymore.
    There is a privilege that grants you all access that you need, despite the fact that you are not allowed to read certain rows from a table. Look it up.
    In all, as I said, it looks like account is not allowed to see all data from a table. In that respect it sounds logical that you also are, in that case, not allowed to build a function based index on that data

  • Impdp not importing function based index correctly.

    We noticed that a process running in our develop database was running much faster than in the production database. After investigating we found that on the development database the process was using an index on the main large table and on the production database the index was ignored and full table scans of the large table were being used.
    The data in the tables was the same, statistics were up-to-date, etc. Looking closer we saw that the index on the production database was function based because it had the DESC keyword on one column in the index. On the development database all columns of the index were ASC and thus it was a "normal" index. This was very confusing since we had just refreshed the development database from production using expdp/impdp. I ran impdp with the sqlfiles option to capture the DDL from the export file for the index in question from the production database:
    CREATE UNIQUE INDEX "SYSADM"."PS_SF_1098_ITEM" ON "SYSADM"."PS_SF_1098_ITEM" ("EMPLID", "SF_TIN", "CALENDAR_YEAR", "SEQ_NO" DESC, "DTL_SEQ_NBR")
    PCTFREE 10 INITRANS 2 MAXTRANS 255
    STORAGE(INITIAL 40960 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "PSINDEX" ;
    I then dropped the table/index in the development database and reimported just this one table. Sure enough, the index wasn't created as a function based index (no DESC keyword on SEQ_NO column):
    CREATE UNIQUE INDEX "SYSADM"."PS_SF_1098_ITEM" ON "SYSADM"."PS_SF_1098_ITEM" ("EMPLID", "SF_TIN", "CALENDAR_YEAR", "SEQ_NO", "DTL_SEQ_NBR")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 40960 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "PSINDEX" ;
    I've researched this extensively and can't find any information on why this is happening. Any ideas before I open a SR?
    BTW.... version is 11.1.0.7 patchset 31 on Windows Server 2003. Both dev and prod environments are identical.
    Thanks,
    Dan

    Working on something else I noticed the following two "hidden" init.ora parameters in both my dev and production databases:
    *._disable_function_based_index=TRUE
    *._ignore_desc_in_index=TRUE
    The first parameter explains why the index (function based) was being ignored in my production database. The second explains why the index is created without the DESC keyword in my dev database from an export from my prod database. I guess you do learn something new every day :)
    These databases are used by Peoplesoft applications and I found several posts saying that function based indexes created by Peoplesoft were causing performance and/or data validity problems and users were instructed to set the above parameters so the FIB's weren't used. So, everything is working as expected/designed. I will contact Peoplesoft Tech Support to see if users are still encouraged to set the above parameters.
    Dan

  • Importing error: related to function-based indexes?

    I've come across a strange error. I've got a user that has an export dump file who wants me to import the data into a new database. (Its an Oracle 10G database.)
    When I use the 'imp' command, the table import completes successfully, but I end up receiving the following warnings:
    IMP-00003: oracle error 942 encountered
    ORA-00942: table or view does not exist
    IMP-00017: following statement failed with ORACLE error 942
    "CREATE INDEX "X" on "Y" (TO_CHAR("Z",'yyyymmdd')) P"
    "CTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 3145728 FREELISTS 1 FREEL"
    "IST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "TBSPC" LOGGING"
    The table itself seems to have been imported correctly; and all data rows exist. Its just the index that isn't being imported/rebuilt. (Other indexes on the same table were imported properly.)
    The only thing that I could find that seems odd is that this index uses functions (the "TO_CHAR" in the index above). All of the other indexes on the table refer to basic fields. And I can rebuild the index manually.
    Is the 'imp' command able to handle function-based indexes? Is there some parameter than I need to set to allow it to import these indexes?
    (I know the more efficient thing to do would be to do an import with no indexes and rebuild them later...)
    Edited by: user588235 on Dec 9, 2009 5:16 PM

    Function based indexes should be supported. If it is exported, then it should be able to be imported. This just seems like a weird case. Have you tried to create a different table and then create a function based index on that table then see if exp/imp work?Yes, I have tried creating new versions of the tables (both with and without function-based indexes).
    During my tests, I found that I can recreate the problem if I create the table in Oracle 9 and import it into Oracle 10; the problem doesn't occur when importing/exporting between Oracle9->Oracle9 or Oracle10->Oracle10. (However, the user told me that this was an export from Oracle 10.)
    One other thing: I've noticed that if, instead of importing into a user account, I import into the system account, it works with no problems. For example:
    imp userid='sys/xyz as sysdba' file=mydata.dmp fromuser=use1 touser=use2 ->Results in warnings while reading indexes
    imp userid='sys/xyz as sysdba' file=mydata.dmp fromuser=use1 touser=sys ->works with no warning
    This makes me suspect that its a problem with the permissions that have been granted. (I've granted 'create any index' and 'query rewrite' to the user account however.)
    Not to change the issue, but since this is 10g, have you tried using datapump to expdp/impdp the same information?Might be an option; problem is, I'm dealing with a legacy system that was set up to use 'imp/exp', so altering backup and restore methods will require a lot of work.

  • Creating function-based indexes

    I'm trying to create a function-based index in one of the user's schemas and am getting an insufficient privilege error. Below are the examples:
    connect scott/tiger ;
    CREATE INDEX emp_ename_idx ON ename( emp ) ;
    Index created.
    CREATE INDEX upper_ename_idx ON ename( upper(ename)) ;
    ERROR at line1:
    ORA-01031: insufficient privileges
    The DBA granted the CREATE ANY INDEX privilege to user scott already. Any ideas???
    Thanks,
    SY

    Hi, all.
    I didn't hear about function-based index before, so I did some testing. Instead of using Oracle predefined functions (upper, lower, substr etc.), I created my own function and tried to create an index on it. I received an error that function is not deterministic. The definition of deterministic from Oracle docs:
    DETERMINISTIC
    This hint helps the optimizer avoid redundant function calls. If a stored function was called previously with the same arguments, the optimizer can elect to use the previous result. The function result should not depend on the state of session variables or schema objects. Otherwise, results might vary across calls. Only DETERMINISTIC functions can be called from a function-based index or a materialized view that has query-rewrite enabled.
    So, I put word deterministic in function declaration and everything works OK. Then I modified function to use some of the tables (I used tables across different schemas), recreated the index and it also worked fine.
    Question - is this statement correct: You can use schema objects in function which is in turn used for indexes as long as you put word deterministic in function declaration and all objects (function, index) will be valid, but ORACLE doesn't guarantee that result produced using that index will be correct?
    Thank you.

  • URGENT - Function based indexes

    Hi,
    I have a table with huge amount of data and hence I have created
    a function-based (Upper) index on one of the character NOT
    NULL field which is very likely to be used for query purposes.
    First of all though I can create ordinary normal field based
    indexes in my user I cannot create a function-based index, why
    That had to be created thru SYS user. Secondly I my query
    invloving this function is not using the index and instead doing
    a full-table scan. Problem outlined below :
    Table : PLZPOST, USER / OWNER : PARTNER, FIELD : ORT
    INDEX created on UPPER(ORT) in SYS user -
    Create index upper_plz_ort on partner.plzpost (upper(ort))
    When I give any of the following queries instead of using the
    resp. index as mentioned in Oracle DOC it just does a full table
    scan (checked thru Explain Plan) :
    select * from PLZPOST where upper(ort) is not null;
    select * from PLZPOST where upper(ort) like upper('saar%')
    select * from PLZPOST where upper(ort) = 'SAARBRUECKEN'
    etc etc
    If anyone has used Function-based indexes in Oracle 8i could you
    please tell me where am I going wrong. Is it because my Table
    belongs to PARTNER and Index to SYS (tried running the above
    queries under SYS user also but still did not work) ?? If so how
    can I grant access on an Index to PARTNER from SYS ??
    Your help would be greatly appreciated.
    Thanks in advance,
    Cheers
    Rashmi
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Rashmi Rungta ([email protected]):
    Hi,
    I have a table with huge amount of data and hence I have created
    a function-based (Upper) index on one of the character NOT
    NULL field which is very likely to be used for query purposes.
    First of all though I can create ordinary normal field based
    indexes in my user I cannot create a function-based index, why
    That had to be created thru SYS user. Secondly I my query
    invloving this function is not using the index and instead doing
    a full-table scan. Problem outlined below :
    Table : PLZPOST, USER / OWNER : PARTNER, FIELD : ORT
    INDEX created on UPPER(ORT) in SYS user -
    Create index upper_plz_ort on partner.plzpost (upper(ort))
    When I give any of the following queries instead of using the
    resp. index as mentioned in Oracle DOC it just does a full table
    scan (checked thru Explain Plan) :
    select * from PLZPOST where upper(ort) is not null;
    select * from PLZPOST where upper(ort) like upper('saar%')
    select * from PLZPOST where upper(ort) = 'SAARBRUECKEN'
    etc etc
    If anyone has used Function-based indexes in Oracle 8i could you
    please tell me where am I going wrong. Is it because my Table
    belongs to PARTNER and Index to SYS (tried running the above
    queries under SYS user also but still did not work) ?? If so how
    can I grant access on an Index to PARTNER from SYS ??
    Your help would be greatly appreciated.
    Thanks in advance,
    Cheers
    Rashmi<HR></BLOCKQUOTE>
    null

  • Function Based Indexes Errors

    Hi
    I am trying to create function based indexes based on the examples in the b10826 Spatial Users guide --
    The Create index statement is failing because it says it cannot read the metadata
    create index EMITTER_LOB_WIDX ON EMITTER (OWNER1.WT_GEOMETRY_PACKAGE.LINEOFBEARING(EQUIP_X, EQUIP_Y, LOB_BEARING, LOB_RANGE)) INDEXTYPE IS MDSYS.SPATIAL_INDEX LOCAL;
    create index EMITTER_LOB_WIDX ON EMITTER (EMITTER.WT_GEOMETRY_PACKAGE.LINEOFBEARING(EQUIP_X, EQUIP_Y, LOB_BEARING, LOB_RANGE)) INDEXTYPE IS MDSYS.SPATIAL_INDEX LOCAL
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-13203: failed to read USER_SDO_GEOM_METADATA view
    ORA-13203: failed to read USER_SDO_GEOM_METADATA view
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 10
    Here is the USER_SDO_GEOM_METADATA ENTRY:
    TABLE_NAME
    COLUMN_NAME
    DIMINFO(SDO_DIMNAME, SDO_LB, SDO_UB, SDO_TOLERANCE)
    SRID
    EMITTER
    OWNER1.WT_GEOMETRY_PACKAGE.LINEOFBEARING(EQUIP_X, EQUIP_Y, LOB_BEARING,
    LOB_RANGE)
    SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', -180, 180, .00005), SDO_DIM_ELEMENT('Y', -90,
    90, .000005))
    TABLE_NAME
    COLUMN_NAME
    DIMINFO(SDO_DIMNAME, SDO_LB, SDO_UB, SDO_TOLERANCE)
    SRID
    8307
    The package is owned by OWNER1 - the Table is in OWNER2's schema - not that that matters - what are the known issues with Function Based Indexes
    Am I missing something Obvious?

    I think its a bug
    I moved the function to the local schema - I also pulled it out of the package -
    So I look in USER_SDO_GEOM_METADATA no records for select * from USER_SDO_GEOM_METADATA
    Not being satisfied with that I look in ALL_SDO_GEOM_METADATA
    SELECT * FROM ALL_SDO_GEOM_METADATA WHERE OWNER = 'OWNER2';
    no rows selected
    So I should be good for insert
    INSERT INTO USER_SDO_GEOM_METADATA VALUES ('EMITTER','OWNER2.EQUIPMENTPOINT(EQUIP_X, EQUIP_Y)', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',-180,180,0.005),MDSYS.SDO_DIM_ELEMENT('Y',-90,90,0.005)), 8307);
    INSERT INTO USER_SDO_GEOM_METADATA VALUES ('EMITTER','LOCUST2.EQUIPMENTPOINT(EQUIP_X, EQUIP_Y)', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',-180,180,0.005),MDSYS.SDO_DIM_ELEMENT('Y',-90,90,0.005)), 8307)
    ERROR at line 1:
    ORA-13223: duplicate entry for EMITTER.OWNER2.EQUIPMENTPOINT(EQUIP_X, EQUIP_Y)
    in SDO_GEOM_METADATA
    ORA-06512: at "MDSYS.MD", line 1723
    ORA-06512: at "MDSYS.MDERR", line 17
    ORA-06512: at "MDSYS.SDO_GEOM_TRIG_INS1", line 21
    ORA-04088: error during execution of trigger 'MDSYS.SDO_GEOM_TRIG_INS1'
    If I insert to all_sdo_geom_metadata it takes but the index create fails b/c it cannot read user_sdo_geom_metadata
    INSERT INTO ALL_SDO_GEOM_METADATA VALUES (OWNER2','EMITTER','OWNER2.EQUIPMENTPOINT(EQUIP_X, EQUIP_Y)', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',-180,180,0.005),MDSYS.SDO_DIM_ELEMENT('Y',-90,90,0.005)), 8307);
    1 row created.
    SQL> CREATE INDEX EMITTER_EQUIP_WIDX ON EMITTER(OWNER2.EQUIPMENTPOINT(EQUIP_X, EQUIP_Y)) INDEXTYPE IS MDSYS.SPATIAL_INDEX PARAMETERS ('layer_gtype=point tablespace=EMITTER_IDX_TBS');
    CREATE INDEX EMITTER_EQUIP_WIDX ON EMITTER(OWNER2.EQUIPMENTPOINT(EQUIP_X, EQUIP_Y)) INDEXTYPE IS MDSYS.SPATIAL_INDEX PARAMETERS ('layer_gtype=point tablespace=EMITTER_IDX_TBS')
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-13203: failed to read USER_SDO_GEOM_METADATA view
    ORA-13203: failed to read USER_SDO_GEOM_METADATA view
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 10
    select table_name, column_name from user_sdo_geom_metadata;
    TABLE_NAME
    COLUMN_NAME
    EMITTER
    OWNER2.EQUIPMENTPOINT(EQUIP_X, EQUIP_Y)
    Arghhh!!!
    Anyone else encounter a similar problem?
    I know that I have to be careful regarding owner.packager.function naming convention
    I have followed the oracle examples from here
    http://www.oracle.com/technology/obe/obe10gdb/content/spatial/files/add_metadata_fi.sql
    are they broken? Is this a bug ?

  • Function based indexes on object tables

    Hi,
    I am trying to create a function based index on an object table. I am getting the following error:
    SQL> create index cell1_indx on cell1(create_cell1(id)) indextype is mdsys.spatial_index;
    create index cell1_indx on cell1(create_cell1(id)) indextype is mdsys.spatial_index
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-13249: internal error in Spatial index: [mdidxrbd]
    ORA-13249: Error in Spatial index: index build failed
    ORA-13249: Stmt-Execute Failure: SELECT num_rows from all_tables where owner='ASHE' and table_name=
    'CELL1'
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_9I", line 7
    ORA-06512: at line 1
    Here cell1 is an object table.
    Is the procedure for creating function based indexes on object tables different from relational tables?
    Chinni

    One of the many new features in Oracle 8i is the Function-Based Index (we will refrain from using FBI, but only just). This allows the DBA to create indexes on functions or expressions; these functions can be user generated pl/sql functions, standard SQL functions (non-aggregate only) or even a C callout.
    A classic problem the DBA faces in SQL Tuning is how to tune those queries that use function calls in the where clause, and result in indexes created on these columns not to be used.
    Example
    Standard B-Tree index on SURNAME with cost based optimizer
    create index non_fbi on sale_contacts (surname);
    analyze index non_fbi compute statistics;
    analyze table sale_contacts compute statistics;
    SELECT count(*) FROM sale_contacts
    WHERE UPPER(surname) = 'ELLISON';
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=3 Card=1 Bytes=17)
    1 0 SORT (AGGREGATE)
    2 1 TABLE ACCESS (FULL) OF 'SALES_CONTACTS' (Cost=3 Card=16 Bytes=272)
    Now we use a function based index
    create index fbi on sale_contacts (UPPER(surname));
    analyze index fbi compute statistics;
    analyze table sale_contacts compute statistics;
    SELECT count(*) FROM sale_contacts WHERE UPPER(surname) = 'ELLISON';
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=1 Bytes=17)
    1 0 SORT (AGGREGATE)
    2 1 INDEX (RANGE SCAN) OF 'FBI' (NON-UNIQUE) (Cost=2 Card=381 Bytes=6477)
    The function-based index has forced the optimizer to use index range scans (retuning zero or more rowids) on the surname column rather than doing a full table scan (non-index lookup). Optimal performance does vary depending on table size, uniqueness and selectivity of columns, use of fast full table scans etc. Therefore try both methods to gain optimal performance in your database.
    It is important to remember that the function-based B*Tree index does not store the expression results in the index but uses an "expression tree". The optimizer performs expression matching by parsing the expression used in the SQL statement and comparing the results against the expression-tree values in the function-based index. This comparison IS case sensitive (ignores spaces) and therefore your function-based index expressions should match expressions used in the SQL statement where clauses.
    Init.ora Parameters
    The following parameter must be set in your parameter file: QUERY_REWRITE_INTEGRITY = TRUSTED
    QUERY_REWRITE_ENABLED = TRUE
    COMPATIBLE = 8.1.0.0.0 (or higher)
    Grants
    Grants To create function-based indexes the user must be granted CREATE INDEX and QUERY REWRITE, or alternatively be granted CREATE ANY INDEX and GLOBAL QUERY REWRITE. The index owner must have EXECUTE access on the function used for the index. If execute access is revoked then the function-based index will be "disabled" (see dba_indexes).
    Disabled Indexes
    If your function-based index has a status of "disabled" the DBA can do one of the following:
    a) drop and create the index (take note of its current settings)
    b) alter index enable, function-based indexes only, also use disable keyword as required
    c) alter index unusable.
    Queries on a DISABLED index fail if the optimizer chooses to use the index.Here is an example ORA error:
    ERROR at line 1: ORA-30554: function-based index MYUSER.FBI is disabled.
    All DML operations on a DISABLED index also fail unless the index is also marked UNUSABLE and the initialization parameter SKIP_UNUSABLE_INDEXES is set to true.
    Some more Examples
    CREATE INDEX expression_ndx
    ON mytable ((mycola + mycolc) * mycolb);
    SELECT mycolc FROM mytable
    WHERE (mycola + mycolc) * mycolb <= 256;
    ..or a composite index..
    CREATE INDEX example_ndx
    ON myexample (mycola, UPPER(mycolb), mycolc);
    SELECT mycolc FROM myexample
    WHERE mycola = 55 AND UPPER(mycolb) = 'JONES';
    Restriction & Rule Summary
    The following restrictions apply to function based indexes. You may not index:
    a) LOB columns
    b) REF
    c) Nested table column
    d) Objects types with any of the above data types.
    Function-based indexes must always follow these rules:
    a) Cost Based optimizer only, must generate statistics after the index is created
    b) Can not store NULL values (function can not return NULL under any circumstance)
    c) If a user defined pl/sql routine is used for the function-based index, and is invalidated, the index will become "disabled"
    d) Functions must be deterministic (always return the same value for a known input)
    e) The index owner must have "execute" access on function used in the function-based index. Revocation of the privilege will render the index "disabled"
    f) May have a B-Tree and Bitmap index type only
    g) Can not use expressions that are based on aggregate functions, ie. SUM, AVG etc.
    h) To alter a function-based index as enabled, the function used must be valid, deterministic and the signature of the function matches the signature of the function when it was created.
    Joel P�rez

  • Function based indexes doing full table scan

    Guys,
    I am testing function based indexes and whatever I do
    it is doing a full table scan.
    1)I have set the following init parameters as
    QUERY_REWRITE_ENABLED=TRUE
    QUERY_REWRITE_INTEGRITY=TRUSTED
    2)CREATE INDEX i3 ON emp(UPPER(ename));
    3) ANALYZE TABLE emp COMPUTE STATISTICS
    ANALYZE INDEX I3 COMPUTE STATISTICS
    4) DELETE plan_table;
    5) EXPLAIN PLAN SET statement_id='Test1' FOR
    SELECT ename FROM emp WHERE UPPER(ename) = 'KING';
    6) SELECT LPAD(' ',2*level-2)||operation||' '||options||' '||object_name
    query_plan
    FROM plan_table
    WHERE statement_id='Test1'
    CONNECT BY prior id = parent_id
    START WITH id = 0 order by id
    7) And the query plan shows as
    SELECT STATEMENT
    TABLE ACCESS FULL EMP
    I am using 9.0.1.4 !!!
    Any help is appreciated !!!
    Regards,
    A.Kishore

    One of the many new features in Oracle 8i is the Function-Based Index (we will refrain from using FBI, but only just). This allows the DBA to create indexes on functions or expressions; these functions can be user generated pl/sql functions, standard SQL functions (non-aggregate only) or even a C callout.
    A classic problem the DBA faces in SQL Tuning is how to tune those queries that use function calls in the where clause, and result in indexes created on these columns not to be used.
    Example
    Standard B-Tree index on SURNAME with cost based optimizer
    create index non_fbi on sale_contacts (surname);
    analyze index non_fbi compute statistics;
    analyze table sale_contacts compute statistics;
    SELECT count(*) FROM sale_contacts
    WHERE UPPER(surname) = 'ELLISON';
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=3 Card=1 Bytes=17)
    1 0 SORT (AGGREGATE)
    2 1 TABLE ACCESS (FULL) OF 'SALES_CONTACTS' (Cost=3 Card=16 Bytes=272)
    Now we use a function based index
    create index fbi on sale_contacts (UPPER(surname));
    analyze index fbi compute statistics;
    analyze table sale_contacts compute statistics;
    SELECT count(*) FROM sale_contacts WHERE UPPER(surname) = 'ELLISON';
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=1 Bytes=17)
    1 0 SORT (AGGREGATE)
    2 1 INDEX (RANGE SCAN) OF 'FBI' (NON-UNIQUE) (Cost=2 Card=381 Bytes=6477)
    The function-based index has forced the optimizer to use index range scans (retuning zero or more rowids) on the surname column rather than doing a full table scan (non-index lookup). Optimal performance does vary depending on table size, uniqueness and selectivity of columns, use of fast full table scans etc. Therefore try both methods to gain optimal performance in your database.
    It is important to remember that the function-based B*Tree index does not store the expression results in the index but uses an "expression tree". The optimizer performs expression matching by parsing the expression used in the SQL statement and comparing the results against the expression-tree values in the function-based index. This comparison IS case sensitive (ignores spaces) and therefore your function-based index expressions should match expressions used in the SQL statement where clauses.
    Init.ora Parameters
    The following parameter must be set in your parameter file: QUERY_REWRITE_INTEGRITY = TRUSTED
    QUERY_REWRITE_ENABLED = TRUE
    COMPATIBLE = 8.1.0.0.0 (or higher)
    Grants
    Grants To create function-based indexes the user must be granted CREATE INDEX and QUERY REWRITE, or alternatively be granted CREATE ANY INDEX and GLOBAL QUERY REWRITE. The index owner must have EXECUTE access on the function used for the index. If execute access is revoked then the function-based index will be "disabled" (see dba_indexes).
    Disabled Indexes
    If your function-based index has a status of "disabled" the DBA can do one of the following:
    a) drop and create the index (take note of its current settings)
    b) alter index enable, function-based indexes only, also use disable keyword as required
    c) alter index unusable.
    Queries on a DISABLED index fail if the optimizer chooses to use the index.Here is an example ORA error:
    ERROR at line 1: ORA-30554: function-based index MYUSER.FBI is disabled.
    All DML operations on a DISABLED index also fail unless the index is also marked UNUSABLE and the initialization parameter SKIP_UNUSABLE_INDEXES is set to true.
    Some more Examples
    CREATE INDEX expression_ndx
    ON mytable ((mycola + mycolc) * mycolb);
    SELECT mycolc FROM mytable
    WHERE (mycola + mycolc) * mycolb <= 256;
    ..or a composite index..
    CREATE INDEX example_ndx
    ON myexample (mycola, UPPER(mycolb), mycolc);
    SELECT mycolc FROM myexample
    WHERE mycola = 55 AND UPPER(mycolb) = 'JONES';
    Restriction & Rule Summary
    The following restrictions apply to function based indexes. You may not index:
    a) LOB columns
    b) REF
    c) Nested table column
    d) Objects types with any of the above data types.
    Function-based indexes must always follow these rules:
    a) Cost Based optimizer only, must generate statistics after the index is created
    b) Can not store NULL values (function can not return NULL under any circumstance)
    c) If a user defined pl/sql routine is used for the function-based index, and is invalidated, the index will become "disabled"
    d) Functions must be deterministic (always return the same value for a known input)
    e) The index owner must have "execute" access on function used in the function-based index. Revocation of the privilege will render the index "disabled"
    f) May have a B-Tree and Bitmap index type only
    g) Can not use expressions that are based on aggregate functions, ie. SUM, AVG etc.
    h) To alter a function-based index as enabled, the function used must be valid, deterministic and the signature of the function matches the signature of the function when it was created.
    Joel P�rez

  • Function-based indexes in 8i

    How can I enable function-based indexes on a already created
    database. Is an Installation/Db Creation setting?
    On another database I am able to create function-based indexes.
    Any help appreciated.
    Ashish
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Rashmi Rungta ([email protected]):
    Hi,
    I have a table with huge amount of data and hence I have created
    a function-based (Upper) index on one of the character NOT
    NULL field which is very likely to be used for query purposes.
    First of all though I can create ordinary normal field based
    indexes in my user I cannot create a function-based index, why
    That had to be created thru SYS user. Secondly I my query
    invloving this function is not using the index and instead doing
    a full-table scan. Problem outlined below :
    Table : PLZPOST, USER / OWNER : PARTNER, FIELD : ORT
    INDEX created on UPPER(ORT) in SYS user -
    Create index upper_plz_ort on partner.plzpost (upper(ort))
    When I give any of the following queries instead of using the
    resp. index as mentioned in Oracle DOC it just does a full table
    scan (checked thru Explain Plan) :
    select * from PLZPOST where upper(ort) is not null;
    select * from PLZPOST where upper(ort) like upper('saar%')
    select * from PLZPOST where upper(ort) = 'SAARBRUECKEN'
    etc etc
    If anyone has used Function-based indexes in Oracle 8i could you
    please tell me where am I going wrong. Is it because my Table
    belongs to PARTNER and Index to SYS (tried running the above
    queries under SYS user also but still did not work) ?? If so how
    can I grant access on an Index to PARTNER from SYS ??
    Your help would be greatly appreciated.
    Thanks in advance,
    Cheers
    Rashmi<HR></BLOCKQUOTE>
    null

Maybe you are looking for

  • IChat video no longer working after Leopard upgrade

    I always used to be able to video chat with everyone and then after my Leopard upgrade, no such luck... I looked through the user tips and here is what I have done. 1) Have you done the Quicktime Streaming setting ? Yes, I have it set 2) Are you runn

  • Problems with Smart Folders

    Wondering if anyone has any suggestions. Bought a new MB Pro and directed Aperture to the library on an external HD. It opened and looked the same, all the folders in the right places, etc. When I click on a smart folder, nothing comes up and the set

  • About  Interactve Reports

    Hi Falks,   If any one knows about interactive report transaction code than plz give reply as well as send  me one step by step example how to create interactive reports. mail me on "[email protected]". Thanx and regards, Rahul Talele

  • How to check if remote phone locking in E5 is work...

    how to check if remote phone locking in E5 is working

  • How to cancel confirmation which is in error

    Helly Guys, I have created a PO with wrong G/L account,  and confirmantion has been done but with error. G/R couldn't be created due to the error.    I was able to correct the PO in SRM with correct G/L account and it auto changed in ECC  but when it