用show parameter也能显示隐含参数(二)

2014-11-24 18:57:23 · 作者: · 浏览: 14
like


'#%') or (ksppstdf = 'FALSE') or (bitand(ksppstvf,5) > 0)))


V$PARAMETER 的定义主要来源于 GV$PARAMETER , 两个都是同义词,来源于v_$parameter和gv_$parameter。


这个定义语句中最关键部分 (translate(ksppinm,'_','#') not like '#%') 的条件。就是它把开头为 "_" 的隐含参数给过滤掉了。因为加了 ksppstdf = 'FALSE' 的条件,这保证如果已经手动改过隐含参数, show parameter 时会显示已经修改的隐含参数。


最后,重建 gv$parameter视图


create or replace view gv_$parameter(INST_ID, NUM, NAME , TYPE , VALUE, DISPLAY_VALUE, ISDEFAULT, ISSES_MODIFIABLE , ISSYS_MODIFIABLE , ISINSTANCE_MODIFIABLE, ISMODIFIED , ISADJUSTED , ISDEPRECATED , DESCRIPTION, UPDATE_COMMENT , HASH ) as
select x.inst_id,
x.indx + 1,
ksppinm,
ksppity,
ksppstvl,
ksppstdvl,
ksppstdf,
decode(bitand(ksppiflg / 256, 1), 1, 'TRUE', 'FALSE'),
decode(bitand(ksppiflg / 65536, 3),
1,
'IMMEDIATE',
2,
'DEFERRED',
3,
'IMMEDIATE',
'FALSE'),
decode(bitand(ksppiflg, 4),
4,
'FALSE',
decode(bitand(ksppiflg / 65536, 3), 0, 'FALSE', 'TRUE')),
decode(bitand(ksppstvf, 7), 1, 'MODIFIED', 4, 'SYSTEM_MOD', 'FALSE'),
decode(bitand(ksppstvf, 2), 2, 'TRUE', 'FALSE'),
decode(bitand(ksppilrmflg / 64, 1), 1, 'TRUE', 'FALSE'),
ksppdesc,
ksppstcmnt,
ksppihash
from sys.x$ksppi x, sys.x$ksppcv y
where (x.indx = y.indx) and (translate(ksppinm, '_', '#') not like '##%');


有一个疑问:


show parameter 时查的是同义词gv$parameter。该同义词无法删除重建。


SQL> create synonym GV$PARAMETER for GV_$PARAMETER;
create synonym GV$PARAMETER for GV_$PARAMETER
*
ERROR at line 1:
ORA-00955: name is already used by an existing object



SQL> drop synonym GV$PARAMETER;
drop synonym GV$PARAMETER
*
ERROR at line 1:


ORA-02030: can only select from fixed tables/views