首頁 資料庫 mysql教程 solaris修改shminfo_shmmax参数无效解决

solaris修改shminfo_shmmax参数无效解决

Jun 07, 2016 pm 05:37 PM
solaris

环境介绍:双机操作系统:solaris10数据库版本:oracle11gR164bit当前主机的主机名称和IP:fly-db2192.168.20.21当前备机的主机名称和IP:fly-db1192.168.20.20

环境介绍:

双机 操作系统:solaris 10 数据库版本:oracle 11g R1 64bit 当前主机的主机名称和IP:fly-db2 192.168.20.21 当前备机的主机名称和IP:fly-db1 192.168.20.20

背景:

       主备机的物理内存均为94G,近期对备机的物理内存扩容一倍,并修改了数据库层面的相关内存参数,以及主备机的操作系统参数shmsys:shminfo_shmmax,注意是主备的shmsys:shminfo_shmmax参数均已修改,详情请查看下面链接的博文

     今晚对fly-db1主机(目前的备机)的物理内存扩容一倍后,重启操作系统,因主备机的shmsys:shminfo_shmmax参数均已经修改,重启操作系统后,理论上该参数设置生效,通过双机软件将数据库从fly-db2切换到fly-db1,切换失败,在双机软件中,查看到out of memory错误,在数据库alert日志,查看到如下报错:

WARNING: The system does not seem to be configured optimally. Creating a segment of size 0x0000000220000000 failed. Please change the shm parameters so that a segment can be created for this size. While this is not a fatal issue, creating one segment may improve performance 如果手工启动,则报错如下: SQL> startup ORA-27102: out of memory SVR4 Error: 22: Invalid argument bash-3.00$ oerr ora 27102 27102, 00000, "out of memory" // *Cause: Out of memory // *Action: Consult the trace file for details

     从以上报错分析,因为使用的是同一个数据库,操作系统层面只修改了shmsys:shminfo_shmmax参数,定位为当前备机fly-db1该参数设置未生效

   1、对比主备机的/etc/system文件,是一致的

bash-3.00#hostname fly-db1 bash-3.00# diff /etc/system /home/oracle/system_flydb2_131220.bak

     2、百度之solaris out of memory,查看到以下blog,文章中涉及/etc/project文件,我们可以这么理解/etc/project文件,如果/etc/system和/etc/project中设置了相同的参数,则操作系统会忽略/etc/system的设置,而采用/etc/project的设置,/etc/project文件可以针对特定用户设置只对自己生效的参数
https://blogs.oracle.com/mandalika/entry/oracle_on_solaris_10_fixing   Oracle on Solaris 10 : Fixing the 'ORA-27102: out of memory' Error

    3、查看到当前备机fly-db1主机的/etc/project中设置了max-shm-memory的最大大小为60G,即最大的共享内存段为60G,如下所示:

bash-3.00# hostname fly-db1 bash-3.00# cat /etc/project system:0:::: user.root:1:::: noproject:2:::: default:3::::project.max-shm-memory=(privileged,64424509440,deny) group.staff:10:::: bash-3.00# bc scale=5 64424509440/1024/1024/1024 60.00000

    4、查看当前主机(fly-db2)的/etc/project内容,未设置max-shm-memory的最大值,,所以在该操作系统,生效的是/etc/system的设置

bash-3.00#hostname fly-db2 bash-3.00# cat /etc/project system:0:::: user.root:1:::: noproject:2:::: default:3:::: group.staff:10::::

   5、将当前备机fly-db1的/etc/project修改成和当前主机的/etc/project一样

bash-3.00#hostname fly-db1 bash-3.00# cat /etc/project system:0:::: user.root:1:::: noproject:2:::: default:3:::: group.staff:10::::

   6、重启操作系统

bash-3.00# sync bash-3.00# sync bash-3.00# sync bash-3.00# shutdown -i6 -g0 -y

  7、双机切换,成功切换到备机fly-db1

 

以下内容来自: https://blogs.oracle.com/mandalika/entry/oracle_on_solaris_10_fixing Symptom: As part of a database tuning effort you increase the SGA/PGA sizes; and Oracle greets with an ORA-27102: out of memory error message. The system had enough free memory to serve the needs of Oracle. SQL> startup ORA-27102: out of memory SVR4 Error: 22: Invalid argument Diagnosis $ oerr ORA 27102 27102, 00000, "out of memory" // \*Cause: Out of memory // \*Action: Consult the trace file for details Not so helpful. Let's look the alert log for some clues. % tail -2 alert.log WARNING: EINVAL creating segment of size 0x000000028a006000 fix shm parameters in /etc/system or equivalent Oracle is trying to create a 10G shared memory segment (depends on SGA/PGA sizes), but operating system (Solaris in this example) responded with an invalid argument (EINVAL) error message. There is a little hint about setting shm parameters in /etc/system. Prior to Solaris 10, shmsys:shminfo_shmmax parameter has to be set in /etc/system with maximum memory segment value that can be created. 8M is the default value on Solaris 9 and prior versions; where as 1/4th of the physical memory is the default on Solaris 10 and later. On a Solaris 10 (or later) system, it can be verified as shown below: % prtconf | grep Mem Memory size: 32760 Megabytes % id -p uid=59008(oracle) gid=10001(dba) projid=3(default) % prctl -n project.max-shm-memory -i project 3 project: 3: default NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT project.max-shm-memory privileged 7.84GB - deny - system 16.0EB max deny - Now it is clear that the system is using the default value of 8G in this scenario, where as the application (Oracle) is trying to create a memory segment (10G) larger than 8G. Hence the failure.So, the solution is to configure the system with a value large enough for the shared segment being created, so Oracle succeeds in starting up the database instance. On Solaris 9 and prior releases, it can be done by adding the following line to /etc/system, followed by a reboot for the system to pick up the new value. set shminfo_shmmax = 0x000000028a006000 However shminfo_shmmax parameter was obsoleted with the release of Solaris 10; and Sun doesn't recommend setting this parameter in /etc/system even though it works as expected. On Solaris 10 and later, this value can be changed dynamically on a per project basis with the help of resource control facilities . This is how we do it on Solaris 10 and later: % prctl -n project.max-shm-memory -r -v 10G -i project 3 % prctl -n project.max-shm-memory -i project 3 project: 3: default NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT project.max-shm-memory privileged 10.0GB - deny - system 16.0EB max deny - Note that changes made with the prctl command on a running system are temporary, and will be lost when the system is rebooted. To make the changes permanent, create a project with projadd command and associate it with the user account as shown below: % projadd -p 3 -c 'eBS benchmark' -U oracle -G dba -K 'project.max-shm-memory=(privileged,10G,deny)' OASB % usermod -K project=OASB oracle Finally make sure the project is created with projects -l or cat /etc/project commands. % projects -l ... ... OASB projid : 3 comment: "eBS benchmark" users : oracle groups : dba attribs: project.max-shm-memory=(privileged,10737418240,deny) % cat /etc/project ... ... OASB:3:eBS benchmark:oracle:dba:project.max-shm-memory=(privileged,10737418240,deny) With these changes, Oracle would start the database up normally. SQL> startup ORACLE instance started. Total System Global Area 1.0905E+10 bytes Fixed Size 1316080 bytes Variable Size 4429966096 bytes Database Buffers 6442450944 bytes Redo Buffers 31457280 bytes Database mounted. Database opened.

 

 

本文出自 “斜阳悠悠寸草心” 博客,请务必保留此出处

本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

AI Hentai Generator

AI Hentai Generator

免費產生 AI 無盡。

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
1 個月前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳圖形設置
1 個月前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您聽不到任何人,如何修復音頻
1 個月前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.聊天命令以及如何使用它們
1 個月前 By 尊渡假赌尊渡假赌尊渡假赌

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

說明InnoDB全文搜索功能。 說明InnoDB全文搜索功能。 Apr 02, 2025 pm 06:09 PM

InnoDB的全文搜索功能非常强大,能够显著提高数据库查询效率和处理大量文本数据的能力。1)InnoDB通过倒排索引实现全文搜索,支持基本和高级搜索查询。2)使用MATCH和AGAINST关键字进行搜索,支持布尔模式和短语搜索。3)优化方法包括使用分词技术、定期重建索引和调整缓存大小,以提升性能和准确性。

如何使用Alter Table語句在MySQL中更改表? 如何使用Alter Table語句在MySQL中更改表? Mar 19, 2025 pm 03:51 PM

本文討論了使用MySQL的Alter Table語句修改表,包括添加/刪除列,重命名表/列以及更改列數據類型。

與MySQL中使用索引相比,全表掃描何時可以更快? 與MySQL中使用索引相比,全表掃描何時可以更快? Apr 09, 2025 am 12:05 AM

全表掃描在MySQL中可能比使用索引更快,具體情況包括:1)數據量較小時;2)查詢返回大量數據時;3)索引列不具備高選擇性時;4)複雜查詢時。通過分析查詢計劃、優化索引、避免過度索引和定期維護表,可以在實際應用中做出最優選擇。

可以在 Windows 7 上安裝 mysql 嗎 可以在 Windows 7 上安裝 mysql 嗎 Apr 08, 2025 pm 03:21 PM

是的,可以在 Windows 7 上安裝 MySQL,雖然微軟已停止支持 Windows 7,但 MySQL 仍兼容它。不過,安裝過程中需要注意以下幾點:下載適用於 Windows 的 MySQL 安裝程序。選擇合適的 MySQL 版本(社區版或企業版)。安裝過程中選擇適當的安裝目錄和字符集。設置 root 用戶密碼,並妥善保管。連接數據庫進行測試。注意 Windows 7 上的兼容性問題和安全性問題,建議升級到受支持的操作系統。

如何為MySQL連接配置SSL/TLS加密? 如何為MySQL連接配置SSL/TLS加密? Mar 18, 2025 pm 12:01 PM

文章討論了為MySQL配置SSL/TLS加密,包括證書生成和驗證。主要問題是使用自簽名證書的安全含義。[角色計數:159]

哪些流行的MySQL GUI工具(例如MySQL Workbench,PhpMyAdmin)是什麼? 哪些流行的MySQL GUI工具(例如MySQL Workbench,PhpMyAdmin)是什麼? Mar 21, 2025 pm 06:28 PM

文章討論了流行的MySQL GUI工具,例如MySQL Workbench和PhpMyAdmin,比較了它們對初學者和高級用戶的功能和適合性。[159個字符]

InnoDB中的聚類索引和非簇索引(次級索引)之間的差異。 InnoDB中的聚類索引和非簇索引(次級索引)之間的差異。 Apr 02, 2025 pm 06:25 PM

聚集索引和非聚集索引的區別在於:1.聚集索引將數據行存儲在索引結構中,適合按主鍵查詢和範圍查詢。 2.非聚集索引存儲索引鍵值和數據行的指針,適用於非主鍵列查詢。

您如何處理MySQL中的大型數據集? 您如何處理MySQL中的大型數據集? Mar 21, 2025 pm 12:15 PM

文章討論了處理MySQL中大型數據集的策略,包括分區,碎片,索引和查詢優化。

See all articles