【11g体系结构,6】参数文件和一些参数
一.参数文件的作用: 参数文件记录了数据库的配置。在数据库启动时,Oracle 要根据参数文件中的参数设置,配置数据库。如要为各个内存池分配多少内存,允许打开的进程数和会话等等。要想让数据库启动,必需先读取参数文件。参数文件中的参数,我们通常称其为
一.参数文件的作用:
参数文件记录了数据库的配置。在数据库启动时,Oracle 要根据参数文件中的参数设置,配置数据库。如要为各个内存池分配多少内存,允许打开的进程数和会话等等。要想让数据库启动,必需先读取参数文件。参数文件中的参数,我们通常称其为初始化参数,简称就是参数。
二.参数文件共有两种参数文件
参数文件包含pfile 和spfile。区别如下:
1.PFILE 为文本文件,可以使用vi编辑器进行修改,可以放在客户端和服务端。 文件名为:init
3.oracle 启动要用参数文件的查找顺序: 先找spfile
5.参数文件在文档中的位置:
oracle 10g: 在 Administration -> Monitoring (里面有个initialization parameters) oracle 11g:Database Administration->Supporting Documentation->Reference-> 1 Initialization Parameters
三.参数文件的转换:
从oracle 10个默认都使用spfile文件。 1. spfile转成pfile: SQL> create pfile from spfile。 会在$ORACLE_HOME/dbs/init$ORACLE_SID.ora文件 或指定路径 SQL> create pfile=“---” from spfile;
2.pfile 转成spfile SQL> create spfile from pfile #当数据库使用spfile启动时,该转化会失败,因为spfile正在使用。 SQL> create spfile from pfile="---";
3.oracle 11g 可以使用内存生成spfile文件。 SQL> create spfile=“---” from memory;
四.查看当前数据库使用的参数文件是哪一个:
1.查询V$spparameter视图。 SQL> select distinct ISSPECIFIED from v$spparameter;
ISSPEC ------ TRUE FALSE
看查询结果的第一个值,为false 则使用pfile。为true 则使用spfile。 当有多个值的时候,说明pfile是存在的。
2.修改参数判断: 执行alter system set sga_target=200m scope=spfile,如果可以修改,表示是使用spfile,不能修改是使用pfile。
3.查看参数spfile(较实用)
当VALUE有值时,表示用spfile启动的,value没有值时用pfile启动的 SQL> show parameter spfile;
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string /u01/app/oracle/11.2.0/db_home _1/dbs/spfileorcl.ora
五.修改参数文件:
1.如果启动使用pfile 直接编辑,下次启动生效。 使用pfile 启动数据库: SQL> startup pfile="pfile路径";
2.如果启动使用spfile: ①.修改指令:alter system set parametername=values scope=memory|spfile|bothsid='sid'|'*' scope取值:memory:只对当前instance内存有效,下次启动无效。 spfile:只对spfile修改,必须下次启动才生效,当前实例内存没有修改。 both:是scope的默认值,内存和spfile都被修改。
②.alter session set parametername= value; 只对当前session生效。
③.system|session的区别: 查询v$parameter视图, isses_modifiable =true 可以被alter session修改。 issys_modifiable =immediate/DEFERRED 可以被alter system修改(详见七). --查看视图 SQL> desc v$parameter;
Name Null? Type----------------------------------------- -------- ----------------------------NUM NUMBERNAME VARCHAR2(80)TYPE NUMBERVALUE VARCHAR2(512)DISPLAY_VALUE VARCHAR2(512)ISDEFAULT VARCHAR2(9)ISSES_MODIFIABLE VARCHAR2(5)ISSYS_MODIFIABLE VARCHAR2(9)ISINSTANCE_MODIFIABLE VARCHAR2(5)ISMODIFIED VARCHAR2(10)ISADJUSTED VARCHAR2(5)ISDEPRECATED VARCHAR2(5)DESCRIPTION VARCHAR2(255)UPDATE_COMMENT VARCHAR2(255)HASH NUMBER
sid 取值:适用于RAC集群环境 sid:表示修改当前实例。 *: 表示修改所有实例。
六.修改参数:
1.修改sga_target
--查看参数 SQL> show parameter sga_
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ sga_max_size big integer 160M sga_target big integer 160M --修改参数值,下次启动生效: SQL> alter system set sga_max_size=200m scope=spfile;
System altered.
--在集群条件下要指定sid SQL> alter system set sga_max_size=200m scope=spfile sid='orcl';
2.修改pga --查看pga大小 SQL> show parameter pga
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ pga_aggregate_target big integer 16M --修改当前内存中的pga大小,不修改spfile中的 SQL> alter system set pga_aggregate_target=20m scope=memory;
七.v$parameter 视图中 issys_modifiable 取值的意思:(静态参数与动态参数)
SQL> select distinct issys_modifiable from v$parameter;
ISSYS_MOD --------- IMMEDIATE FALSE DEFERRED
IMMEDIATE: 表示动态参数,直接修改到参数文件和内存的参数,立即成效,alter system set =; false: 表示静态参数, 不能直接修改到内存,只能通过,alter system set = scope=spfile 下次启动数据库生效。 deferred: 延迟生效,后续新的session中有效(不考虑是否用pfile或spfile启动)。 alter system set = ;
八.oracle 10g系统常用的参数:查看pfile文件 initorcl.ora
警告日志 *.audit_file_dest='/opt/oracle/102/admin/orcl/adump' 后台进程日志 *.background_dump_dest='/opt/oracle/102/admin/orcl/bdump' 版本兼容号,往后兼容不往前兼容。 *.compatible='10.2.0.1.0' 定义控制文件 *.control_files='/opt/oracle/oradata/orcl/control01.ctl','/opt/oracle/oradata/orcl/control02.ctl','/opt/oracle/oradata/orcl/control03.ctl' 服务器进程的日志 *.core_dump_dest='/opt/oracle/102/admin/orcl/cdump' 内存块的大小 (8k) *.db_block_size=8192 域名后缀 *.db_domain='' 指定一次性读取多少个块 *.db_file_multiblock_read_count=16
*.db_name='orcl' 系统当中的一些日志存放的路径,叫闪回区。 *.db_recovery_file_dest='/opt/oracle/102/flash_recovery_area' #闪回区大小 *.db_recovery_file_dest_size=2147483648 共享服务器配置参数 *.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)' 作业进程数 *.job_queue_processes=10 打开游标的个数 *.open_cursors=300 pga大小 *.pga_aggregate_target=16777216 定义当前系统可以运行150个进程 *.processes=150 远程登录的用户要不要用密码文件验证 *.remote_login_passwordfile='EXCLUSIVE' sga大小 *.sga_target=167772160 undo表空间的管理方式为自动管理,还可以取值manual, *.undo_management='AUTO' 指定使用undo表空间 *.undo_tablespace='UNDOTBS1' 指定调试跟踪文件的目录 *.user_dump_dest='/opt/oracle/102/admin/orcl/udump'
九.静态参数和动态参数:
动态参数:修改动态参数不用重启数据库即可生效。 文档中Modifiable对应的值为ALTER SYSTEM表示该参数为动态参数
静态参数: 修改静态参数需要重启数据库才能生效。 文档中Modifiable对应的值为NO表示该参数为静态参数
#spfile启动数据库时,修改静态参数,不能修改内存中的值,只能修改spfile,重启数据库才生效。 SQL> alter system set sga_max_size=500m scope=both; alter system set sga_max_size=500m * ERROR at line 1: ORA-02095: specified initialization parameter cannot be modified
SQL> alter system set sga_max_size=500m scope=spfile; System altered.
九.隐藏参数:
SQL> desc x$ksppi Name Null? Type ----------------------------------------- -------- ---------------------------- ADDR RAW(4) INDX NUMBER INST_ID NUMBER KSPPINM VARCHAR2(80) KSPPITY NUMBER KSPPDESC VARCHAR2(255) KSPPIFLG NUMBER KSPPILRMFLG NUMBER KSPPIHASH NUMBER
SQL> desc x$ksppcv Name Null? Type ----------------------------------------- -------- ---------------------------- ADDR RAW(4) INDX NUMBER INST_ID NUMBER KSPPSTVL VARCHAR2(512) KSPPSTDVL VARCHAR2(512) KSPPSTDF VARCHAR2(9) KSPPSTVF NUMBER KSPPSTCMNT VARCHAR2(255)
--查找隐藏参数: SQL> select ksppinm,ksppstvl from x$ksppi a,x$ksppcv b where a.indx=b.indx
十.删除参数,使参数变为默认值:
1.pfile参数的删除:直接修改文本。 2.删除spfile的参数:要带上scope=spfile sid='*',才能删除掉。 SQL> alter system reset pga_aggregate_target scope=spfile sid='*';
十一.事件参数: (优化的时候讨论)
alter session set events '';
十二.总结遇到的初始化参数:
1.filesystemio_options :
2.SEC_PROTOCOL_ERROR_FURTHER_ACTION
SEC_PROTOCOL_ERROR_FURTHER_ACTION specifies the further execution of a server process when receiving bad packets from a possibly malicious client.
Values:
CONTINUE
The server process continues execution. The database server may be subject to a Denial of Service (DoS) if bad packets continue to be sent by a malicious client.
(DELAY,integer)
The client experiences a delay of integer seconds before the server process accepts the next request from the same client connection. Malicious clients are prevented from excessive consumption of server resources while legitimate clients experience a degradation in performance but can continue to function.
(DROP,integer)
The server forcefully terminates the client connection after integer cumulative bad packets. The server protects itself at the expense of the client (for example, a client transaction may be lost). The client may reconnect and attempt the same operation.
来源:
3.DB_ULTRA_SAFE (11g新参数)
Purpose
The purpose of this article is to cover the new parameter DB_ULTRA_SAFE which is a new parameter introduced in 11g.
Through the creation of a new initialization parameter, DB_ULTRA_SAFE={off, data_only, data_and_index}, this capability provides an integrated mechanism to offer protection from various possible data corruptions that may impact Oracle Database. This feature improves the data protection capabilities of Oracle Database by offering an integrated mechanism to control various levels of protection from data corruptions. By making it possible to detect data corruptions in a timely manner, this feature also provides critical high availability benefits for Oracle Database.
New Parameter DB_ULTRA_SAFE introduce In 11g
Set DB_ULTRA_SAFE initialization parameter to automatically configure the appropriate data protection block checking level in the database.
Controls the setting of other related initialization parameters, including DB_BLOCK_CHECKING, DB_BLOCK_CHECKSUM, and DB_LOST_WRITE_PROTECT.
Different values that can be set for this parameter are
DB_ULTRA_SAFE = { OFF | DATA_ONLY | DATA_AND_INDEX }
By default its OFF.
Description of these values are given below
Values:
+ OFF
When any of DB_BLOCK_CHECKING, DB_BLOCK_CHECKSUM, or
DB_LOST_WRITE_PROTECT are explicitly set, no changes are made.
+ DATA_ONLY
DB_BLOCK_CHECKING will be set to MEDIUM.
DB_LOST_WRITE_PROTECT will be set to TYPICAL.
DB_BLOCK_CHECKSUM will be set to FULL.
+ DATA_AND_INDEX
DB_BLOCK_CHECKING will be set to FULL.
DB_LOST_WRITE_PROTECT will be set to TYPICAL.
DB_BLOCK_CHECKSUM will be set to FULL.
This parameter cannot be changed dynamically .
For example :
alter system set db_ultra_safe=data_only scope=spfile;
Restart the database for the new change to come into effect
来源:
4.log_archive_format:
LOG_ARCHIVE_FORMAT is applicable only if you are using the redo log in ARCHIVELOG mode. Use a text string and variables to specify the default filename format when archiving redo log files. The string generated from this format is appended to the string specified in the LOG_ARCHIVE_DEST parameter.
The following variables can be used in the format:
%s log sequence number
%S log sequence number, zero filled
%tthread number
%Tthread number, zero filled
%a activation ID
%d database ID
%r resetlogs ID that ensures unique names are constructed for the archived log files across multiple incarnations of the database
Using uppercase letters for the variables (for example, %S) causes the value to be fixed length and padded to the left with zeros. An example of specifying the archive redo log filename format follows:
LOG_ARCHIVE_FORMAT = 'log%t_%s_%r.arc'
Neither LOG_ARCHIVE_DEST nor LOG_ARCHIVE_FORMAT have to be complete file or directory specifiers themselves; they only need to form a valid file path after the variables are substituted into LOG_ARCHIVE_FORMAT and the two parameters are concatenated together.
来源:
5.SEC_MAX_FAILED_LOGIN_ATTEMPTS
You can limit the number of failed login attempts for application connections by setting the SEC_MAX_FAILED_LOGIN_ATTEMPTS initialization parameter to restrict the number of authentication attempts on a connection. After the specified number of authentication attempts fail, the database process drops the connection. By default, SEC_MAX_FAILED_LOGIN_ATTEMPTS is set to 10.
Remember that the SEC_MAX_FAILED_LOGIN_ATTEMPTS initialization parameter is designed to prevent potential intruders from attacking your applications; it does not apply to valid users. The sqlnet.ora INBOUND_CONNECT_TIMEOUT parameter and the FAILED_LOGIN_ATTEMPTS initialization parameter also restrict failed logins, but the difference is that these two parameters only apply to valid user accounts.

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

拼多多软件内提供的商品好物非常多,随时随地想买就买,而且每一件商品质量都是严格把关的,件件商品都是正品,不同还有非常多优惠的购物折扣,让大家网购根本停不下来。输入手机号在线登录,在线添加多个收货地址和联系方式,可以随时查看最新的物流动态,不同品类的商品板块都是开放的,搜索上下滑动选购下单,足不出户轻松体验便捷的网购服务,还能查看所有的购买记录,包括自己买过的商品,数十个购物红包、优惠券免费领取使用,现在小编在线详细为拼多多用户们带来查看买过的商品记录的方法。 1.打开手机,点击拼多多图标,

在电脑中删除或解压缩文件夹,时有时候会弹出提示对话框“错误0x80004005:未指定错误”,如果遇到这中情况应该怎么解决呢?提示错误代码0x80004005的原因其实有很多,但大部分因为病毒导致,我们可以重新注册dll来解决问题,下面,小编给大伙讲解0x80004005错误代码处理经验。有用户在使用电脑时出现错误代码0X80004005的提示,0x80004005错误主要是由于计算机没有正确注册某些动态链接库文件,或者计算机与Internet之间存在不允许的HTTPS连接防火墙所引起。那么如何

夸克网盘和百度网盘都是现在最常用的储存文件的网盘软件,如果想要将夸克网盘内的文件保存到百度网盘,要怎么操作呢?本期小编整理了夸克网盘电脑端的文件转移到百度网盘的教程步骤,一起来看看是怎么操作吧。 夸克网盘的文件怎么保存到百度网盘?要将夸克网盘的文件转移到百度网盘,首先需在夸克网盘下载所需文件,然后在百度网盘客户端中选择目标文件夹并打开。接着,将夸克网盘中下载的文件拖放到百度网盘客户端打开的文件夹中,或者使用上传功能将文件添加至百度网盘。确保上传完成后在百度网盘中查看文件是否成功转移。这样就

nohup的作用及原理解析在Unix和类Unix操作系统中,nohup是一个常用的命令,用于在后台运行命令,即便用户退出当前会话或关闭终端窗口,命令仍然能够继续执行。在本文中,我们将详细解析nohup命令的作用和原理。一、nohup的作用后台运行命令:通过nohup命令,我们可以让需要长时间运行的命令在后台持续执行,而不受用户退出终端会话的影响。这在需要运行

最近有很多网友问小编,hiberfil.sys是什么文件?hiberfil.sys占用了大量的C盘空间可以删除吗?小编可以告诉大家hiberfil.sys文件是可以删除的。下面就来看看详细的内容。hiberfil.sys是Windows系统中的一个隐藏文件,也是系统休眠文件。通常存储在C盘根目录下,其大小与系统安装内存大小相当。这个文件在计算机休眠时被使用,其中包含了当前系统的内存数据,以便在恢复时快速恢复到之前的状态。由于其大小与内存容量相等,因此它可能会占用较大的硬盘空间。 hiber

PHP中define函数的重要性与作用1.define函数的基本介绍在PHP中,define函数是用来定义常量的关键函数,常量在程序运行过程中不会改变其值。利用define函数定义的常量,在整个脚本中均可被访问,具有全局性。2.define函数的语法define函数的基本语法如下:define("常量名称","常量值&qu

C++参数类型安全检查通过编译时检查、运行时检查和静态断言确保函数只接受预期类型的值,防止意外行为和程序崩溃:编译时类型检查:编译器检查类型相容性。运行时类型检查:使用dynamic_cast检查类型相容性,不匹配则抛出异常。静态断言:在编译时对类型条件进行断言。

MySQL中.ibd文件的作用详解及相关注意事项MySQL是一种流行的关系型数据库管理系统,数据库中的数据存储在不同的文件中。其中,.ibd文件是InnoDB存储引擎中的数据文件,用于存储表中的数据和索引。本文将对MySQL中.ibd文件的作用进行详细解析,并提供相关代码示例以帮助读者更好地理解。一、.ibd文件的作用:存储数据:.ibd文件是InnoDB存
