AIX系统的非计算内存最大值设置过大导致Oracle数据库有些不能连接上
AIX系统、Oracle数据库以及其监听器都没有做任何的修改,发现连接远程的数据库,有时可以连接上,有时连接不上数据库。
错误描述:
AIX系统、Oracle数据库以及其监听器都没有做任何的修改,发现连接远程的数据库,有时可以连接上,有时连接不上数据库。
1、连接不上数据库时:回报ORA-12537:TNS连接己关闭
2、发现alert_SID.log没有发现错误
3、查看$ORACLE_HOME/network/log/listener.log日志错误如下:
25-MAY-2010 18:54:26 * (CONNECT_DATA=(SERVICE_NAME=testoms)(CID=(PROGRAM=D:\项目资料\plsqldev\plsqldev.exe)(HOST=89587D60816246E)(USER=Administrator))) * (ADDRESS=(PROTOCOL=tcp)(HOST=10.88.22.77)(PORT=4954)) * establish * testoms * 12518
TNS-12518: TNS:listener could not hand off client connection
TNS-12547: TNS:lost contact
TNS-12560: TNS:protocol adapter error
TNS-00517: Lost contact
IBM/AIX RISC System/6000 Error: 32: Broken pipe
原因分析:
连接数据库,有时可以连接,有时连接不上。
用ping数据库ip -t 发现网络很稳定
一般出现上面的ora-12537错误,一般是因为数据库的listener.ora文件没有配置好,导致这样的错误。但没有改变过该文件,,原来连接数据库一直很正常,突然发现有时能连接有时不能连接的现象。
用lsnrct status查看该监听正常。
该库为测试库,尝试了关闭数据库,再启动
>shutdown immediate 关闭正常
但启动时出现下面的错误
SQL> startup
Could not load program oracletestoms:
Could not load module /usr/lib/libperfstat.a(shr_64.o).
Dependent module liblvm.a(shr_64.o) could not be loaded.
Could not load module liblvm.a(shr_64.o).
System error: Not enough space
Could not load module oracle.
Dependent module /usr/lib/libperfstat.a(shr_64.o) could not be loaded.
Could not load module .
ORA-12547: TNS:lost contact
再次启动的错误又不一样:
SQL> startup
ORA-00443: background process "MMAN" did not start
感到这是AIX系统出现的问题,查看下交换空间
omstestdb:/> lsps -a
Page Space Physical Volume Volume Group Size %Used Active Auto Type
Could not load program /usr/bin/sed:
Dependent module libc.a(shr.o) could not be loaded.
Could not load module libc.a(shr.o).
Could not load program /usr/bin/awk:
Dependent module libc.a(shr.o) could not be loaded.
Could not load module libc.a(shr.o).
0517-041 lsps: Cannot list paging space .
提示不能列出交换空间的大小,从这可以知道这是由于AIX的内存耗尽。
用topas查看目前的AIX查看内存及其交换空间的使用情况。
AIX的comp(计算内存)使用了4 GB,而nocomp(非计算内存)也使用了4GB,而交换空间则有很多的空闲。系统总共8GB的内存,而oracle中内存一般使用comp内存。而oracle的缓存则使用nocomp,有很多sql语句一直没有释放,使用了4GB的内存,而AIXnocomp的最大值也为4GB,导致内存不足。
限制AIX的nocomp(非计算)内存最大值。
把AIX的
minperm% = 20
maxclient% = 80
maxperm% = 80
调整更低。
解决步骤:
查看原来的AIX的minperm%、maxclient%、maxperm%的值。如下:
Root用户查看:
>vmo –a
minperm% = 20
maxclient% = 80
maxperm% = 80
把minperm%设置成10,maxclient%设置成20,maxperm%设置成20
用root命令行执行:
1、
vmo -p -o minperm%=10
2、
vmo -p -o maxclient%=20
3、
vmo -p -o maxperm%=20
执行上面的操作,AIX的nocomp还不能释放内存,重启了AIX系统
# reboot
重启之后,重启oracle以及监听器
SQL>startup
$lsnrctl start
启动数据库及其监听器均正常,连接数据库则正常。
备注:
minperm 和 maxperm 参数的值
操作系统通过把在曾经读写的内存页留在实内存一满足不同要求。如果文件页面在它们的页帧被重新分配前被请求,那就节省了输入输出操作。该文件页面可以来自本地的或远程的(如 NFS)系统。
页帧使用的文件相对用于计算的(工作或程序文本)段的文件的比例是松散地受控于 minperm 和 maxperm 的值的:
如果 RAM 中文件页面所占的百分比高于 maxperm,页面替换的窃取只用于文件页。
如果 RAM 中文件页面所占的百分比低于 minperm,页面替换的窃取同时用于文件页和计算页。
如果 RAM 中文件页面所占的百分比介于 minperm 和 maxperm之间,页面替换只窃取文件页,除非文件页的重调入数量大于计算页数。
其中Noncomp在20%-80%之间,此时内存页交换算法通常只交换文件缓存页,但如果文件缓存页的交换率大于程序页时,程序页也同样被交换。由于SGA属于Comp页,数据文件缓存属于Noncomp页,而在数据大量访问时,文件缓存页的交换率大于程序页(SGA),因此大量的SGA页面被交换;为避免大量SGA页被交换,需要降低maxperm%值到35%以下,这样就只有文件缓存页面被交换,减少了SGA交换的次数。

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

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

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

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

Hot Topics

How to check which table space a table belongs to in Oracle: 1. Use the "SELECT" statement and specify the table name to find the table space to which the specified table belongs; 2. Use the database management tools provided by Oracle to check the table space to which the table belongs. Tools usually provide a graphical interface, making the operation more intuitive and convenient; 3. In SQL*Plus, you can view the table space to which the table belongs by entering the "DESCRIBEyour_table_name;" command.

Overview of how to use PDO to connect to Oracle database: PDO (PHPDataObjects) is an extension library for operating databases in PHP. It provides a unified API to access multiple types of databases. In this article, we will discuss how to use PDO to connect to an Oracle database and perform some common database operations. Step: Install the Oracle database driver extension. Before using PDO to connect to the Oracle database, we need to install the corresponding Oracle

Steps for Oracle to fetch only one piece of duplicate data: 1. Use the SELECT statement combined with the GROUP BY and HAVING clauses to find duplicate data; 2. Use ROWID to delete duplicate data to ensure that accurate duplicate data records are deleted, or use "ROW_NUMBER" ()" function to delete duplicate data, which will delete all records except the first record in each set of duplicate data; 3. Use the "select count(*) from" statement to return the number of deleted records to ensure the result.

Implementing data import into PHP and Oracle databases In web development, using PHP as a server-side scripting language can conveniently operate the database. As a common relational database management system, Oracle database has powerful data storage and processing capabilities. This article will introduce how to use PHP to import data into an Oracle database and give corresponding code examples. First, we need to ensure that PHP and Oracle database have been installed, and that PHP has been configured to

The oracle database requires jdk. The reasons are: 1. When using specific software or functions, other software or libraries included in the JDK are required; 2. Java JDK needs to be installed to run Java programs in the Oracle database; 3. JDK provides Develop and compile Java application functions; 4. Meet Oracle's requirements for Java functions to help implement and implement specific functions.

How to efficiently use connection pooling in PHP and Oracle databases Introduction: When developing PHP applications, using a database is an essential part. When interacting with Oracle databases, the use of connection pools is crucial to improving application performance and efficiency. This article will introduce how to use Oracle database connection pool efficiently in PHP and provide corresponding code examples. 1. The concept and advantages of connection pooling Connection pooling is a technology for managing database connections. It creates a batch of connections in advance and maintains a

How to use PHP to extend PDO to connect to Oracle database Introduction: PHP is a very popular server-side programming language, and Oracle is a commonly used relational database management system. This article will introduce how to use PHP extension PDO (PHPDataObjects) to connect to Oracle database. 1. Install the PDO_OCI extension. To connect to the Oracle database, you first need to install the PDO_OCI extension. Here are the steps to install the PDO_OCI extension: Make sure

Oracle's steps to determine whether a table exists in a stored procedure: 1. Use the "user_tables`" system table to query the table information under the current user, compare the incoming table name "p_table_name" with the "table_name" field, and if the conditions are met, then "COUNT(*)" will return a value greater than 0; 2. Use the "SET SERVEROUTPUT ON;" statement and the "EXEC`" keyword to execute the stored procedure and pass in the table name to determine whether the table exists.
