data dictionary views and result_cache

Hello
Are there special aspects when caching the results of a function that uses data dictionary views to determine its results?
This issue arose because I have a such a result_cached function for which the result_cache objects are not get invalidated, even when the underlying data dictionary views have changed and the function gives 'fade' in it values came out. Addition of article relies_on has not helped either.

Here's what I'm trying to do:
The function accepts the name of the table as its input and trying to determine all the child tables by using the sys.dba_constraints view. The results are returned in a pl/sql table and are cached so that subsequent calls to this function use the result_cache.
Everything works well for the parent/child tables that were created before the creation of this function. All the results are correct.

The problem starts when a child table is added to an existing table in the parent.
V$ result_cache_objects view shows the result of this function as "Published" and the output of the function do not show the child table that is newly created.
The same is when an existing child table is deleted; the function continues to return in the output as it is extracted from the result_cache.

Oracle version:
Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
AMT for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

>
Restrictions on result caching functions *.

To be cached in result, a function must meet all of these criteria:

* It is not defined in a module that has the rights to the plaintiff, or in an anonymous block.
* It is not a function table in pipeline.
* It does not reference dictionary tables, temporary tables, sequences or not deterministic SQL.
For more information, see Oracle Database Performance Tuning Guide.
* It has no OUT or IN OUT parameters.
* No parameter has one of these types:
o BLOB
o CLOB
o NCLOB
o REF CURSOR
o Collection
o object
o file
Return type is none:
o BLOB
o CLOB
o NCLOB
o REF CURSOR
o object
o collect Record or PL/SQL that contains a return unsupported type

It is recommended that a result caching function also meet these criteria:

* It has no side effects.
For more information about side effects, see "subprogram Side Effects".
* It is not specific to the session settings.
For more information, see "Making Result-Cached functions manage Session-specific settings.
* It is not specific to the session application contexts.
>
http://download.Oracle.com/docs/CD/E11882_01/AppDev.112/e17126/subprograms.htm#LNPLS698

Tags: Database

Similar Questions

  • Cannot select Tables or data dictionary views

    Hello

    I have a normal user from where I want to visualize the data dictionary tables and views as DBA_ and V$ _ because I do not want to log the SYS account each time.

    I have granted all the privileges of the user, but it does not work. Here are the commands I used.

    all the privileges of the user;

    Grant sysdba to user;

    Can you help me please

    Hello

    grant this user SELECT_CATALOG_ROLE. Revoke all privileges that the user didn't need, or he would be able to do all sorts of things destructive (up to drop the entire database) by accident.

    Best regards

    Nikolai

  • Any data dictionary view for details on licensing only features?

    Hello

    There in oracle 10.2.0.4, any view data dictionary that provides details on these two options by default from Enterprised edition
    as well as licensed features at a glance?

    I know that DBA_FEATURE_USAGE_STATISTICS provides details on what function is used. But I'm interested capture only
    use that are allowed and not the standard features.

    Thank you

    In this case, you will need to find a document entitled "Bill", which has "Oracle Corp" on him.
    Oracle doesn't keep track of license within the database info.
    It uses dba_feature_usage_statistics to be able to continue if.

    -------------
    Sybrand Bakker
    Senior Oracle DBA

  • How to import data dictionary views

    I want to import all_tab_comments and use it for research in a map.
    Is it possible to do other than creating a view in my schema that makes a ' select * from all_tab_comments "?

    11 GR 1 material OWB

    Hello

    There are 2 locations for module; one is the location of metadata in which objects are imported, the other is the location of the data. What you could do, is for your regular module have a different metadata location to capture the ALL_TAB_COMMENTS view for example (even if it's just for the duration of the metadata import), this place would still have the credentials (name and password) as your regular location, but the scheme would be SYS. Then, when you import the views, turn on views and synonyms, ALL_TAB_COMMENTS would be visible and you can select and import.

    See you soon
    David

  • What data dictionary view can tell me what columns in the index are compressed?

    So I can create an index compressed on a table like this:

    create index t23_idx on t23 (col3, col5, col1) compress 2;

    This creates an index with a degree of compression of 2. So far so good.

    But how do I know what columns are in fact, compressed at a later date? View USER_INDEX tells me that if COMPRESSION is enabled, but there is nothing on the view USER_IND_COLUMNS to say which columns are compressed.

    Of course, I can retrieve information through DBMS_METADATA. GET_DDL but I'm really after receiving a request, because it is more convenient.

    I had hopes for SYS. ICOL$. SPARE1, but that doesn't seem to be compatible with what I expect. However, if someone can confirm that this column is indeed the Badger so I gladly adjust my expectations.

    Cheers, APC

    OK, I may not read your question.
    DBA_INDEXES. PREFIX LENGTH is "the number of columns in the prefix of the compression key."

    http://docs.Oracle.com/CD/E11882_01/server.112/e24448/statviews_1106.htm#i1578369

    Mike

  • Data Dictionary view to see the object directory

    Hi all

    I boat UTL_FILE need to create the output file. To use this package, we need to have directory object.

    Can someone tell me what data dictionary table, we can use to see what directory is allowed to be use UTL_FILE boat to the Unix server.

    All_directories
    dba_directories

  • Can I introduce a few relationships in data with the views and the Table maker?

    Hello. I have db with lots of views and tables. Can I introduce a few relationships in maker data with Tables and views? I have to configure PK and FK for my tables and views if I want to see relationships? I just started with the Data Modeler. Thank you for your help.

    Hello

    If you import your database Tables (Import / Data Dictionary), foreign keys defined in your database will be also imported.

    He is also a foreign key discovery tool in maker of data that can help you identify possible FK relationships and add them to your model.

    To use it, right click on the entry for your relational model in the tree view of the browser and select the foreign keys to discover on the menu drop down.

    Note that data Modeler does not support PKs and FKs on views.

    David

  • How to make permanent changes in the files? Know how always have "List view" and the option "sort by: Date of change?"

    It is so annoying to have to change my folders in the list view, whenever I open them. How do I change so by default, all my files are presented to the list? I have no other views and want just all my folders in the list view at all times.

    Also, I hate having to click on "sort by...» ' and then 'more' and then 'Update' everytime I want to sort the content of one of my folders to update. How do "Sort by modified date" a default option in the menu "sort by" without having to click on 'more' every time? I just want to do a right click and then be able to sort by modified date.

    I would appreciate help. The way I have to do now is a huge waste of time.

    You should be able to define a file / print this page as you like.

    Click on organize upper-left.

    Click on the folder and search options,

    Click on the view section on applied to the folders listed on top.

    Then click on apply and OK on the bottom.

  • Push the view, enter data, Pop store and the... How?

    Simple example...

    I need to get data from one view in the other as if a notice has been a pop up.

    for example...

    I have a baseView with a button "SELECT DATE".

    When the user clicks the button, they see dateView and they enter the date here.

    When finished selecting the date, they click OK in dateView who must bring back them to baseView passing the selected date.

    What is the best way to do it?

    -use a sharedObject to store the date and when to pick it up on base?

    -pop baseView then press OK then dateView push baseView with data?

    n ' not use a dateView but rather a popup dateEntry (as a custom alert)?

    There are several ways I could go with this, would like to know what the experts, however, suggest.

    Thank you.

    Ok. Looks like I found the answer and then some.

    Glad to know I wasn't the only one looking for something like this.

    http://remotesynthesis.com/post.cfm/passing-data-on-pop-methods-in-mobile-Flex

    and

    http://www.remotesynthesis.com/post.cfm/passing-data-across-views-in-Flex-Mobile

    Thanks RemoteSynthesis.com

  • Submit Smart data view and Lock and send in Excel Addin

    Hi all

    I need to prevent users to send data to Smart view or Excel Addin.
    I can't as read access because I want to write of the Hyperion Planning Web Form.

    On the same any help will be appriciated highily.
    We want to display the data by using Smart view and macros, but do not want to change the data from there.

    ^ ^ ^ There is nothing to do. This is the mode of operation of the Planning. Users planning Essbase are read-only. Go check their filters and you will see what I mean.

    Kind regards

    Cameron Lackpour

  • OmniPortlet and Oracle data dictionary

    Hello
    I have this problem. I have to develop a portlet in order to:

    -Send an email to all the users who belong to groups whose names begin to "shiftlist.

    For example, if we have groups:

    1 shiftlist_ XX
    2 shiftlist_YY
    3 AA

    I send email to all users who belong to the first and second groups.

    Someone told me to query the data dictionary (SELECT all_users username where username like ' shiftlist_ %) to get the desired users.

    Is it possible to create a portlet with Omniportlet to get the list of users in your opinion?

    Thank you very much

    You can create a portlet omni with standard sql and display users, but if you want to send an email to them, I think that the best approach is to develop a regular JSR 168 portlet.

  • Import data dictionary stored procedures

    It's the rewamp of an old archived thread:

    Re: import of data dictionary

    .. relevant even today with DataModeleter 4.1 (standalone) on Oracle 12 c: I seem not to be able to import any stored procedure / function of the well data dictionary that following the steps (see link) and reaching even to the summary confirming the detection of target objects:

    Capture.JPG

    However, at the time of the merger, previews DDL (to import/merge, no generation) says:

    -CREATE THE PROCEDURE0
    -CREATE FUNCTION0

    Am I missing a trivial step?

    THX

    Hello

    I think I know what is the cause of the problem.

    There is a bug in version 4.1 where different types of objects (including functions and stored procedures) do not appear in the tree view to compare if the property "include physical properties to compare the feature ' is not defined.

    So the solution is to ensure that this property is set.  It is on the Data Modeler > DOF > DDL/comparison of preferences page.

    This bug in the next version.

    David

  • A full import by using datapump will overwrite the target database data dictionary?

    Hello

    I have a 11G with 127 GB database. I did a full export using expdp as a user of the system. I'll import the created dump file (which is 33 GB) on the basis of data from 12 c target.

    When I do the full import on the 12 c database data dictionary is updated with new data. But as is it already contained data dictionary? It will also change?

    Thanks in advance

    Hello

    In addition to the responses of the other comrades

    To start, you need to know some basic things:

    The dictionary database tables are owned by SYS and must of these tables is created when the database is created.

    Thus, in the different versions of database Oracle there could be less or more data dictionary tables of different structure database,.

    so if this SYSTEM base tables are exported and imported between different versions of oracle, could damage the features of database

    because the tables do not correspond with the version of database.

    See the Ref:

    SYS, owner of the data dictionary

    Database Oracle SYS user is owner of all the base tables and a view of the data available to the user dictionary. No Oracle database user should never change (UPDATE, DELETE, or INSERT) ranks or schema objects contained in the SYS schema, because this activity can compromise the integrity of the data. Security administrator must keep strict control of this central account.

    Source: http://docs.oracle.com/cd/B28359_01/server.111/b28318/datadict.htm

    Prosecutor, the utilities for export cannot export the dictionary SYS base tables and is marked

    as a note in the documentation:

    Data Pump export Modes

    Note:

    Several patterns of system cannot be exported because they are not user patterns; they contain metadata and data managed by Oracle. Examples of system schemas that are not exported MDSYS SYS and ORDSYS.

    Source: https://docs.oracle.com/cd/E11882_01/server.112/e22490/dp_export.htm#SUTIL826

    That's why import cannot modify/alter/drop/create dictionary database tables. If you can not export, so you can not import.

    Import just to add new Non - SYS objects/data in the database, therefore new data are added to the dictionary base tables (as new users, new tables, code pl/sql etc).

    I hope that this might answer your question.

    Kind regards

    Juan M

  • DBMS PARALLEL EXECUTE TASK NOT VISIBLE IN DATA DICTIONARY (don't no segmentation of data)

    Hi all

    I have a standard code we use for treatment using 'dbms_parallel_execute' in typical parallel
    dbms_parallel_execute.create_Task
    dbms_parallel_execute.create_chunks_by_rowid
    dbms_parallel_execute.run_task
    Get the status of the task and retry to resume processing

    But I'm not able to do it successfully in production env well I tested the same code on stage several times.

    I am not able to view task information in dba_parallel_execute_tasks then my work being performed in the production oracle database.

    It simply goes into retry section
    WHILE (l_retry < 2 AND l_task_status! = DBMS_PARALLEL_EXECUTE.) FINISHED)
    LOOP
    l_retry: = l_retry + 1;
    DBMS_PARALLEL_EXECUTE.resume_task (l_task_name);
    l_task_status: = DBMS_PARALLEL_EXECUTE.task_status (l_task_name);
    END LOOP;

    and coming up with this exception

    * ORA-06512: at "SYS." DBMS_PARALLEL_EXECUTE', line 458 ORA-06512: at
    'SYS. DBMS_PARALLEL_EXECUTE', line 494 ORA-06512: at "pkg_name.", line 1902
    ORA-29495: invalid state for the task of CV *.
    Except it seems something went wrong with the State of the task, but I suspect that the task is itself not having created and data are not getting stored in bulk for a specific table on this.


    * Have you encountered this any time during your codes. I'm really naïve what goes wrong. Why I am not able to see the task in these data
    Dictionary and why his does not address anything I am not able to see the information stored bulk when executing my work.

    Hi all

    For this question special chunking going on some how I wasn't able to see in Toad but even got read when I ran through sqlplus. Something strange with Toad.

    But the issue I debugged and found it to be a failure after the sequencing of the work in eight parallel threads.

    I got all the info related to these jobs when I ask dba_scheduler_job_run_details and find the State of the work "In FAILURE" with certain policies of Homeland Security has failed in background process which plans jobs where they are tracking call schema os and ip address. Then triggered demand ACL for this scheme and the fixed number.

    Hope that this info will be useful.

    Thank you

    Sunil

  • Small design on the points of view and a Where Clause Board...

    Hi all...  I just want to check Im doing things right, and he is not a better way to do this...

    Running APEX 4.2.5 and XE 11.2

    Ive built my application around a community of users who have access to certain groups of data...  Ive designed so that there are views and then transparent filter the data of a given user. for example, the view below seamlessly that users can see the filters depending on which application they use, they can see more specifically, what are the features and finally, what group they are actually in.

    Create view ENTITIES like)

    Select * from t_entities t

    where exists (select 1

    of application_groups ag

    where ag.object_name = 'ENTITIES '.

    and ag.object_id = t.entity_id

    and ag.group_name = 'CASH FLOW')

    and exists (select 1 from entity_users EU

    where eu.username = nvl (v ('APP_USER'), USER) / * APEX APPLICATION USER * /.

    and eu.entity_id = t.entity_id)

    and it exists (select 1 from entity_group_members for example

    where eg.entity_group = v('G_ENTITY_GRP_ID') / * ENTITY_GROUP * /.

    and eg.entity_id = t.entity_id)

    )

    The overall costs when I run the explain command is very low (23 or almost), so I think that its an effective way of filtering... However, out of 300 entities or greater, the vast majority of users (75%) can see 75% of data...  Also, I need to create another view to filter another set of data with 2000 records. one with the view in place, 95% of the staff will see 95% of the data and only 10% of the staff see the other 10%...

    I note that its faster when a member of a group brings back only a tiny part of the data compared to the other way around... This is why Im asking before implementing another view of the same type.

    So, on my question. Is there a better way to do this, or the query should be on there head with a WHERE clause does NOT EXIST (xxxxx! = yyyyy)) or soemthing else ther is quite that Ive missed...

    The only other comment is that Im using the upper table "APPLICATION_GROUPS" for more than one type of object (i.e. entities and entity accounts banking..) y at - it no merit in separaitng the two into two tables?

    Thank you very much

    Richard

    Hi Richard,

    Miss me a lot of information but:

    I think that your design could be allowed. It seems a little too mat, maybe, but I think this could work.

    It is important to have the good indexing and use compression of index:

    On application_groups (object_name, the GroupName, groupname) compresses

    IT compresses to entity_users (username, entity_id)

    On the entity_group_members (entity_group, entity_id) compress

    I think v as v ('G_ENTITY_GRP_ID') is a user-defined function? If so, if possible, set the deterministic and uses result_cache.

    Consider partitioning application_groups type (= object_name?)

Maybe you are looking for