Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Got minus one from a read call and ORA-27154 of oracle: post/wait create failed

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

When deploying an application, sometimes the application can be started directly, but occasionally the application cannot be started. The error message is:

Java.sql.SQLRecoverableException: IO Error: Got minus one from a read call as shown in the figure:

Causes and solutions

I have several applications that need to connect to the database, and tests have found that if the application is started at the beginning, it will not report an error, and if it starts several applications and then starts, it will be wrong.

An application connects to the database through the connection pool mechanism. The database uses a parameter max-session to describe the size of the connection pool, while the application also has a parameter, which indicates the minimum resources it takes to connect to the database connection pool. For example, a total of 10 applications need to connect to the database, if the minimum number of connections for each application to the database is 10 Then 10 applications will have a total of 100 connections (which can be regarded as the number of threads), which requires that the max-session of the database connection pool must be greater than 100, otherwise a "Got minus one from a read call" error will be reported.

Therefore, there are two ways to solve this problem:

(1) expand the database connection pool, which requires the assistance of the system database administrator.

(2) reduce the number of initialization connections needed to connect to the database.

My application is a java application. The configuration of the database is in the configuration file jdbc.properties, which is as follows:

Jdbc.driverClass=oracle.jdbc.driver.OracleDriver

Jdbc.url=jdbc:oracle:thin:@nantianpaydb.baidupay.com:8002:ntpzn

Jdbc.user=cif

Jdbc.password=cif

# druid datasource

Druid.initialSize=10

Druid.minIdle=10

Druid.maxIdle=100

Druid.maxActive=500

Druid.maxWait=30000

Druid.timeBetweenEvictionRunsMillis=60000

Druid.minEvictableIdleTimeMillis=300000

Druid.validationQuery=SELECT 1 from dual

Druid.testWhileIdle=true

Druid.testOnBorrow=false

Druid.testOnReturn=false

Druid.poolPreparedStatements=true

Druid.maxPoolPreparedStatementPerConnectionSize=20

Druid.filters=wall,stat

Among them

Druid.initialSize=10

Is an application connection database initialization parameters, as long as it can be reduced to solve the problem.

Extension: if the database cannot start due to the adjustment of process, the error is as follows

ORA-27154: post/wait create failed

ORA-27300: OS system dependent operation:semget failed with status: 28

ORA-27301: OS failure message: No space left on device

ORA-27302: failure occurred at: sskgpcreates

When confirming that the storage and memory of df-h and free-m are sufficient, pay attention to whether the sem semaphore is set improperly

# cat / proc/sys/kernel/sem

250 32000 32 128

-- corresponding to the above

# semaphores: semmsl, semmns, semopm, semmni

Set up SEMMSL

The SEMMSL kernel parameter is used to control the maximum number of signals per signal set.

Oracle recommends that you set SEMMSL to the maximum PROCESS instance parameter setting in the init.ora file, which applies to all databases on Linux systems, plus 10. In addition, Oracle recommends that you set SEMMSL to not less than 100.

Set up SEMMNI

The SEMMNI kernel parameter is used to control the maximum number of signal sets in the entire Linux system. Oracle recommends that you set SEMMNI to not less than 100.

Set up SEMMNS

The SEMMNS kernel parameter is used to control the maximum number of signals (rather than signal sets) in the entire Linux system.

Oracle recommends that you set SEMMNS to the sum of the PROCESSES instance parameter settings for each database on the system, plus twice the maximum PROCESSES, and finally add 10 to each Oracle database on the system.

Use the following formula to determine the maximum number of signals that can be allocated on the Linux system. It will be the smaller of the following two values:

SEMMNS-or- (SEMMSL * SEMMNI)

Set up SEMOPM

The SEMOPM kernel parameter is used to control the number of signaled operations that can be performed by each semop system call.

Semop system call (function) can use a semop system call to complete the operation of multiple signals. A signal set can have the maximum number of SEMMSL per signal set, so it is recommended that SEMOPM be set to equal to SEMMSL.

Oracle recommends that you set SEMOPM to not less than 100.

Set signal kernel parameters

Finally, let's look at how to use some methods to set all the signal parameters. In the following paragraphs, the only parameter I want to change (add) is SEMOPM. All other default settings fully satisfy our sample installation.

You can change the default settings for all signal settings without having to reboot the computer by directly changing the / proc file system (/ proc/sys/kernel/sem) by using the following command:

# sysctl-w kernel.sem= "250 32000 100128"

You can then make this change permanent by inserting the kernel parameter into the / etc/sysctl.conf startup file:

# echo "kernel.sem=250 32000 100128" > > / etc/sysctl.conf

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report