Oracle基础教程之设置系统全局区SGA命令
Oracle基础教程之设置系统全局区SGA命令,当我们明白了这些在SGA中很重要的参数时,才能游刃有余的分配我们有限的内存空间,使我
今天简单介绍一下SGA 的设置方法
1.sga_target 参数
alter system set sga_target = 40000m scope=both;
特性:
1).ASMM 自动共享内存管理
答:SGA_TARGET参数控制ASMM(自动共享内存管理)是Oracle一个新特性,但是它的含义和SGA_MAX_SIZE的一样,也表示SGA最大的大小,于是它也就有了一个限制,那就是它的大小不能大于SGA_MAX_SIZE的大小,一旦给SGA_TARGET指定值后(默认为0,即没有启动ASMM),就自动启动了ASMM特性
2).sga_target 与sga_max_size关系
答:即当SGA_TARGET3).sga_target 动态参数
答:SGA_TARGET是可以在本实例内动态修改的,不用重启数据库实例,所谓的动态参数是指可以直接修改即在内存生效,不用重启数据库来加载参数文件生效。
4).ASMM 自动共享内存管理会影响哪些内存区呢
答:当启用Oracle的ASMM新特性以后,也不是SGA的所有内存区的大小都开始动态共享起来,只有以下的这些区的内存大小可动态共享,而SGA中的其他区域的内存大小仍然是固定不共享的
* Buffer cache (DB_CACHE_SIZE)
* Shared pool (SHARED_POOL_SIZE)
* Large pool (LARGE_POOL_SIZE)
* Java pool (JAVA_POOL_SIZE)
* Streams pool (STREAMS_POOL_SIZE)
2.sga_max_size参数
alter system set sga_max_size=40000m scope=spfile;
特性:
1).sga_max_size静态参数
它用来控制SGA使用虚拟内存的最大大小,当实例启动后,各个内存区只分配实例所需要的最小大小,在随后的运行过程中,再根据需要扩展他们的大小,而他们的总和大小受到了SGA_MAX_SIZE的限制。“修改SGA_MAX_SIZE的大小,必须要重新启动数据库实例”,因为是静态参数。所谓静态参数是指修改之后即在spfile参数文件里生效,没有在内存里生效,所以必须重启数据库来加载参数文件使其生效
3.db_cache_size参数【数据库缓冲区高速缓存】
alter system set db_cache_size=2000m scope=both;
1).此参数是一个动态参数,用于缓存数据库中正在使用的“有效数据”的内存区,此内存区的大小对数据的检索速度有很大的影响,如果检索的数据在此区内可以找到,那么要比间接到硬盘中找要快的多。所以在系统稳定后可以静态设置此缓冲区的值
4.scope =【memory | spfile | both】
1).如果scope=memory 说明修改的参数只在内存中生效,重启数据库后恢复到原来状态值【用于修改动态参数】
2).如果scope=spfile 说明修改的参数只在参数文件中生效,修改后当前环境是不生效的,必须重启数据库来加载参数文件使其生效【用于修改静态参数】
3).如果scope=both 说明修改的参数在当前环境(内存)和spfile(参数文件)都生效,both=memory+spfile,修改后当前环境生效,重启数据库后也生效。
小结:当我们明白了这些在SGA中很重要的参数时,才能游刃有余的分配我们有限的内存空间,使我们的系统的性能最大化,,让oracle跑的更快、更好。
相关阅读:
Oracle的SGA
Oracle SGA 自动管理特性(SGA_target参数)
AIX平台Oracle启用SGA大页面(LARGE PAGE)
修改Oracle数据库SGA和PGA大小
Oracle 10g参数调整(processes和SGA)

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

InnoDB's full-text search capabilities are very powerful, which can significantly improve database query efficiency and ability to process large amounts of text data. 1) InnoDB implements full-text search through inverted indexing, supporting basic and advanced search queries. 2) Use MATCH and AGAINST keywords to search, support Boolean mode and phrase search. 3) Optimization methods include using word segmentation technology, periodic rebuilding of indexes and adjusting cache size to improve performance and accuracy.

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

The difference between clustered index and non-clustered index is: 1. Clustered index stores data rows in the index structure, which is suitable for querying by primary key and range. 2. The non-clustered index stores index key values and pointers to data rows, and is suitable for non-primary key column queries.

MySQL supports four index types: B-Tree, Hash, Full-text, and Spatial. 1.B-Tree index is suitable for equal value search, range query and sorting. 2. Hash index is suitable for equal value searches, but does not support range query and sorting. 3. Full-text index is used for full-text search and is suitable for processing large amounts of text data. 4. Spatial index is used for geospatial data query and is suitable for GIS applications.
