平台环境:Linux Red Hat Enterprise Linux Server release 6.0 (Santiago)
数据库版本:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
安装好ORALCE数据库后,启动数据库就会报如下错误
当启动数据库或者创建数据库时都可能出现ORA-27125错误,我在Oracle Linux 6上安装Oracle 10.2.0.1,创建数据库时就遇到了这个错误。
这个错误的解决就是修改 /proc/sys/vm/hugetlb_shm_group 文件。
以下是老杨提到过的一个问题,解决方法相同:
帮客户解决一个Linux上数据库无法启动的问题。
客户的Linux 5.6 x86-64环境,安装数据库后,启动数据库报错:ORA-27125。
Oracle文档上关于ORA-27125错误的描述为:
ORA-27125: unable to create shared memory segment
Cause: shmget() call failed
Action: contact Oracle support
查询了一下,发现问题和linux上的hugetbl有关。
解决方法也很简单,首先检查oracle用户的组信息:
[oracle@yans1 ~]$ id oracle
uid=500(oracle) gid=502(oinstall) groups=502(oinstall),501(dba)
[oracle@yans1 ~]$ more /proc/sys/vm/hugetlb_shm_group
0
下面用root执行下面的命令,将dba组添加到系统内核中:
# echo 501 > /proc/sys/vm/hugetlb_shm_group
然后启动数据库,问题消失。
那么hugetlb_shm_group组是什么呢?以下是解释:
hugetlb_shm_group contains group id that is allowed to create SysV shared memory segment using hugetlb page
另在安装过程中遇到的操作系统验证错误,可以通过如下方式解决:
在Linux系统中安装oralce的过程中,如果Linux发行版本不是oracle的推荐版本,可能会报如下错误,导致runInstaller无法完成:
Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
Failed
遇到这个问题,可以通过如下三种方式解决
1、修改Linux的发行标记
如在redhat-5上安装oracle的时候,需要将文件 '/etc/redhat-release'的内容由
Red Hat Enterprise Linux Server release 5 (Tikanga)
修改为Oracle支持的版本
Red Hat Enterprise Linux Server release 4 (Tikanga)
2、runInstaller的时候加上-ignoreSysPreReqs参数,如:
./runInstaller -ignoreSysPreReqs
3.修改oraparam.ini的参数
增加你的系统版本号
4.设置数据库
[root@DB-Server ~]#id oracle
uid=501(oracle) gid=502(oinstall) groups=502(oinstall),501(dba)
[root@DB-Server ~]#echo 501 > /proc/sys/vm/hugetlb_shm_group
然后重启数据库,问题解决,但是我发现数据库服务器重启后,这个问题又会重现,又必须处理上述命令,才能成功启动数据库。治标不治本
参考http://wiki.d**e*bian.org/Hugepages后,其实只须在/etc/sysctl.conf下设置一下 hugetlb_shm_group即可一劳永逸的解决这个问题:
Create a group for users of hugepages, and retrieve it's GID (is this example, 2021) then add yourself to the group.
Note: this should not be needed for libvirt (see /etc/libvirt/qemu.conf)
% groupadd my-hugetlbfs
% getent group my-hugetlbfs
my-hugetlbfs:x:2021:
% adduser franklin my-hugetlbfs
Adding user `franklin' to group `my-hugetlbfs' ...
Adding user franklin to group my-hugetlbfs
Done.Edit /etc/sysctl.conf and add this text to specify the number of pages you want to reserve (see pages-size)
# Allocate 256*2MiB for HugePageTables (YMMV)
vm.nr_hugepages = 256
# Members of group my-hugetlbfs(2021) can allocate "huge" Shared memory segment
vm.hugetlb_shm_group = 2021Create a mount point for the file system
% mkdir /hugepagesAdd this line in /etc/fstab (The mode of 1770 allows anyone in the group to create files but not unlink or rename each other's files.1)
hugetlbfs /hugepages hugetlbfs mode=1770,gid=2021 0 0Reboot (This is the most reliable method of allocating huge pages before the memory gets fragmented. You don't necessarily have to reboot. You can try to run systclt -p to apply the changes. if grep "Huge" /proc/meminfo don't show all the pages, you can try to free the cache with sync ; echo 3 > /proc/sys/vm/drop_caches (where "3" stands for "purge pagecache, dentries and inodes") then try sysctl -p again. 2)
limits.conf
You should configure the amount of memory a user can lock, so an application can't crash your operating system by locking all the memory. Note that any page can be locked in RAM, not just huge pages. You should allow the process to lock a little bit more memory that just the the space for hugepages.
## Get huge-page size:
% grep "Hugepagesize:" /proc/meminfo
Hugepagesize: 4096 kB
## What's the current limit
% ulimit -H -l
64
## Just add them up... (how many pages do you want to allocate?)See Limits (ulimit -l and memlock in /etc/security/limits.conf).
《黎明杀机》开发商正开发新的《Serious Sam》游戏 由Devolver发行
超英派遣中心即将登陆Xbox Play Anywhere 深入了解这款独特而备受喜爱的冒险游戏
在《Hunter: The Reckoning – Deathwish》中怎么从猎物蜕变为猎手
《The Expanse: Osiris Reborn》——深入了解玩法 新同伴 封闭测试及发行窗口
Alien Deathstorm 科幻生存与动作结合 打造全新第一人称恐怖混合体验
宝可梦公司已在考虑未来可用口袋妖怪总数达到“或许一万只”
幸存者村庄2
怪可爱的店折相思菜单
怪可爱的店折相思菜单是一款画风治愈的模拟经营佳作,内置折相思菜单解锁多项便利功能
lol电竞经理人手游
lol电竞经理人手游让你可以成为职业的电竞经理人,在游戏中掌控游戏的走向!豪华阵
梦幻奶茶屋小游戏
梦幻奶茶屋是一款主打温馨治愈氛围的休闲经营作品,玩家将化身元气满满的奶茶店店长,
萌宠养成物语无限金币版
萌宠养成物语无限金币版是一款治愈系模拟养成游戏,以可爱卡通画风构建温馨虚拟世界,