今天做压力测试的时候,修改数据参数出现ORA-27102: out of memory错误,最后发现是系统参数设置的问题,限制了oracle的sga大小
修改系统参数前,一定要备份参数文件,
create spfile from pfile='/opt/oracle/product/11.1/db_1/dbs/initorcl.ora';
------- 查看sga的大小
SQL> show parameter sga
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 1552M
sga_target big integer 1536M
------------------------------------ ----------- ------------------------------
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 1552M
sga_target big integer 1536M
修改sga_max_size
alter system set sga_max_size=10240M scope=spfile;
重新启动数据库
SQL> startup force
ORA-27102: out of memory
Linux-x86_64 Error: 28: No space left on device
ORA-27102: out of memory
Linux-x86_64 Error: 28: No space left on device
出现ORA-27102错误,这是我们可以使用备分的参数文件启动数据库;
startup pfile='/opt/oracle/product/11.1/db_1/dbs/initorcl.ora';
问题到这里,虽然库可以启动,但参数还是没有改。
这是我们可以修改一下系统参数/etc/sysctl.conf文件中的kernel.shmall参数
原参数
-------------------------------------------------------------------------------
fs.file-max = 6553600
kernel.shmall=2097152
kernel.shmmax=2147483648
kernel.shmmni=4096
kernel.shmall=2097152
kernel.shmmax=2147483648
kernel.shmmni=4096
-------------------------------------------------------------------------------
修改后为
--------------------------------------------------------------------------------
fs.file-max = 6553600
kernel.shmall = 4194304
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.shmall = 4194304
kernel.shmmax = 2147483648
kernel.shmmni = 4096
---------------------------------------------------------------------------------
修改完这些参数后,我们就可以正常启动了
先创建spfile,然后我们以spfile启动
SQL> create spfile from pfile;
File created.
SQL> startup force
ORACLE instance started.
ORACLE instance started.
Total System Global Area 1620189184 bytes
Fixed Size 2144824 bytes
Variable Size 922748360 bytes
Database Buffers 671088640 bytes
Redo Buffers 24207360 bytes
Database mounted.
Database opened.
Fixed Size 2144824 bytes
Variable Size 922748360 bytes
Database Buffers 671088640 bytes
Redo Buffers 24207360 bytes
Database mounted.
Database opened.
我们再次修改
alter system set sga_max_size=10240M scope=spfile;
orcl@SYS>startup force
ORACLE instance started.
ORACLE instance started.
Total System Global Area 1.0689E+10 bytes
Fixed Size 2147392 bytes
Variable Size 9596570560 bytes
Database Buffers 1073741824 bytes
Redo Buffers 17014784 bytes
Database mounted.
Database opened.
Fixed Size 2147392 bytes
Variable Size 9596570560 bytes
Database Buffers 1073741824 bytes
Redo Buffers 17014784 bytes
Database mounted.
Database opened.
问题成功解决
原因分析:linux系统默认的共享共存为系统内存的 一半,也就算是说即使系统没有其他任何程序占用系统共享内存,oracle做能使用的内存也不可能个超过2G,这里我们修改了限制共享内存的参数文件,扩大了系统的共享内存,从而使数据库能正常启动。同时也希望大家如非必要,尽量不要修改这个参数,因为你一旦扩大了共享内存,那么就有可能出现应用程序和操作系统争抢内存的状况,试想数据库所依托的操作系统出了问题,你的数据库还能正常么!
相关推荐
调整参数后引起,ORA-00838: Specified value of MEMORY_TARGET is too small, needs to be at least 3 2768M 的解决方案
ora-01033:oracle initialization or shutdown in progress 解决方法 ora-01033:oracle initialization or shutdown in progress 解决方法 ora-01033:oracle initialization or shutdown in progress 解决方法 ora-...
在运行查询SELECT * FROM V$SESSION 会出现ORA-29275:部分多字节字符的错误,这是什么原因开始我不得其解,网上也没有介绍什么好办法。本文给出答案。
ORA-12154: TNS: 无法解析指定的连接标识符的解决方法
ORA-32001:write to spfile requested but no spfile is in use请求写入spfile,但没有使用spfile的解决方法 在输入以下语句中报了这样的错误: SQL>alter system set control_files=’/u01/app/oracle/oradata/prod/...
ORA-00031:标记要终止的会话解决方案; ORA-00031:标记要终止的会话解决方案;
ORA-01036:非法的变量名/编号 oracle特有的错误
oracle12c程序连接时异常: ORA-01017: 用户名/口令无效; 登录被拒绝 的解决方案。
oracle 12 c ORA-01017: 用户名/口令无效; 登录被拒绝
NULL 博文链接:https://3w1h.iteye.com/blog/1211779
-- 解决ORA-00904: "WMSYS"."WM_CONCAT": 标识符无效 的文件包....... -- 解决ORA-00904: "WMSYS"."WM_CONCAT": 标识符无效 的文件包....... -- 解决ORA-00904: "WMSYS"."WM_CONCAT": 标识符无效 的文件包....... ...
oracle报错ora-12541:TNS无监听程序
错误描述:oracle远程连接服务器出现 ORA-12170 TNS:连接超时 错误检查:有很多是oracle自身安装的问题,但是我这里服务器配置正常,监听正常,服务正常,远程可以ping通服务器。 这里主要是防火墙问题,解决办法: ...
解决ORACLE TNS: 无法解析指定的连接标识符; 里面有步骤
ora-12514:TNS:监听程序当前无法识别连接描述符中请求的服务bug,解决文档.
最近在工作中遇到了一个问题,错误是Oracle dbca时报错:ORA-12547: TNS:lost contact,通过查找相关的资料终于找到了解决的方法,下面分享给大家,话不多说了,来一起看看详细的介绍吧。 环境: OS:RHEL6.5 x86-...
CLOB字段类型报错 ORA-01704:文字字符串过长的解决
oracle19c缺少的函数
ORA-12541 TNSno listener 的解决方案 ORA-12541 TNSno listener 的解决方案
At the time of writing, patches were under development on top of 10.2.0.4 on some platforms. Please check Patch 7331323 for availability on your platform. The problem is resolved in 11.1.0.7. ...