Home Database Mysql Tutorial 【11g体系结构,6】参数文件和一些参数

【11g体系结构,6】参数文件和一些参数

Jun 07, 2016 pm 04:02 PM
Architecture effect parameter document Record

一.参数文件的作用: 参数文件记录了数据库的配置。在数据库启动时,Oracle 要根据参数文件中的参数设置,配置数据库。如要为各个内存池分配多少内存,允许打开的进程数和会话等等。要想让数据库启动,必需先读取参数文件。参数文件中的参数,我们通常称其为

一.参数文件的作用:

参数文件记录了数据库的配置。在数据库启动时,Oracle 要根据参数文件中的参数设置,配置数据库。如要为各个内存池分配多少内存,允许打开的进程数和会话等等。要想让数据库启动,必需先读取参数文件。参数文件中的参数,我们通常称其为初始化参数,简称就是参数。

二.参数文件共有两种参数文件

参数文件包含pfile 和spfile。区别如下:
1.PFILE 为文本文件,可以使用vi编辑器进行修改,可以放在客户端和服务端。 文件名为:init.ora。 从oracle 10g开始就不使用pfile。 oracle 10g默认的pfile的文件放置在:$oracle_home/dbs/init$ORACLE_SID.ora 参数文件的查找原则: spfilesid.ora ,spfile.ora, initsid.ora 修改范围:通过命令只能修改内存(scope=memory),手动修改参数文件。 2.SPFILE 是二进制文件,从oracle9i开始才有,只能放在oracle服务器端,可以被rman备份。 文件名称为:spfile.ora 。 通过命令修改: alter system set parameter_name=values ; spfile存放的位置:$oracle_HOME/dbs/spfile$ORACLE_SID.ora 修改范围:通过命令修改内存和参数文件。
3.oracle 启动要用参数文件的查找顺序: 先找spfile.ora文件,如果没找到就找spfile.ora,如果没找到就找init.ora,如果都没找到就报错了。 从oracle 10g开始就不使用pfile。 4.考试时使用pfile启动哦。
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.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Where can I view the records of things I have purchased on Pinduoduo? How to view the records of purchased products? Where can I view the records of things I have purchased on Pinduoduo? How to view the records of purchased products? Mar 12, 2024 pm 07:20 PM

Pinduoduo software provides a lot of good products, you can buy them anytime and anywhere, and the quality of each product is strictly controlled, every product is genuine, and there are many preferential shopping discounts, allowing everyone to shop online Simply can not stop. Enter your mobile phone number to log in online, add multiple delivery addresses and contact information online, and check the latest logistics trends at any time. Product sections of different categories are open, search and swipe up and down to purchase and place orders, and experience convenience without leaving home. With the online shopping service, you can also view all purchase records, including the goods you have purchased, and receive dozens of shopping red envelopes and coupons for free. Now the editor has provided Pinduoduo users with a detailed online way to view purchased product records. method. 1. Open your phone and click on the Pinduoduo icon.

How to transfer files from Quark Cloud Disk to Baidu Cloud Disk? How to transfer files from Quark Cloud Disk to Baidu Cloud Disk? Mar 14, 2024 pm 02:07 PM

Quark Netdisk and Baidu Netdisk are currently the most commonly used Netdisk software for storing files. If you want to save the files in Quark Netdisk to Baidu Netdisk, how do you do it? In this issue, the editor has compiled the tutorial steps for transferring files from Quark Network Disk computer to Baidu Network Disk. Let’s take a look at how to operate it. How to save Quark network disk files to Baidu network disk? To transfer files from Quark Network Disk to Baidu Network Disk, you first need to download the required files from Quark Network Disk, then select the target folder in the Baidu Network Disk client and open it. Then, drag and drop the files downloaded from Quark Cloud Disk into the folder opened by the Baidu Cloud Disk client, or use the upload function to add the files to Baidu Cloud Disk. Make sure to check whether the file was successfully transferred in Baidu Cloud Disk after the upload is completed. That's it

What to do if the 0x80004005 error code appears. The editor will teach you how to solve the 0x80004005 error code. What to do if the 0x80004005 error code appears. The editor will teach you how to solve the 0x80004005 error code. Mar 21, 2024 pm 09:17 PM

When deleting or decompressing a folder on your computer, sometimes a prompt dialog box "Error 0x80004005: Unspecified Error" will pop up. How should you solve this situation? There are actually many reasons why the error code 0x80004005 is prompted, but most of them are caused by viruses. We can re-register the dll to solve the problem. Below, the editor will explain to you the experience of handling the 0x80004005 error code. Some users are prompted with error code 0X80004005 when using their computers. The 0x80004005 error is mainly caused by the computer not correctly registering certain dynamic link library files, or by a firewall that does not allow HTTPS connections between the computer and the Internet. So how about

What is hiberfil.sys file? Can hiberfil.sys be deleted? What is hiberfil.sys file? Can hiberfil.sys be deleted? Mar 15, 2024 am 09:49 AM

Recently, many netizens have asked the editor, what is the file hiberfil.sys? Can hiberfil.sys take up a lot of C drive space and be deleted? The editor can tell you that the hiberfil.sys file can be deleted. Let’s take a look at the details below. hiberfil.sys is a hidden file in the Windows system and also a system hibernation file. It is usually stored in the root directory of the C drive, and its size is equivalent to the size of the system's installed memory. This file is used when the computer is hibernated and contains the memory data of the current system so that it can be quickly restored to the previous state during recovery. Since its size is equal to the memory capacity, it may take up a larger amount of hard drive space. hiber

Explore the importance and role of define function in PHP Explore the importance and role of define function in PHP Mar 19, 2024 pm 12:12 PM

The importance and role of the define function in PHP 1. Basic introduction to the define function In PHP, the define function is a key function used to define constants. Constants will not change their values ​​during the running of the program. Constants defined using the define function can be accessed throughout the script and are global. 2. The syntax of define function The basic syntax of define function is as follows: define("constant name","constant value&qu

Analysis of the function and principle of nohup Analysis of the function and principle of nohup Mar 25, 2024 pm 03:24 PM

Analysis of the role and principle of nohup In Unix and Unix-like operating systems, nohup is a commonly used command that is used to run commands in the background. Even if the user exits the current session or closes the terminal window, the command can still continue to be executed. In this article, we will analyze the function and principle of the nohup command in detail. 1. The role of nohup: Running commands in the background: Through the nohup command, we can let long-running commands continue to execute in the background without being affected by the user exiting the terminal session. This needs to be run

Detailed explanation of the role of .ibd files in MySQL and related precautions Detailed explanation of the role of .ibd files in MySQL and related precautions Mar 15, 2024 am 08:00 AM

Detailed explanation of the role of .ibd files in MySQL and related precautions MySQL is a popular relational database management system, and the data in the database is stored in different files. Among them, the .ibd file is a data file in the InnoDB storage engine, used to store data and indexes in tables. This article will provide a detailed analysis of the role of the .ibd file in MySQL and provide relevant code examples to help readers better understand. 1. The role of .ibd files: storing data: .ibd files are InnoDB storage

What is PHP used for? Explore the role and functions of PHP What is PHP used for? Explore the role and functions of PHP Mar 24, 2024 am 11:39 AM

PHP is a server-side scripting language widely used in web development. Its main function is to generate dynamic web content. When combined with HTML, it can create rich and colorful web pages. PHP is powerful. It can perform various database operations, file operations, form processing and other tasks, providing powerful interactivity and functionality for websites. In the following articles, we will further explore the role and functions of PHP, with detailed code examples. First, let’s take a look at a common use of PHP: dynamic web page generation: P

See all articles