安装系统的时候/etc/sysctl.conf没有配置最优,实际上对于CentOS5.6-64来说kernel.shmall和kernel.shmmax默认即可
基本情况:
操作系统版本:CentOS-5.6 X86-64
cpu:2*12
内存:16M
数据库版本:10.2.0.4
节点数:2
1、恢复上面的两个值到默认状态
# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736
# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296
2、是新的内核生效
[root@10-208 cron]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
[root@10-208 cron]#
3、修改sga
修改之前先说一下针对不同类型(oltp、dss)数据库sga和pga分配的不同点
oltp:sga=总内存*80%*80%
pga=总内存*80%*20%
dss:sga=总内存*80%*50%
sga=总内存*80%*50%
个人理解:对于oltp数据库来说,数据量不大,并发较多,希望数据最好大部分在内存里,所以sga分配较大。而oltp数据库一般来说数据库排序不是非常的大,所以没有必要分配太大的内存。
对于dss系统来说数据量一般非常的大,把数据库全部放到内存里面不现实,,而大数据量的排序一般来说会很多,所以要安装如上分配。
我这里是oltp系统,所有内存分配如下
sga=16G*80%*80%=10.24G,我这里给了10G
pga=16G*80%*20%=2.56G,我这里给了2G
1)修改第一个节点:
[sql]
2)当第一个节点启动后,修改第2个节点:
[sql]
4、确定所有的服务都已经启动
[sql]

This article addresses MySQL's "unable to open shared library" error. The issue stems from MySQL's inability to locate necessary shared libraries (.so/.dll files). Solutions involve verifying library installation via the system's package m

This article explores optimizing MySQL memory usage in Docker. It discusses monitoring techniques (Docker stats, Performance Schema, external tools) and configuration strategies. These include Docker memory limits, swapping, and cgroups, alongside

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

This article compares installing MySQL on Linux directly versus using Podman containers, with/without phpMyAdmin. It details installation steps for each method, emphasizing Podman's advantages in isolation, portability, and reproducibility, but also

This article provides a comprehensive overview of SQLite, a self-contained, serverless relational database. It details SQLite's advantages (simplicity, portability, ease of use) and disadvantages (concurrency limitations, scalability challenges). C

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]

This guide demonstrates installing and managing multiple MySQL versions on macOS using Homebrew. It emphasizes using Homebrew to isolate installations, preventing conflicts. The article details installation, starting/stopping services, and best pra

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


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

Dreamweaver Mac version
Visual web development tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

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

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

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