Oracle 中 有时候需要通过隐含参数控制一些功能,但是查看隐含参数的 SQL 比较长,可以通过如下视图封装后,简化查询过程:
CREATE VIEW hparams
as
SELECT a.ksppinm paramName,
a.ksppdesc description,
b.ksppstvl SessionValue,
c.ksppstvl InstanceValue,
decode(bitand(a.ksppiflg/256,1),1,'TRUE','FALSE') IS_SESSION_MODIFIABLE,
decode(bitand(a.ksppiflg/65536,3),1,'IMMEDIATE',2,'DEFERRED',3,'IMMEDIATE','FALSE') IS_SYSTEM_MODIFIABLE,
decode(bitand(a.ksppiflg/524288,1),1,'TRUE','FALSE') ISPDB_MODIFIABLE
FROM x$ksppi a,
x$ksppcv b,
x$ksppsv c
WHERE a.indx = b.indx
AND a.indx = c.indx
AND a.ksppinm LIKE '/_%' escape '/'
ORDER BY REPLACE (a.ksppinm, '_', '');
使用示例:
SQL> col PARAMNAME for a50
SQL> col SESSIONVALUE for a15
SQL> col INSTANCEVALUE for a15
SQL> set lines 190
SQL> select paramName,SessionValue,InstanceValue from hparams where paramname='_report_capture_cycle_time';
PARAMNAME SESSIONVALUE INSTANCEVALUE
-------------------------------------------------- --------------- ---------------
_report_capture_cycle_time 60 60
版权声明:本文为博主原创文章,未经博主允许不得转载。