forked from xtender/xt_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinvalidate_function_in_package.sql
51 lines (50 loc) · 1.25 KB
/
invalidate_function_in_package.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
prompt Invalidate result cache of the package function:
accept pkg_owner prompt "Package owner:";
accept pkg_name prompt "Package name :";
accept pkg_func prompt "Function name:";
col name format a80;
col cache_id format a50;
col status format a10;
select
d.*
-- ,o.owner
-- ,o.object_name
,o.object_type
,rco.name
,rco.cache_id
,rco.status
,dbms_result_cache.Invalidate_Object(rco.id) invalidated
from
dba_objects o
,v$result_cache_dependency d
,v$result_cache_objects rco
where
o.object_id=d.object_no
and rco.ID=d.result_id
and o.owner='&pkg_owner'
and o.object_name ='&pkg_name'
and regexp_like(rco.name,'"'||o.owner||'"."'||o.object_name||'"::\d+.\."'||'&pkg_func".*')
/
prompt After invalidation:
select
d.*
-- ,o.owner
-- ,o.object_name
,o.object_type
,rco.name
,rco.cache_id
,rco.status
from
dba_objects o
,v$result_cache_dependency d
,v$result_cache_objects rco
where
o.object_id=d.object_no
and rco.ID=d.result_id
and o.owner='&pkg_owner'
and o.object_name ='&pkg_name'
and regexp_like(rco.name,'"'||o.owner||'"."'||o.object_name||'"::\d+.\."'||'&pkg_func".*')
/
col name clear;
col cache_id clear;
col status clear;