oracle parameter management

Parameter file:

$ ls $ ORACLE_HOME / dbs / spfileorcl.ora
Insert picture description here
The prefix in front of the asterisk:
single-instance setting is meaningless. It makes sense to treat RAC as a normal parameter. Different instances can load their own parameters.

--查看 内存中 参数
select name ,value from v$parameter where name= 'processes';
show parameter processes 

-- 查看参数文件里面的值
select name,value from v$spparameter where name='processes';


动态参数:修改后时时生效
alter system set resource_limit =true;
静态参数:只记录在参数文件中下次重启生效
alter system set processes=300 scope=spfile;

SCOPE = SPFILE	修改静态参数,重启后生效
SCOPE = MEMORY	修改动态参数,立即生效。
SCOPE = BOTH	修改动态参数,立即生效,更改将应用于服务器参数文件和内存中(默认)

session级别修改参数(只影响当前会话,不影响系统):
ALTER SESSION SET NLS_DATE_FORMAT = 'yyyy-mm-dd hh24:mi:ss';
pfile/spfile格式转换:
create pfile='/home/oracle/initorcl.ora' from spfile;
create spfile from pfile='/home/oracle/initorcl.ora';
指定参数文件启动数据库:
SQL> startup pfile='/home/oracle/initorcl.ora'
还原修改 
SQL>ALTER SYSTEM RESET ... SCOPE=SPFILE

Basic parameters:
The following is a list of the database basic initialization parameters. Most databases should only need to have basic parameters set to run properly and efficiently. Oracle advises you to become familiar with the basic parameters and only use other parameters when directed to by feature documentation or in special circumstances :( basic parameters 27)
CLUSTER_DATABASE Oracle RAC is a parameter that specifies whether to enable the Oracle RAC
Insert picture description here
associated cluster_database_instances parameter specifies a part of the configuration of the cluster of instances of the database
cOMPATIBLE
specified Oracle must maintain compatibility parameter The version of
CONTROL_FILES
DB_BLOCK_SIZE
DB_CREATE_FILE_DEST
specifies the default location of data files managed by Oracle. If DB_CREATE_ONLINE_LOG_DEST_n does not specify any initialization parameters, this location is also used as the default location for Oracle-managed control files and online redo logs. If the file system directory is specified as the default location, the directory must already exist; Oracle does not create it.
DB_CREATE_ONLINE_LOG_DEST_n
(Where n = 1, 2, 3, ... 5) Specify the default location of the control files and online redo logs managed by Oracle. If the file system directory is specified as the default location, the directory must already exist; Oracle does not create it.
DB_DOMAIN
DB_NAME
DB_RECOVERY_FILE_DEST
specify the default location fast recovery area, specify this parameter must specify the size
DB_RECOVERY_FILE_DEST_SIZE
target database created in the Flash Recovery Area to restore the file you want to use the total space of
the DB_UNIQUE_NAME
INSTANCE_NUMBER
LDAP_DIRECTORY_SYSAUTH
the Enables or disables Directory-based the Authorization for SYSDBA and SYSOPER.
The LOG_ARCHIVE_DEST_ n
LOG_ARCHIVE_DEST_STATE_n
NLS_LANGUAGE
sets the default language of the database. The default AMERICAN
NLS_TERRITORY
sets the name of the region that follows the convention in the date and week number. Default AMERICAN
This parameter also establishes the default date format, default decimal characters and group separators, and the default ISO and local currency symbols.
OPEN_CURSORS
specifies the maximum number of cursors that a session can open at one time (default 50)
PGA_AGGREGATE_TARGET
Insert picture description here
[The following description seems useless]
Setting it to a non-zero value will automatically set the WORKAREA_SIZE_POLICY parameter to AUTO.
Setting it to 0 will automatically set the WORKAREA_SIZE_POLICY parameter to MANUAL, which means that the SQL workspace uses the * _AREA_SIZE parameter to determine the size.
WORKAREA_SIZE_POLICY (default auto)
specifies the strategy for adjusting the work area. The work area used by
AUTO
memory-intensive operations will automatically adjust the size according to the PGA memory used by the system, the set target PGA memory PGA_AGGREGATE_TARGET, and the requirements of each operation. The size of the
MANUAL
work area is manual, and based on the value of the * parameter corresponding to the operation of _AREA_SIZE, specifying MANUAL may result in suboptimal performance and poor PGA memory usage.

SQL> show parameter AREA_SIZE;
NAME             TYPE   VALUE
------------------------------------ ----------- -------
bitmap_merge_area_size         integer   1048576
create_bitmap_area_size        integer   8388608
hash_area_size           integer   131072
sort_area_size           integer   65536
workarea_size_policy         string   AUTO

MEMORY_TARGET
Insert picture description here
specifies the available system-wide memory of Oracle. It should be set to be higher than or equal to the sum of the current sizes of SGA and PGA. Default = MEMORY_MAX_TARGET. You can dynamically change MEMORY_TARGET to a non-zero value, provided that it does not exceed the value MEMORY_MAX_TARGET.
MEMORY_MAX_TARGET
PROCESSES
specifies the maximum number of operating system user processes that can simultaneously connect to Oracle. The default values ​​of the SESSIONS and TRANSACTIONS parameters are derived from this parameter. Therefore, if you change the value PROCESSES, you should evaluate whether to adjust the values ​​of these derived parameters [a session can have multiple processes; but a process can only belong to one session;]
Transactions (default 3300) = 1.1 * sessions sessions = (1.5 * PROCESSES) + 22

REMOTE_LISTENER
REMOTE_LOGIN_PASSWORDFILE
SESSIONS
Insert picture description here
In a shared server environment, the value PROCESSES may be very small. Therefore, Oracle recommends that you adjust the value of SESSIONS to approximately 1.1 * the total number of connections.
SGA_TARGET
If SGA_TARGET is specified, the following memory pools will be automatically resized:
buffer cache (DB_CACHE_SIZE)
shared pool (SHARED_POOL_SIZE)
large pool (LARGE_POOL_SIZE)
Java pool (JAVA_POOL_SIZE)
stream pool (STREAMS_POOL_SIZE)
if these automatically adjusted memory pools are set to nonzero Value, then these values ​​will be used as the minimum level of automatic shared memory management.
SHARED_SERVERS
SHARED_SERVERS specifies the number of server processes to be created when the instance is started. If the system load decreases, keep this minimum number of servers. Therefore, you should be careful not to set SHARED_SERVERS too high at system startup.
STAR_TRANSFORMATION_ENABLED
UNDO_TABLESPACE
common parameters
Audit related

SQL> show parameter audit;
audit_file_dest       
audit_sys_operations  
audit_syslog_level 
audit_trail  

Insert picture description here
Track warning log

SQL> show parameter background_dump_dest;

Insert picture description here
Fast recovery area

SQL> show parameter recovery;
db_recovery_file_dest
db_recovery_file_dest_size
recovery_parallelism

Insert picture description here
BACKGROUND_DUMP_DEST
will write the path name (directory or disk) of the debug trace file used for background processes (LGWR, DBW n, etc.) during Oracle operations. This file grows slowly, but there is no limit, so you may want to delete it regularly. Even if the database is running, you can delete the file
memory setting

相关参数:
memory_max_target
memory_target
sga_max_size
sga_target
pga_aggregate_target
(1)对于OLTP(联机事务处理过程)系统,SGA占数据库使用总内存的80%,PGA占数据库使用内存的20%
SGA_TARGET = (total_mem * 0.8) * 0.8
PGA_AGGREGATE_TARGET=(total_mem * 0.8) * 0.2
(2)对于OLAP(联机分析处理 DSS决策支持系统)系统,对于密集大查询的系统,PGA可以占到数据库使用总内存的70%,建议最初设置数据库使用总内存的50%
SGA_TARGET= (total_mem * 0.8) * 0.5
PGA_AGGREGATE_TARGET =(total_mem * 0.8) * 0.5
以16G内存为例(手动):
memory_max_target=14G
memory_target = 12G
sga_max_size=12G
sga_target=8G
pga_aggregate_target=2G
还原到amm (pga_aggregate_target sga_target 要清零,不然他们的默认是值是最小分配值 )

Published 52 original articles · won praise 2 · Views 6374

Guess you like

Origin blog.csdn.net/wenwang3000/article/details/99651950