您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

参数文件视图

2024/2/18 8:03:28发布26次查看
用过oracle的朋友都知道,现在绝大部分oracle数据库使用的是基于服务器的参数文件。对于查询当前数据库实例级别,system级别,session级别参数的具体设置有些时候很容易混淆。本文主要介绍了oracle数据库参数使用的相关视图(v$parameter,v$parameter2,v$sy
用过oracle的朋友都知道,现在绝大部分oracle数据库使用的是基于服务器的参数文件。对于查询当前数据库实例级别,system级别,session级别参数的具体设置有些时候很容易混淆。本文主要介绍了oracle数据库参数使用的相关视图(v$parameter,v$parameter2,v$system_parameter,v$system_parameter2,v$spparameter),以及通过查询oracle视图来获得不同情形下的参数值并进行对比。
 1、对比有关参数视图
b、v$parameter2
c、v$system_parameter
d、v$system_parameter2
e、v$spparameter
a、查看session级别的参数--基于session级别可以直接使用show parameter 方式--演示环境scott@usbo> select * from v$version where rownum show parameter cursor_sharname type value------------------------------------ --------------------------------- ------------------------------cursor_sharing string exactscott@usbo> select name,value,isses_modifiable,issys_modifiable,isinstance_modifiable 2 from v$parameter where name='cursor_sharing';name value isses_modifiabl issys_modifiable isinstance_modi------------------------------ --------------- --------------- --------------------------- ---------------cursor_sharing exact true immediate truescott@usbo> alter session set cursor_sharing='similar'; --->上面的查询可知session级别为true,即可修改session altered.scott@usbo> show parameter cursor_shar -->再次查看,修改已经生效name type value------------------------------------ --------------------------------- ------------------------------cursor_sharing string similarb、查看基于实例级别的参数--基于实例级别的参数需要通过v$system_parameter访问scott@usbo> select name,value from v$system_parameter where name='cursor_sharing';name value------------------------------ ---------------cursor_sharing exact --->可以看到此时的值依旧是exact,并没有受到之前修改的影响scott@usbo> alter system set cursor_sharing='force'; --->将参数cursor_sharing进行基于系统级别进行修改system altered.scott@usbo> show parameter cursor_sharing --->此时可以看到当前session级别该参数从system级别派生name type value------------------------------------ --------------------------------- ------------------------------cursor_sharing string force scott@usbo> alter session set cursor_sharing='exact'; --->再次基于session级别进行修改 session altered.scott@usbo> show parameter cursor_shar --->此时查询到session的值变为exact,那system级别呢?肯定是force,大家自行验证name type value------------------------------------ --------------------------------- ------------------------------cursor_sharing string exact c、演示v$parameter与v$parameter2的差异scott@usbo> show parameter control_files;name type value------------------------------------ --------------------------------- ------------------------------control_files string /u03/database/usbo/oradata/con trol01.ctl, /u03/database/usbo /oradata/control02.ctlscott@usbo> select name,value from v$parameter where name='control_files';name value------------------------------ ------------------------------------------------------------control_files /u03/database/usbo/oradata/control01.ctl, /u03/database/usbo /oradata/control02.ctl--查询v$parameter2时,对于存在多个参数值的参数,在这个视图中分为多行进行列出,如下--对于v$system_parameter与v$system_parameter2存在类似的情形,不再演示scott@usbo> select name,value from v$parameter2 where name='control_files';name value------------------------------ ------------------------------------------------------------control_files /u03/database/usbo/oradata/control01.ctlcontrol_files /u03/database/usbo/oradata/control02.ctld、关于v$spparameter--该视图可以用于判断当前数据库使用的是pfile还是spfile来启动scott@usbo> select distinct isspecified from v$spparameter;isspecified------------------true --->第一个值为true,spfile启动falsegoex_admin@mftst> select distinct isspecified from v$spparameter;isspec------false --->为false,pfile文件启动数据库 goex_admin@mftst> select name,value from v$spparameter where name='control_files'; name value------------------------- ------------------------------------------------------------control_files --->由于为pfile启动,所以查询不到任何信息goex_admin@mftst> select count(*) from v$spparameter where isspecified='true'; count(*)---------- --->列isspecified没有一个值为true,同样是因为使用了pfile 0 对于spfile启动下的v$spparameter,对于存在多个参数值的参数,在这个视图中也分为多行进行列出 scott@usbo> select name,value from v$spparameter where name='control_files';name value------------------------------ ------------------------------------------------------------control_files /u03/database/usbo/oradata/control01.ctlcontrol_files /u03/database/usbo/oradata/control02.ctl
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product