Oracle Diagnostics case-SGA and swap two

Source: Internet
Author: User
Tags sleep
Oracle




Link

Http://www.eygle.com/case/sga2.htm

Case Description:

This is a large production system
System accumulates a large number of user processes when problems arise
User requests do not respond in a timely manner, and new processes continue to attempt to establish a connection
The number of connections is quickly exhausted

Database version: 9.2.0.3
Operating system: SOLARIS8



1. Check Alert file

The following error message is logged, stating that there is a problem with the disk asynchronous IO:





Warning:aiowait timed out 2 times
Tue Aug 26 15:33:32 2003
Warning:aiowait timed out 2 times
Tue Aug 26 15:33:34 2003
Warning:aiowait timed out 2 times
Tue Aug 26 15:33:36 2003
Warning:aiowait timed out 2 times
Tue Aug 26 15:33:38 2003
Warning:aiowait timed out 2 times
Tue Aug 26 15:33:43 2003
Warning:aiowait timed out 1 times
Tue Aug 26 15:33:46 2003
Warning:aiowait timed out 1 times
Tue Aug 26 15:33:49 2003
Warning:aiowait timed out 1 times
Tue Aug 26 15:33:51 2003
Warning:aiowait timed out 1 times
Tue Aug 26 15:33:52 2003
Warning:aiowait timed out 1 times
Tue Aug 26 15:33:53 2003
Warning:aiowait timed out 1 times
.............


We know there are problems with asynchronous IO on some versions of sun
and asynchronous IO is open by default





Sql> Show Parameter Disk_a

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
Disk_asynch_io Boolean TRUE



For this issue, we deactivated the asynchronous IO write for the database.

2. Shared memory problem

The following error message is also logged in the alert file:




Tue Aug 26 21:37:40 2003
Warning:einval creating segment of size 0x0000000190400000
Fix SHM parameters In/etc/system or equivalent





This information indicates that the kernel parameter setting is too small or does not match the SGA

We check the system configuration file





$ cat/etc/system
.......................
Set shmsys:shminfo_shmmax=4096000000
Set Shmsys:shminfo_shmmin=1
Set shmsys:shminfo_shmmni=200
Set shmsys:shminfo_shmseg=200
Set semsys:seminfo_semmap=1024
Set semsys:seminfo_semmni=2048
Set semsys:seminfo_semmns=2048
Set semsys:seminfo_semmnu=2048
Set semsys:seminfo_semume=200
Set semsys:seminfo_semmsl=2048





We found that the maximum shared memory setting was only 4G



3. Check the SGA settings




Sql*plus:release 9.2.0.3.0-production on Tuesday August 26 21:46:35 2003

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.3.0-64bit Production
With the partitioning, OLAP and Oracle Data Mining options
Jserver Release 9.2.0.3.0-production

Sql> Show SGA

Total System Global area 6695660272 bytes
Fixed Size 740080 bytes
Variable Size 2399141888 bytes
Database buffers 4294967296 bytes
Redo buffers 811008 bytes






We found that the SGA setting was close to 7G, which is why the error prompt occurred in step 2


4. Exchange Zone Issues

We use top tool to check system health





#/usr/local/bin/top

Last pid:16899; Load averages:0.82, 0.81, 0.83 21:49:05
1230 processes:1228 sleeping, 1 running, 1 on CPU
CPU states:50.1% Idle, 7.4% user, 8.6% kernel, 33.9% iowait, 0.0% swap
memory:8192m Real, 118M free, 12G swap with use, 11G swap free

PID USERNAME THR PRI Nice SIZE RES the state time CPU COMMAND
15751 Oracle 0 6456M 6408M sleep 0:02 0.49% Oracle
15725 Oracle 0 6458M 6410M sleep 0:02 0.46% Oracle
251 Root 0 7096K 1944K sleep 126:00 0.45% PICLD
16540 Oracle 0 6458M 6411M sleep 0:01 0.45% Oracle
16766 Root 1 0 3744K 2248K cpu/1 0:01 0.41% Top
16408 Oracle 0 6457M 6410M sleep 0:01 0.34% Oracle
15989 Oracle 0 6458M 6409M sleep 0:01 0.34% Oracle
15919 Oracle 0 6457M 6409M sleep 0:02 0.30% Oracle
16404 Oracle 0 6457M 6409M sleep 0:00 0.28% Oracle
16327 Oracle 0 6457M 6410M sleep 0:00 0.27% Oracle
14870 Oracle 0 6457M 6412M sleep 0:05 0.24% Oracle
16851 Oracle 0 6457M 6411M sleep 0:00 0.22% Oracle
16467 Oracle 0 6457M 6409M sleep 0:00 0.21% Oracle
16163 Oracle 0 6457M 6408M sleep 0:03 0.21% Oracle
15159 Oracle 0 6457M 6408M sleep 0:05 0.21% Oracle





memory:8192m Real, 118M free, 12G swap with use, 11G swap free

We found that the system had only 8G RAM and that only 118M of physical memory was available
The swap area now uses 12G.

We have made the following preliminary judgment:

The SGA is set too large (nearly 7G) resulting in a large exchange at runtime

Large swap swap to raise disk problems
This should be the first step we see
Warning:aiowait timed out 1 times
The reason

Massive exchange results in a sharp drop in database performance
In turn, the user requests are not quickly responded to, blocked, accumulated, until the database is out of response





5. The solution

This problem is mainly due to improper setting of SGA, we narrowed the SGA settings immediately:

Sql> Show SGA

Total System Global area 3591870848 bytes
Fixed Size 735616 bytes
Variable Size 1442840576 bytes
Database buffers 2147483648 bytes
Redo buffers 811008 bytes

At this time, the database reduces the exchange, achieves the stable operation, the user request can obtain the quick response.

Problem solving is complete.



6. System Status

System Health after adjustment:






$ top Last pid:12745; Load averages:0.46, 0.79, 0.65 22:22:49228 processes:227 sleeping, 1 on cpucpu states:92.3% idle, 5.0% user, 1.6% Kerne L, 1.1% iowait, 0.0% swapmemory:8192m Real, 3817M free, 4015M swap with, 15G swap free PID USERNAME THR PRI Nice SIZE R ES state time CPU COMMAND 12610 Oracle 1/0 3511M 22M sleep 0:04 1.96% Oracle 12595 Oracle 1 0 3511M 22M sleep 0:03 0 92% Oracle 12630 Oracle 1 0 3511M 21M sleep 0:01 0.84% Oracle 12614 Oracle 1 0 3511M 22M sleep 0:01 0.64% Oracle 12 620 Oracle 1 0 3511M 22M 0:01 0.53% Oracle 12709 Oracle 1 0 3511M 21M sleep 0:00 0.45% Oracle 265 root 11 38 0 7032K 1920K sleep 3:16 0.42% picld 12729 Oracle 1 0 0 3511M 20M sleep 0:00 0.26% Oracle 12741 Oracle 1 0 2768K 1760K C PU/3 0:00 0.19% Top 12745 Oracle 1 0 3506M 16M sleep 0:00 0.17% Oracle 12711 Oracle 1 0 3506M 16M sleep 0:00 0.11% o Racle 12738 Oracle 1 0 3506M 16M sleep 0:00 0.06% Oracle 7606 Oracle 1 0 17M 6928K sleep 0:07 0.05% Tnslsnr 12721 or ACLE 1 0 3506M 16M 0:00 0.05% Oracle 12723 Oracle 1 0 3506M 16M sleep 0:00 0.05% Oracle

After the system has been adjusted, it has been running steadily so far.



A little summary:

This case is very similar to the other one I mentioned earlier.
The same is the problem of database caused by improper setting of SGA

itself is not complicated.
This type of problem should be avoided in the database planning and construction phase.

The problem is more like a psychological test to me.
When all the bosses are standing behind you, can you calm and quickly find and solve the problem.

There are a lot of general conditions and incentives for aiowait timed out on Sun
I also have a corresponding case description behind.

-eygle






Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.