天道酬勤

Oracle and My Life

Archive for the ‘Useful Script’ tag

查询隐含参数的代码

leave a comment

下面代码可用于查询系统中所有的隐含参数,Coding来自eygle的著作《深入浅出Oracle》。再次精读这本书,以前对Oracle的理解一些模糊的地方慢慢清晰起来,告诫自己,继续努力!
Coding:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
SQL>select 
   x.ksppinm   name,
   y.ksppstvl  VALUE,
   y.ksppstdf  isdefault,
   decode(bitand(y.ksppstvf,7),1,'MODIFIED',4,'SYSTEM_MOD','FALSE')  ismod,
   decode(bitand(y.ksppstvf,2),2,'TRUE','FALSE')  isadj
   FROM
     sys.x$ksppi   x,
     sys.x$ksppcv  y
   WHERE
     x.inst_id=userenv('Instance') AND
     y.inst_id=userenv('Instance') AND
     x.indx=y.indx AND
     x.ksppinm LIKE '%_&par%'
   ORDER BY
     translate(x.ksppinm,'_','');
Enter VALUE FOR par: shared_pool_reserved_min_alloc
OLD  14:      x.ksppinm LIKE '%_&par%'
NEW  14:      x.ksppinm LIKE '%_shared_pool_reserved_min_alloc%'
 
NAME                                VALUE        ISDEFAULT ISMOD      ISADJ
----------------------------------- ------------ --------- ---------- -----
_shared_pool_reserved_min_alloc     4400         TRUE      FALSE      FALSE

-The End-

Written by ochef

May 12th, 2009 at 1:32 pm

Posted in dba-script

Tagged with

无觅相关文章插件,快速提升流量