ITPub博客

首页 > 数据库 > Oracle > 基于oracle 11.2.0.4如何获取变更或修改后的所有数据库参数信息

基于oracle 11.2.0.4如何获取变更或修改后的所有数据库参数信息

原创 Oracle 作者:wisdomone1 时间:2017-05-27 11:10:57 0 删除 编辑
分析结论
1,基于oracle 11.2.0.4之数据库变更过的数据库参数(包括隐含参数和非隐含参数),会体现在数据库告警日志启动信息中


2,提示信息如下
System parameters with non-default values


3,也可以通过数据库spfile获取上述同样的功能


分析明细
1,操作系统版本
[oracle@mygirl ~]$ more /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.5 (Santiago)


2,数据库版本
SQL> select * from v$version where rownum=1;


BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production


3,非隐含参数共计 352个
SQL> select count(*) from v$parameter;


  COUNT(*)
----------
       352




所有的参数共计 2914个
SQL> select 
  2  count(ksppinm),count(distinct ksppinm)
  3    from x$ksppi x, x$ksppcv y
  4   where (x.indx = y.indx);


COUNT(KSPPINM) COUNT(DISTINCTKSPPINM)
-------------- ----------------------
          2914                   2914             




4,启动数据库查看告警日志,未修改数据库参数前的数据库启动信息,由告警日志会有提示信息 System parameters with non-default values
SQL> startup
ORACLE instance started.


Total System Global Area  526110720 bytes
Fixed Size                  2254864 bytes
Variable Size             381683696 bytes
Database Buffers          138412032 bytes
Redo Buffers                3760128 bytes
Database mounted.
Database opened.
SQL> 


[oracle@mygirl ~]$ cd /oracle/diag/rdbms/other/other/trace/
[oracle@mygirl trace]$ tail -f alert_other.log 


SYS auditing is disabled
Starting up:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options.
ORACLE_HOME = /oracle/product/11.2.0/db_1
System name:    Linux
Node name:      mygirl
Release:        2.6.32-431.el6.x86_64
Version:        #1 SMP Sun Nov 10 22:19:54 EST 2013
Machine:        x86_64
Using parameter settings in server-side spfile /oracle/product/11.2.0/db_1/dbs/spfileother.ora
System parameters with non-default values:
  processes                = 150
  memory_target            = 504M
  control_files            = "/oracle/mygirl/other/control01.ctl"
  control_files            = "/oracle/fast_recovery_area/other/control02.ctl"
  db_block_size            = 8192
  compatible               = "11.2.0.4.0"
  db_recovery_file_dest    = "/oracle/fast_recovery_area"
  db_recovery_file_dest_size= 4977M
  undo_tablespace          = "UNDOTBS1"
  remote_login_passwordfile= "EXCLUSIVE"
  db_domain                = ""
  dispatchers              = "(PROTOCOL=TCP) (SERVICE=otherXDB)"
  audit_file_dest          = "/oracle/admin/other/adump"
  audit_trail              = "NONE"
  db_name                  = "other"
  open_cursors             = 300
  diagnostic_dest          = "/oracle"




5,修改隐含参数及非隐含参数
SQL> select 
  2         x.inst_id as inst_id,
  3         ksppinm as name,
  4         ksppstvl as value_1,
  5         ksppdesc as desc_1
  6    from x$ksppi x, x$ksppcv y
  7   where (x.indx = y.indx) and
  8         lower(x.ksppinm) like '%_optimizer_autostats_job%'; 


   INST_ID NAME                           VALUE_1                                            DESC_1
---------- ------------------------------ -------------------------------------------------- --------------------------------------------------
         1 _optimizer_autostats_job       TRUE                                               enable/disable auto stats collection job




SQL> alter system set "_optimizer_autostats_job"=false scope=spfile;


System altered.


SQL> show parameter db_cache


NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_cache_advice                      string      ON
db_cache_size                        big integer 0


SQL> alter system set db_cache_size=150m;


System altered.


6,调整数据库参数后的数据库启动告警日志信息
Using parameter settings in server-side spfile /oracle/product/11.2.0/db_1/dbs/spfileother.ora
System parameters with non-default values:
  processes                = 150
  memory_target            = 504M
  control_files            = "/oracle/mygirl/other/control01.ctl"
  control_files            = "/oracle/fast_recovery_area/other/control02.ctl"
  db_block_size            = 8192
  db_cache_size            = 152M
  compatible               = "11.2.0.4.0"
  db_recovery_file_dest    = "/oracle/fast_recovery_area"
  db_recovery_file_dest_size= 4977M
  undo_tablespace          = "UNDOTBS1"
  remote_login_passwordfile= "EXCLUSIVE"
  db_domain                = ""
  dispatchers              = "(PROTOCOL=TCP) (SERVICE=otherXDB)"
  audit_file_dest          = "/oracle/admin/other/adump"
  audit_trail              = "NONE"
  db_name                  = "other"
  open_cursors             = 300
  _optimizer_autostats_job = FALSE
  diagnostic_dest          = "/oracle"




7,如果数据库已经运行了许久,可能是几年,数据库告警日志的数据库启动信息可能已截断或清除,该怎么办呢,查看数据库SPFILE,可见数据库所有变更的参数全部存在在spfile
SQL> show parameter spfile


NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /oracle/product/11.2.0/db_1/db
                                                 s/spfileother.ora






[oracle@mygirl ~]$ cd $ORACLE_HOME/dbs
[oracle@mygirl dbs]$ strings spfileother.ora >all.ora


[oracle@mygirl dbs]$ more all.ora 
other.__db_cache_size=276824064
other.__java_pool_size=4194304
other.__large_pool_size=8388608
other.__oracle_base='/oracle'#ORACLE_BASE set from environment
other.__pga_aggregate_target=125829120
other.__sga_target=402653184
other.__shared_io_pool_size=0
other.__shared_pool_size=104857600
other.__streams_pool_size=0
*._optimizer_autostats_job=FALSE
*.audit_file_dest='/oracle/admin/other/adump'
*.audit_trail='none'
*.compatible='11.2.0.4.0'
*.control_files='/oracle/mygirl/other/contr
ol01.ctl','/oracle/fast_recovery_area/other/control02.ctl'
*.db_block_size=8192
*.db_cache_size=159383552
*.db_domain=''
*.db_name='other'
*.db_recovery_file_dest='/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=5218762752
*.diagnostic_dest='/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=otherXDB)'
*.memory_target=525336576
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'                                                 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-2139975/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
提供针对oracle初学者及进阶的数据库培训,欢迎大家咨询: 微信: wisdomone 微信公众号: lovedb 工作经历: 中国普天 北京科蓝 北京云和恩墨 北京神州新桥

注册时间:2008-04-04

  • 博文量
    2189
  • 访问量
    12689906