Python微信订餐小程序课程视频

https://edu.csdn.net/course/detail/36074

Python实战量化交易理财系统

https://edu.csdn.net/course/detail/35475

一、概述

在Linux上安装oracle,需要对内核参数进行调整,其中有shmmax和shmall这两个参数,那这两个参数是什么意思,又该如何设置呢?

二、官方文档

在oracle的官方文档( https://docs.oracle.com/en/database/oracle/oracle-database/19/ladbi/minimum-parameter-settings-for-installation.html#GUID-CDEB89D1-4D48-41D9-9AC2-6AD9B0E944E3 )中对这两个参数,设置了最小的标准值。

shmall - Greater than or equal to the value of shmmax, in pages.
shmmax - Half the size of physical memory in bytes. See My Oracle Support Note 567506.1 for additional information about configuring shmmax.

再根据redhat的官方文档( https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/performance_tuning_guide/sect-red_hat_enterprise_linux-performance_tuning_guide-configuration_tools-configuring_system_memory_capacity ),去查这两个参数所表达的含义。

shmall - Defines the total amount of shared memory pages that can be used on the system at one time. A page is 4096 bytes on the AMD64 and Intel 64 architecture, for example.
shmmax - Defines the maximum size (in bytes) of a single shared memory segment allowed by the kernel.

以上两段英文翻译过来:shmmax单个最大共享内存段,shmall同一时刻能使用的所有共享内存页。shmmax最小一半的物理内存,shmall >= shmmax/4096。

oracle的sga(Shared Global Area)使用的就是共享内存,共享内存的优势redhat官方文档( https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/tuning_and_optimizing_red_hat_enterprise_linux_for_oracle_9i_and_10g_databases/chap-oracle_9i_and_10g_tuning_guide-setting_shared_memory#sect-Oracle_9i_and_10g_Tuning_Guide-Setting_Shared_Memory-Setting_SHMMAX_Parameter_ )中也有提及。直白点说就是多进程使用共享内存交流数据最快。例如:服务器进程从磁盘读取数据到sga的buffer cache,dbwn进程从buffer cache将数据写回到磁盘,操作的是同一片内存区域。如果没有共享内存,那么就需要将服务器进程操作的这片内存复制一份到dbwn所操作的内存中去,来完成读取和写入操作。

Shared memory allows processes to access common structures and data by placing them in shared memory segments. It is the fastest form of inter-process communication available since no kernel involvement occurs when data is passed between the processes. In fact, data does not need to be copied between the processes.
Oracle uses shared memory segments for the Shared Global Area (SGA) which is an area of memory that is shared by Oracle processes. The size of the SGA has a significant impact to Oracle’s performance since it holds database buffer cache and much more.

从上面的官方文档我们了解了这两个参数的含义,但是oracle只给了shmmax和shmall的最小值。接下来我们就通过实验来看看这两个参数对oracle的影响。

三、实验

我的实验机器物理内存是1877M,设置SGA_TAEGET为1000M。接下来测试几个场景。

a. shmmax 200M, shmall 200M

将/etc/sysctl.conf参数设置为
kernel.shmmax = 209715200
kernel.shmall = 51200

oracle启动直接报错

SQL> startup nomount pfile='/home/oracle/test.ora'
ORA-27102: out of memory
Linux-x86\_64 Error: 28: No space left on device
Additional information: 209715200
Additional information: 1

b. shmmax 1200M, shmall 200M

将/etc/sysctl.conf参数设置为
kernel.shmmax = 1258291200
kernel.shmall = 51200

oracle启动报跟上面一样的错

SQL> startup nomount pfile='/home/oracle/test.ora'
ORA-27102: out of memory
Linux-x86\_64 Error: 28: No space left on device
Additional information: 1035993088
Additional information: 1

从a和b的实验结果来看,oracle是否能够正常启动跟shmmax参数无关,只与shmall有关。shmall不能设置的比SGA_TAEGET小。

c. shmmax 200M, shmall 1200M

将/etc/sysctl.conf参数设置为
kernel.shmmax = 209715200
kernel.shmall = 307200

数据库能够正常启动

SQL> startup nomount pfile='/home/oracle/test.ora'
ORACLE instance started.Total System Global Area 1043886080 bytes
Fixed Size                  2259840 bytes
Variable Size             327156864 bytes
Database Buffers          708837376 bytes
Redo Buffers                5632000 bytes

查看共享内存的信息

[root@oracletest ~]# ipcs -m------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000000 229376     oracle     640        12582912   18
0x00000000 262145     oracle     640        209715200  18
0x00000000 294914     oracle     640        209715200  18
0x00000000 327683     oracle     640        209715200  18
0x00000000 360452     oracle     640        209715200  18
0x00000000 393221     oracle     640        197132288  18
0x276f5044 425990     oracle     640        2097152    18  

把上面的共享内存段bytes全部加起来(12582912+209715200…+2097152)/1024/1024=1002MB。可以看到oracle分配内存段的时候,单个共享内存段的确没有超过shmmax(209715200)。总的共享内存刚好等于SGA_TAEGET。

d. shmmax 1200M, shmall 1200M

将/etc/sysctl.conf参数设置为
kernel.shmmax = 1258291200
kernel.shmall = 307200

数据库同样能够正常启动

SQL> startup nomount pfile='/home/oracle/test.ora'
ORACLE instance started.Total System Global Area 1043886080 bytes
Fixed Size                  2259840 bytes
Variable Size             327156864 bytes
Database Buffers          708837376 bytes
Redo Buffers                5632000 bytes

查看共享内存的信息

[root@oracletest ~]# ipcs -m------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000000 557056     oracle     640        12582912   18
0x00000000 589825     oracle     640        1035993088 18
0x276f5044 622594     oracle     640        2097152    18 

把上面的共享内存段bytes全部加起来(12582912+1035993088+2097152)/1024/1024=1002MB。总的共享内存仍然刚好等于SGA_TAEGET。内存段的数量却只有三个,最大的内存段达到1035993088/1024/1024=988M

f. shmmax 2400M, shmall 2400M

将/etc/sysctl.conf参数设置为
kernel.shmmax = 2516582400
kernel.shmall = 614400

SQL> startup nomount pfile='/home/oracle/test.ora'
ORACLE instance started.Total System Global Area 1043886080 bytes
Fixed Size                  2259840 bytes
Variable Size             327156864 bytes
Database Buffers          708837376 bytes
Redo Buffers                5632000 bytes  
[root@oracletest ~]# ipcs -m------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000000 688128     oracle     640        12582912   18
0x00000000 720897     oracle     640        1035993088 18
0x276f5044 753666     oracle     640        2097152    18 

可以看到f跟e没啥区别,shmmax这个值你就算设置超过了物理内存也不受影响。因为oracle实际上分配的共享内存不会超过SGA_TAEGET。

四、总结

  1. 为了让共享内存不至于切分成多个段,建议将shmmax设置比SGA_TAEGET大,shmall=shmmax/4096即可。至于大多少,个人认为随意。

++本人水平有限,特别是对于共享内存这块,我仍然有很多疑问,比如共享内存能否被交换出去?多个共享内存段有什么缺点?暂时就先记录到这里,后面了解之后,再来更新此文。如果有专家看到文章错误,还望指正。++

Oracle安装 - shmmax和shmall设置相关推荐

  1. oracle 设置 shmmax,安装ORACLE时在Linux上设置内核参数的含义

    前两天看到一篇Redhat官方的Oracle安装文档,对于Linux内核参数的修改描述的非常清晰. 安装Oracle之前,除了检查操作系统的硬件和软件是否满足安装需要之外,一个重点就是修改内核参数,其 ...

  2. linux oracle semopm,Linux 内核参数设置于详解 --Oracle 安装

    1. Linux核心参数 #vi /etc/sysctl.conf -------------------------------- cat >>/etc/sysctl.conf < ...

  3. oracle怎么设置脚本,ORACLE安装预设置脚本

    ORACLE安装预设置脚本 对于DBA来说,经常需要不断去部署oracle database软件,设置一些环境变量或是系统 参数感觉十分枯燥,通过脚本来实现可以减少很多重复的工作. #!/bin/ba ...

  4. 下载丨Oracle 11g 安装后参数规范设置

    墨天轮文档:<Oracle 11g安装后参数规范设置>:https://www.modb.pro/doc/19(复制到浏览器或者点击"阅读原文"即可下载) 以下截取部分 ...

  5. [INS-30131] 执行安装程序验证所需的初始设置失败问题解决,windows下oracle安装步骤

    [INS-30131] 执行安装程序验证所需的初始设置失败问题解决,windows下oracle安装步骤 配置: 系统:windows10 数据库:Oracle Database 12c 第 1 版 ...

  6. oracle安装提示初始设置失败,安装oracle11g client 【INS-30131】执行安装程序验证所需的初始设置失败的解决方法...

    今天在服务器(操做系统windows server 2008R2)上安装Oracle11g 客户端,弹出"执行安装程序验证所需的初始设置失败",如上图.网上找了一些方法,简单整理以 ...

  7. linux 上oracle安装

    Linux上oracle的安装 Linux 版本: Red Hat Enterprise Linux5.0 Oracle 版本: oracle 11g   Linux 版本检查 #cat /etc/i ...

  8. centos 7 如何验证oracle安装成功_linux下Oracle数据的安装详解

    第二章:CentOS下Oracle用户环境配置和Oracle11g的安装: 1.下载Oracle安装包: linux.x64_11gR2_database_1of2.zip 和 linux.x64_1 ...

  9. linux下oracle安装

    本文主要介绍linux下oracle的安装,主要分为3部分:准本工作.安装oracle软件.用dbca工具创建数据库. 实验环境:rhel5.6+oracle_database_linux32.zip ...

最新文章

  1. Python基础15-函数闭包与装饰器
  2. WIN7下,联想A30T通过USB连接上网
  3. OpenAPI 规范 3.1.0 发布,赶紧来尝尝鲜!
  4. python快速编程入门飞机大战_少儿编程:使用python完成飞机大战游戏(一)
  5. DELPHI之常用函数
  6. 学英语---(2)脱口而出100句经典英语口语
  7. CSS选择器优先级 12.28
  8. ODrive踩坑(三)AS5047P磁编码器的ABI接口
  9. Keras——保存和提取模型
  10. linux of命令,Linux命令(30):isof
  11. 【杂】poj2482 Stars in Your Windows 题面的翻译
  12. Redis牛逼!轻松实现实时订阅推送
  13. VI 编辑器保存命令
  14. CCF - 201604-2 - 俄罗斯方块
  15. 编程视频资源教程汇总
  16. 单龙芯3A3000-7A1000PMON研究学习-(28)撸起袖子干-再来一杯代码10-内存初始化1
  17. cad卸载_CAD卸载后为什么安装不了?解决方法原来是这样!
  18. 荣耀发布标志性旗舰智能手机Magic3系列;环旭电子为小型物联网设备推出双核蓝牙5.0天线封装模块 | 全球TMT...
  19. 2022-2028中国有机蒙脱石市场现状研究分析与发展前景预测报告
  20. matlab实现注册账号,创建账户

热门文章

  1. 我看objective-C --不要把objC当做c/c++的超集
  2. tkinter的GUI设计:界面与逻辑分离(三)-- 多页面
  3. 使用 Pandas 分析 Apache 日志
  4. WinForm UI设计与开发思路(转)
  5. vue图片压缩不失真_图片压缩会失真?快试试这几个无损压缩神器。
  6. opencv:边缘检测之Laplacian算子思想及实现
  7. leetcode 127. 单词接龙(bfs)
  8. leetcode337. 打家劫舍 III(dfs)
  9. leetcode392. 判断子序列(动态规划)
  10. 使用集合映射和关联关系映射_使用R进行基因ID映射