Skip to content

Commit

Permalink
incasesensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
xtender committed Mar 25, 2015
1 parent b286b08 commit 8009f87
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
45 changes: 45 additions & 0 deletions fix_control_features.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
accept _path_mask prompt "Path mask[.*]: " default '.*';
accept _min_ver prompt "Min version: " default '';

col path for a90;
col description for a64;
col opt_feat_enable for a8;

with feature_hierarchy as (
select--+ no_merge
rownum n
,f.sql_feature
,substr(SYS_CONNECT_BY_PATH(REPLACE(f.sql_feature, 'QKSFM_'), ' -> '),5) path
from
v$sql_feature f
, v$sql_feature_hierarchy fh
where
f.sql_feature = fh.sql_feature
connect by fh.parent_id = prior f.sql_feature
start with fh.sql_feature = 'QKSFM_ALL'
)
select
fh.path
,c.bugno
,c.description
,c.optimizer_feature_enable as opt_feat_enable
,c.event
,c.is_default
from
feature_hierarchy fh
,v$system_fix_control c
where
fh.sql_feature = regexp_replace(c.sql_feature,'_\d+$')
and ('&_path_mask' is null or regexp_like(fh.path,'&_path_mask','i'))
and ('&_min_ver' is null
or c.optimizer_feature_enable is null
or regexp_replace(regexp_replace(c.optimizer_feature_enable,'(\d+)','0000\1'),'\d*(\d{2})','\1')
>=
regexp_replace(regexp_replace('&_min_ver' ,'(\d+)','0000\1'),'\d*(\d{2})','\1')
)
/
col path clear;
col description clear;
col opt_feat_enable clear;

undef _path_mask _hint_mask _min_ver;
4 changes: 2 additions & 2 deletions hinth2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ select fh.path
from feature_hierarchy fh
,v$sql_hint hi
where hi.sql_feature(+) = fh.sql_feature
and ('&_path_mask' is null or regexp_like(fh.path,'&_path_mask'))
and ('&_hint_mask' is null or regexp_like(hi.name,'&_hint_mask'))
and ('&_path_mask' is null or regexp_like(fh.path,'&_path_mask','i'))
and ('&_hint_mask' is null or regexp_like(hi.name,'&_hint_mask','i'))
and ('&_min_ver' is null or version is null or regexp_replace(regexp_replace(version,'(\d+)','0000\1'),'\d*(\d{2})','\1')>= regexp_replace(regexp_replace('&_min_ver','(\d+)','0000\1'),'\d*(\d{2})','\1'))
order by n, hint_class, hint_name, version
/
Expand Down

0 comments on commit 8009f87

Please sign in to comment.