Oracle 参数 SORT_AREA_SIZE 官方解释,作用,如何配置最优化建议
SORT_AREA_SIZE参数指定了每个会话可以使用的排序内存大小,单位为字节。
排序操作是Oracle在实施SQL语句过程中必不可少的步骤,如果SORT_AREA_SIZE设置的值太小,将导致排序操作的效率下降,从而影响SQL语句的执行效率,以及数据库的性能。
正确设置SORT_AREA_SIZE参数的方法:
1、首先,确定SORT_AREA_SIZE参数的值,默认值为2M,此参数也可以在实际应用中调整,如果使用排序的SQL语句执行效率不高,可以考虑对此参数增加值;
2、针对某个会话的等待事件,可以检查当前会话的SORT_AREA_SIZE大小是否合理。如果当前SORT_AREA_SIZE太小,没有足够的内存来完成排序操作,可以尝试去增加SORT_AREA_SIZE的值;
3、根据实际的表大小和服务器硬件配置,可以计算出合理的参数,一般来说,使用以下公式对SORT_AREA_SIZE参数值进行设置:
max_sort_size = log_block_size * 10 * avg_row_len / 1024.
这里log_block_size是由DB_BLOCK_SIZE参数定义,并且不能大于SORT_AREA_SIZE,而avg_row_len是排序表存储的数据的平均行的大小;
4、其次,可以考虑使用替换排序和哈希排序来替代全表排序,减少排序时间;
5、最后,如果表比较大,考虑使用更大容量的固态硬盘作为表空间存放,也能够缩短排序过程中的访存时间。
官方英文解释SORT_AREA_SIZE specifies (in bytes) the maximum amount of memory Oracle will use for a sort.
Minimum: the value equivalent of six database blocks
Maximum: operating system-dependent
Note:
Oracle does not recommend using the SORT_AREA_SIZE parameter unless the instance is configured with the shared server option. Oracle recommends that you enable automatic sizing of SQL working areas by setting PGA_AGGREGATE_TARGET instead. SORT_AREA_SIZE is retained for backward compatibility.
After the sort is complete, but before the rows are returned, Oracle releases all of the memory allocated for the sort, except the amount specified by the SORT_AREA_RETAINED_SIZE parameter. After the last row is returned, Oracle releases the remainder of the memory.
Increasing SORT_AREA_SIZE size improves the efficiency of large sorts.
Each sort in a query can consume memory up to the amount specified by SORT_AREA_SIZE, and there can be multiple sorts in a query. Also, if a query is executed in parallel, each PQ slave can consume memory up to the amount specified by SORT_AREA_SIZE for each sort it does.
SORT_AREA_SIZE is also used for inserts and updates to bitmap indexes. Setting this value appropriately results in a bitmap segment being updated only once for each DML operation, even if more than one row in that segment changes.
Larger values of SORT_AREA_SIZE permit more sorts to be performed in memory. If more space is required to complete the sort than will fit into the memory provided, then temporary segments on disk are used to hold the intermediate sort runs.
The default is adequate for most OLTP operations. You might want to adjust this parameter for decision support systems, batch jobs, or large CREATE INDEX operations.
See Also:
Your operating system-specific Oracle documentation for the default value on your system
我想要获取技术服务或软件
服务范围:MySQL、ORACLE、SQLSERVER、MongoDB、PostgreSQL 、程序问题
服务方式:远程服务、电话支持、现场服务,沟通指定方式服务
技术标签:数据恢复、安装配置、数据迁移、集群容灾、异常处理、其它问题
本站部分文章参考或来源于网络,如有侵权请联系站长。
数据库远程运维 Oracle 参数 SORT_AREA_SIZE 官方解释,作用,如何配置最优化建议
相关文章
- 如何高效、快捷地完成Oracle大量数据导入(oracle大量数据导入)
- Oracle 视图 USER_CUBE_DIM_LEVELS 官方解释,作用,如何使用详细说明
- Oracle 视图 V$SQLFN_ARG_METADATA 官方解释,作用,如何使用详细说明
- Oracle 参数 CLONEDB_DIR 官方解释,作用,如何配置最优化建议
- Oracle 参数 MAX_IDLE_TIME 官方解释,作用,如何配置最优化建议
- Oracle 告警:提前防范,免受损失(oracle告警)
- Oracle 用户配置指南(oracle用户配置)
- 高效率的Oracle定制数据库解决方案(oracle定制数据库)
- 登录Oracle:入门配置指南(oracle管理员登录)
- 深入浅出Oracle触发器类型简介(oracle触发器类型)
- 深入了解Oracle触发器的类型(oracle触发器类型)
- 掌握Oracle子分区查询实战技巧(oracle子分区查询)
- Oracle 权限回收:获取安全控制(oracle权限回收)
- Oracle如何获取当前日期?(oracle获取当前日期)
- 极速实现Oracle环境配置(oracle环境配置)
- Oracle 磁盘管理:配置更有效的存储环境(oracle磁盘管理)
- 持久化Oracle免配置持久化极简部署让人们惊喜(oracle免配置)
- 利用CMD安全配置Oracle数据库(cmd设置oracle)
- AU3与Oracle联手促进企业数据库转型(au3 oracle)
- 如何快速启动Oracle数据库服务器(4启动oracle服务器)
- Oracle 了解事务的重要性(oracle 什么是事务)
- 功能Oracle添加新功能修改参数配置(oracle修改参数添加)
- 效率Oracle 主键设计提升读取效率(oracle主键逻辑读高)
- Oracle中利用代理赋值解决安全性问题(oracle 代理赋值)
- Oracle数据库如何配置中文界面(oracle中文界面设置)
- 有效使用Oracle下载安装及注册码配置(oracle下载注册码)
- Oracle中的三种约束超出常规的保障(oracle三种约束)
- Oracle与MySQL配置之比较(oracle vs配置)
- acle joinOracle IN与Oracle Join的差异探讨(oracle in与or)
- Oracle for倒序操作让查询结果倒着看(oracle for倒序)
- 如何快速配置Oracle ACL(oracle acl配置)