Oracle Semaphore Management in UNIX Administration
Oracle UNIX/Linux Tips by Burleson Consulting
Semaphores and Oracle 11g
信号量和数据库
Semaphores are data structures within the operating system that function like signals for memory process communications. For Oracle, semaphores tell the Oracle processes when to stop, wait or start operations. In addition, semaphores tell Oracle processes when they are to resume processing. Each Oracle process has its own semaphore assigned to it.
For example, DBWR (Database Writer process) needs to flush the database buffer cache to write to the data files on disk. When it is time for DBWR to perform this task, DBWR semaphore signals to DBWR to flush the data from the buffer out to disk. With System V implementations and variations of the UNIX and LINUX operating system, some of the key parameters that manage the use and allocation of semaphores with Oracle 11g exist in the following operating system level parameters:
- SEMMNS: number of semaphores in the operating system.
- SEMMSL: size limit for a single semaphore set.
- SEMMNI: number of semaphore set identifiers in the operating system.
- SEMMNU: number of semaphore undo structures in the operating system.
The output of semaphores can be viewed by using the ipcs command for UNIX and Linux platforms as will be observed in the following section on shared memory and Oracle 11g.
Semaphore Management in UNIX
A semaphore is a term used for a signal flag used by the Navy to communicate between ships. In some dialects of UNIX, semaphores are used by Oracle to serialize internal Oracle processes and guarantee that one thing happens before another thing. Oracle uses semaphores in HP/UX and Solaris to synchronize shadow processes and background processes. However, AIX UNIX does not use semaphores, and a post/wait driver is used instead to serialize tasks.
The number of semaphores for an Oracle database is normally equal to the value of the processes initialization parameter. For example, a database where processes=200 would need to have 200 UNIX semaphores allocated for the Oracle database.
When allocating semaphore in UNIX, it is critical that your UNIX kernel parameter semmns be set to at least double the high-water mark of processes for every database instance on your server. If you fail to allocate enough semaphores by setting semmns too low, your Oracle database will fail at startup time with the message:
ORA-7279: spcre: semget error, unable to get first semaphore set
Let抯 talk about setting the semmns kernel parameter. To make changes in kernel shared memory or semaphore parameters, you need to perform the following steps:
1. Shut down any running Oracle instances
2. Locate the kernel configuration file for your OS
3. Make the necessary changes using the system utilities or the vi editor.
Today, most dialects of UNIX have specialized System Administration utilities to perform kernel management (Table 2-4)
|
UNIX Dialect |
Utility Name |
|
HP-UX |
SAM |
|
SCO |
SYSADMSH |
|
AIX |
SMIT |
|
Solaris |
ADMINTOOL |
UNIX kernel management tools
System Default values for semaphores
The number of UNIX semaphores is determined by the value of the semmns UNIX kernel parameter.
Viewing semaphores in HP/UX version 11
In HP/UX v 11, the command to display kernel parameters is kmtune and we can grep to see the semaphore settings.
root> kmtune|grep sem
sema 1
semaem 16384
semmap (SEMMNI+2)
semmni 200
semmns 800
semmnu 30
semume 10
semvmx 32767
Counting Used Semaphores
The ipcs UNIX command has a 杝a option that can be used to display semaphores. The total number of semaphores is determined by summing the NSEMS column in the ipcs display. In the example below we see that there are 4 semaphores held by the ROOT user and 475 semaphores held by the ORACLE user in 3 database instances.
root> ipcs -as|grep oracle
IPC status from /dev/kmem as of Mon Sep 10 17:25:21 2001
T ID KEY MODE OWNER GROUP CREATOR CGROUP NSEMS
s 15 0x00000000 --ra-r----- oracle dba oracle dba 400
To display semaphores with the ipcs command and remove them with ipcs -pmb, see my notes onManaging UNIX memory with IPCS
Next, let抯 take a look at how we can examine UNIX system log messages.
Displaying System log Messages
In UNIX, a system failure will often precipitate an Oracle crash. Any hardware associated with disk, CPU or RAM may cause an Oracle database crash, and the UNIX system logs can be used to identify the initial cause of the Oracle failure.
The following commands are used to display the UNIX error logs. We need to note that you should regularly check the UNIX logs, even if there is not Oracle failure. These commands can also be useful for detecting transient disk I/O problems, memory failures, etc.
Show server log on HP/UX
In HP/UX we have a file in the /var/adm directory called syslog to hold all UNIX system messages. In the command below we search the syslog for any lines that contain the word 揺rror�.
查看HP日志
root> grep 杋 error /var/adm/syslog/syslog.log|more
May 1 20:30:08 sprihp01 syslog: NetWorker media: (warning)
dev/rmt/c5t6d0BESTn reading: I/O error
Show server log on AIX
查看AIX日志
In the IBM AIX operating system we use the errpt command to display the contents of the system log.
root> errpt -a|more
---------------------------------------------------------------------------
LABEL: CORE_DUMP
IDENTIFIER: C60BB505
Date/Time: Tue May 9 10:34:47
Sequence Number: 24908
Machine Id: 000138644C00
Node Id: sp2k6n03
Class: S
Type: PERM
Resource Name: SYSPROC
Again, checking the UNIX system logs should be a regular activity for the Oracle DBA. Next, let抯 take a look at how UNIX can be monitored for performance problems.
转自:http://www.dba-oracle.com/unix_linux/semaphore_management.htm
Oracle Semaphore Management in UNIX Administration的更多相关文章
- Oracle User Management FAQ翻译及学习笔记
转载 最近了解到AME 的东西,很迫切,先转载一篇 [@more@] Oracle User Management FAQ翻译及学习笔记 写在前面 本文主要是翻译的英文版的Oracle User Ma ...
- Oracle Order Management DropShip Flow for R12
Oracle Order Management DropShip Flow for R12 Email ThisBlogThis!Share to TwitterShare to FacebookSh ...
- Oracle DBA 的常用Unix参考手册(一)
作为一名Oracle DBA,在所难免要接触Unix,但是Unix本身又是极其复杂的,想要深刻掌握同样很不容易.那么到底我们该怎么入手呢?Donald K Burleson 的<Unix for ...
- Oracle Inventory Management Application Program Interface ( APIs)
In this Document Goal Solution References APPLIES TO: Oracle Inventory Management - Version 12 ...
- Run Repository Creation Utility (RCU) for Oracle Identity Management components
Run Repository Creation Utility (RCU) for Oracle Identity Management components Installing O ...
- Oracle Inventory Management Application Program Interface ( APIs) (Doc ID 729998.1)
In this Document Goal Solution References APPLIES TO: Oracle Inventory Management - Version 12.0.0 a ...
- Oracle Metadata Management (OMM)元数据管理 12.2.1发布
元数据管理元数据管理是解决大量关键业务和技术挑战的基础,这些挑战包括元数据实体有多少,上游数据变化的影响,在浏览器中提供友好的分析展现界面,或提供企业范围内的元数据现状分析和改进视图.OMM是一款基于 ...
- Oracle DBA 的常用Unix参考手册(二)
9.AIX下显示CPU数量 # lsdev -C|grep Process|wc -l10.Solaris下显示CPU数量# psrinfo -v|grep "Status of pr ...
- 并发处理 - 配置文件"并发:报表访问层"的设置 (Doc ID 1625757.1)
文档内容 目标 解决方案 适用于: Oracle Concurrent Processing - 版本 12.0.0 到 12.2 [发行版 12 到 12.2] 本文档所含信息适用于所有平台 ...
随机推荐
- jquery优化引发的思考
无意间看到jquery优化的一个细节让我觉得不可思议记录一下.仅仅只是换个地方代码就能提高数倍的效率,带给我的不是个仅是个小技巧,而是一总编程思想,技术大牛往往是在细节上体现. 通过缓存最小化选择操作 ...
- django 使用jquery ajax post数据问题
django 开启了CSRF功能导致jquery ajax post数据报错 解决方法在post数据里引入csrfmiddlewaretoken: '{{ csrf_token }}'},同时需要在f ...
- [转]在ITunes播放中前进、后退五秒的快捷键
在ITunes播放中前进.后退五秒的快捷键 如题,快捷键为Command+Alt+方向键.听Podcast一两句没听清楚的时候很有用. reference: http://mac.pcbeta.com ...
- setTimeout setInterval 带参数的问题
转载http://www.jb51.net/article/36233.htm 在JS中无论是setTimeout还是setInterval,在使用函数名作为调用句柄时都不能带参数,而在许多场合必须要 ...
- C函数指针简单用例
(1)函数指针:可以指向 一类 固定形参类型和返回值类型 的函数 的指针声明:int fun(int, int) || \/int (*pfun)(int, int) pfun就是函数指针 ...
- SQL Server 影响dbcc checkdb的 8 种因素
第一种: 数据库的大小. 第二种: IO系统的速度. 第三种: 当前CPU的负荷. 第四种: 当前数据库的并发修改量.因为并发修改量越大维护数据库快照的成本就越高,dbcc 的过程中要创建快照,所以. ...
- Git学习04 --分支管理
每次commit,Git都把它们串成一条时间线,这条时间线就是一个分支.截止到目前,只有一条时间线,在Git里,这个分支叫主分支,即master分支.HEAD严格来说不是指向提交,而是指向master ...
- jquery跨域访问解决方案(转)
客户端“跨域访问”一直是一个头疼的问题,好在有jQuery帮忙,从jQuery-1.2以后跨域问题便迎刃而解.由于自己在项目中遇到跨域问题,借此机会对跨域问题来刨根问底,查阅了相关资料和自己的实践,算 ...
- android关于window
http://mobile.51cto.com/android-259922_all.htm http://mobile.51cto.com/android-259922.htm http://mob ...
- delphi 修改代码补全的快捷键(由Ctrl+Space 改为 Ctrl + alt + Space)(通过修改OpenTool生效)
delphi 的IDE快捷键与输入法切换键中突,以往的解决方法是下载一个ImeTool修改 windows 系统的快捷键 在 xp win7 都好使,但在win 10经常是修改完后,重启又失效了. 本 ...