Oraclev$parameter,v$system_parameter及v$sppar..
时间:2010-12-07 来源:ank
Oracle9i引入spfile后,许多参数可以动态的修改而不必重启数据库了,对DBA来说,这是天大的好事。
v$parameter显示的是session级的参数,也就是当前session的参数信息。如果没有使用alter session单独设置当前session的参数值,那么默认和system级的参数应该是一样的。
v$system_parameter显示的是system级的参数,保存的是使用alter system修改的值(scope=both或者scope=memory)。
上面两个都是当前已经生效的参数值。对于使用spfile的库,也可以暂时只修改spfile中的值。v$spparameter显示的就是保存在spfile中的参数值(scope=spfile)。
1.原来的值: SQL> show parameter db_file_multiblock_read_count NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_multiblock_read_count integer 32 2.alter session修改 SQL> alter session set db_file_multiblock_read_count=16; 会话已更改。 本会话中查询 SQL> select name,value from v$parameter where name='db_file_multiblock_read_count'; NAME VALUE
------------------------------ ------------------------------
db_file_multiblock_read_count 16 SQL> select name,value from v$system_parameter where name='db_file_multiblock_read_count'; NAME VALUE
------------------------------ ------------------------------
db_file_multiblock_read_count 32 在另外一个会话中查询 SQL> select name,value from v$parameter where name='db_file_multiblock_read_count'; NAME VALUE
------------------------------ --------------------
db_file_multiblock_read_count 32 3.alter system修改 SQL> alter system set db_file_multiblock_read_count=8; 系统已更改。 本会话中查询 SQL> select name,value from v$parameter where name='db_file_multiblock_read_count'; NAME VALUE
------------------------------ ------------------------------
db_file_multiblock_read_count 8 SQL> select name,value from v$system_parameter where name='db_file_multiblock_read_count'; NAME VALUE
------------------------------ ------------------------------
db_file_multiblock_read_count 8 3.只修改spfile中的值 SQL> alter system set db_file_multiblock_read_count=64 scope=spfile; 系统已更改。 SQL> select name,value from v$parameter where name='db_file_multiblock_read_count'; NAME VALUE
------------------------------ ------------------------------
db_file_multiblock_read_count 8 SQL> select name,value from v$system_parameter where name='db_file_multiblock_read_count'; NAME VALUE
------------------------------ ------------------------------
db_file_multiblock_read_count 8 SQL> select name,value from v$spparameter where name='db_file_multiblock_read_count'; NAME VALUE
------------------------------ ------------------------------
db_file_multiblock_read_count 64 另外还有v$parameter2和v$system_parameter2,这两个和v$parameter,v$system_parameter的区别在于,对一些有多个值的参数,前者分成多条记录,后者这是一条记录: SQL> select name,value from v$parameter where name='control_files'; NAME VALUE
------------------------------ ----------------------------------------
control_files D:ORACLEORADATANINGOOCONTROL01.CTL,
D:ORACLEORADATANINGOOCONTROL02.CTL,
D:ORACLEORADATANINGOOCONTROL03.CTL
已选择 1 行。 SQL> select name,value from v$parameter2 where name='control_files'; NAME VALUE
------------------------------ ----------------------------------------
control_files D:ORACLEORADATANINGOOCONTROL01.CTL
control_files D:ORACLEORADATANINGOOCONTROL02.CTL
control_files D:ORACLEORADATANINGOOCONTROL03.CTL 已选择3行。 通过sql_trace发现,sqlplus中的show parameter其实查询的是v$parameter,实际的查询语句如下: SELECT NAME NAME_COL_PLUS_SHOW_PARAM, DECODE(TYPE,1,'boolean',2,'string',3,'integer',4,'file',5,'number', 6,'big integer', 'unknown') TYPE, DISPLAY_VALUE VALUE_COL_PLUS_SHOW_PARAM FROM V$PARAMETER WHERE UPPER(NAME) LIKE UPPER('%db_file%') ORDER BY NAME_COL_PLUS_SHOW_PARAM,ROWNUM 通过autotrace,我们可以知道: v$parameter,v$system_parameter的底层表是x$ksppcv和x$ksppi v$parameter2,v$system_parameter2的底层表是x$ksppcv2和x$ksppi v$spparameter的底层表是x$kspspfile
转载: http://ningoo.itpub.net/post/2149/229919
1.原来的值: SQL> show parameter db_file_multiblock_read_count NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_multiblock_read_count integer 32 2.alter session修改 SQL> alter session set db_file_multiblock_read_count=16; 会话已更改。 本会话中查询 SQL> select name,value from v$parameter where name='db_file_multiblock_read_count'; NAME VALUE
------------------------------ ------------------------------
db_file_multiblock_read_count 16 SQL> select name,value from v$system_parameter where name='db_file_multiblock_read_count'; NAME VALUE
------------------------------ ------------------------------
db_file_multiblock_read_count 32 在另外一个会话中查询 SQL> select name,value from v$parameter where name='db_file_multiblock_read_count'; NAME VALUE
------------------------------ --------------------
db_file_multiblock_read_count 32 3.alter system修改 SQL> alter system set db_file_multiblock_read_count=8; 系统已更改。 本会话中查询 SQL> select name,value from v$parameter where name='db_file_multiblock_read_count'; NAME VALUE
------------------------------ ------------------------------
db_file_multiblock_read_count 8 SQL> select name,value from v$system_parameter where name='db_file_multiblock_read_count'; NAME VALUE
------------------------------ ------------------------------
db_file_multiblock_read_count 8 3.只修改spfile中的值 SQL> alter system set db_file_multiblock_read_count=64 scope=spfile; 系统已更改。 SQL> select name,value from v$parameter where name='db_file_multiblock_read_count'; NAME VALUE
------------------------------ ------------------------------
db_file_multiblock_read_count 8 SQL> select name,value from v$system_parameter where name='db_file_multiblock_read_count'; NAME VALUE
------------------------------ ------------------------------
db_file_multiblock_read_count 8 SQL> select name,value from v$spparameter where name='db_file_multiblock_read_count'; NAME VALUE
------------------------------ ------------------------------
db_file_multiblock_read_count 64 另外还有v$parameter2和v$system_parameter2,这两个和v$parameter,v$system_parameter的区别在于,对一些有多个值的参数,前者分成多条记录,后者这是一条记录: SQL> select name,value from v$parameter where name='control_files'; NAME VALUE
------------------------------ ----------------------------------------
control_files D:ORACLEORADATANINGOOCONTROL01.CTL,
D:ORACLEORADATANINGOOCONTROL02.CTL,
D:ORACLEORADATANINGOOCONTROL03.CTL
已选择 1 行。 SQL> select name,value from v$parameter2 where name='control_files'; NAME VALUE
------------------------------ ----------------------------------------
control_files D:ORACLEORADATANINGOOCONTROL01.CTL
control_files D:ORACLEORADATANINGOOCONTROL02.CTL
control_files D:ORACLEORADATANINGOOCONTROL03.CTL 已选择3行。 通过sql_trace发现,sqlplus中的show parameter其实查询的是v$parameter,实际的查询语句如下: SELECT NAME NAME_COL_PLUS_SHOW_PARAM, DECODE(TYPE,1,'boolean',2,'string',3,'integer',4,'file',5,'number', 6,'big integer', 'unknown') TYPE, DISPLAY_VALUE VALUE_COL_PLUS_SHOW_PARAM FROM V$PARAMETER WHERE UPPER(NAME) LIKE UPPER('%db_file%') ORDER BY NAME_COL_PLUS_SHOW_PARAM,ROWNUM 通过autotrace,我们可以知道: v$parameter,v$system_parameter的底层表是x$ksppcv和x$ksppi v$parameter2,v$system_parameter2的底层表是x$ksppcv2和x$ksppi v$spparameter的底层表是x$kspspfile
转载: http://ningoo.itpub.net/post/2149/229919
相关阅读 更多 +