Ipcs commands and oracle memory segments

Source: Internet
Author: User

Today is February 6,. before the Spring Festival, I will review what I learned in October. I have detailed operations on the oracle memory segment in my previous blog. Record the usage of the ipcs command here.

Http://blog.csdn.net/xiaohai20102010/article/details/9634099

Ipcs command usage

Report the status of inter-process communication facilities.

Syntax

Ipcs [-m] [-q] [-s] [-S] [-P] [-l] [-a |-B-c-o-p-t] [-T] [-C CoreFile] [-N Kernel]

Description

The ipcs command writes some information about the communication facilities between active processes to the standard output. If no flag is specified, the ipcs command writes some topics about the active message queue, shared memory segment, semaphore, remote queue, and local queue in a short format.

The column title and the meaning of the column in the ipcs command are listed below. The letters in parentheses indicate the identifier that causes the corresponding header to appear. The all designer indicates that the header is always displayed. These logos only determine the information provided to each device. However, they are not sure which devices will be listed.

T The type of the (all) facility. There are three types of facilities:
Q message queue
M shared memory segments
S semaphore
ID (All) The identifier of the Facility item.
KEY (All) keys used as parameters of msgget subroutines, semget subroutines, or shmget subroutines constitute facility items.

 

Note: When the memory segment is deleted, the key of the shared memory segment is changed to IPC_PRIVATE until all processes attached to the segment are detached from it.
MODE (All) access method and flag of the facility. This method consists of 11 characters and is interpreted as follows:

The first two characters are as follows:

R if the process is waiting for the msgrcv system to call.
S if the process is waiting for the msgsnd system to call.
D. If the shared memory segment is deleted. After the last process attached to the segment is detached, it disappears.
C. When the first append process is running, if the related shared memory segments are cleared.
-If no specific flag is set.
R if read permission is granted.
W if the write permission is granted.
A. if the permission for modification is granted.
-If no permission is granted.

The next nine characters are interpreted as a group of three. The first group indicates that the owner has the permission. The second group refers to the permission of other users in the user group of the Facility item. The last group refers to all users. In each group, the first character indicates that read is allowed, and the second character indicates that facility items can be written or modified. The last character is not used currently.

The permissions are as follows:

OWNER (All) the login name of the Facility item owner.
GROUP (All) name of the group with facilities.
CREATOR (A, c) the login name of the creator of the Facility item.
CGROUP (A, c) the group name of the creator of the Facility item.

 

Note: For OWNER, GROUP, CREATOR, and CGROUP, the user and GROUP IDs are displayed without the logon name.
CBYTES (A, o) the number of bytes of messages currently in the relevant message queue.
QNUM (A, o) the number of bytes of messages currently in the relevant message queue.
QBYTES (A and B) Maximum number of bytes allowed for messages staying in the relevant message queue.
LSPID (A, p) ID of the final process that sends a message to the relevant queue. If the last message sent is a process on the node rather than a queue on the node, LSPID is the PID of the kernel process that actually puts the message into the queue, rather than the PID of the sending process.
LRPID (A, p) process ID for receiving messages from related queues. If the last received message comes from a process on a node rather than a node that retains the queue, LRPID is the PID of the kernel process that actually receives the message on the queue, rather than the PID of the receiving process.
STIME (A, t) the time when the last message is sent to the relevant queue. For remote queues, This is the server time. No action is taken to compensate for the time zone difference between the local clock and the server clock.
RTIME (A, t) time when the last message from the relevant queue is accepted. For remote queues, This is the server time. No action is taken to compensate for the time zone difference between the local clock and the server.
CTIME (A, t) the time for creating and changing related items. For remote queues, This is the server time. There is no way to make any time zone difference between the local clock and the server clock.
NATTCH (A, o) number of processes connected to the associated shared memory segment.
SEGSZ (A, B) the size of the associated shared memory segments.
CPID (A, p) process ID of the Creation Program of the shared memory item.
LPID (A, p) identify the last process connecting to or detaching the shared memory segment.
ATIME (A, t) The last time the connection was established with the associated shared memory segment.
DTIME (A, t) The last time the shared memory segment is split.
NSEMS (A and B) the number of semaphores IN THE SIGNAL set associated with the signal item.
OTIME (A, t) the time when the semaphore operation is completed in the associated semaphore.
SID (S) ID of the shared memory segment. SID can be used as the input of the svmon-S command.

This command supports multi-byte character sets.

Flag
- Use the-B,-c,-o,-p, and-t signs.
-B The maximum number of bytes of messages written to the queue, the size of the shared memory segment, and the number of semaphores in each semaphores.
-C Write the login name and group name of the user who built the facility.
-CCoreFile Replace the/dev/mem file with the file specified by the CoreFile parameter. The CoreFile parameter is a memory image file created by pressing the Ctrl-(left) Alt-Pad1 in sequence.
-L When used with the-S flag, the flag is written to the list of unexpanded SID.
-M Write information about the active shared memory segments.
-NKernel Use the specified Kernel (/usr/lib/boot/unix files are default ).
-O Write the following usage information:
  • Number of messages in the queue
  • Total number of bytes of messages in a message queue
  • Number of processes connected to the shared memory segment
-P Write process ID information:
  • The process Number of the received message in the message queue and the process number of the sent message in the message queue.
  • Process ID of the created Process
  • Process ID of the last connection or detached from the shared memory segment
-P Write the list of SID (segment ID) related to the shared memory ID, the number of bytes retained in that segment, and whether the segment has enabled a large page flag. If the segment supports large pages, a 'y' is displayed; otherwise, a '-' is displayed '-'.
-Q Write information about the active message queue.
-S Write information about the active semaphore set.
-S Write the list of SID connected to the shared memory identifier.
-T Write time information:
  • The time for the last control operation to change the access permission of all devices.
  • The last time msgsnd and msgrcv were executed in the message queue.
  • The last time shmat and shmdt were executed on the shared memory.
  • The time when semop was last executed on the semaphore set.
-T Write the output with the-t mark of the date.
Note:
  1. If the user specifies the-C or-N mark, the real-type and valid UID/GID are set to the real-type UID/GID of the user who calls ipcs. You can change the value when running ipcs. The information provided by ipcs is correct only when you retrieve it. Example

    The example shows the input with no flagIpcs: Output

     

    IPC status from /dev/mem as of Mon Aug 14 15:03:46 1989T    ID         KEY        MODE       OWNER     GROUPMessage Queues:q       0    0x00010381 -Rrw-rw-rw-   root      systemq   65537    0x00010307 -Rrw-rw-rw-   root      systemq   65538    0x00010311 -Rrw-rw-rw-   root      systemq   65539    0x0001032f -Rrw-rw-rw-   root      systemq   65540    0x0001031b -Rrw-rw-rw-   root      systemq   65541    0x00010339--rw-rw-rw-    root      systemq       6    0x0002fe03 -Rrw-rw-rw-   root      systemShared Memory:m   65537    0x00000000 DCrw-------   root      systemm  720898    0x00010300 -Crw-rw-rw-   root      systemm   65539    0x00000000 DCrw-------   root      systemSemaphores:s  131072    0x4d02086a --ra-ra----   root      systems   65537    0x00000000 --ra-------   root      systems 1310722    0x000133d0 --ra-------   7003      30720
    File

     

    /Usr/lib/boot/unix Specify the system kernel image.
    /Dev/mem Memory.
    /Etc/passwd Specify the user name.
    /Etc/group Group name.
    /Usr/include/sys/ipc. h Contains header files.

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.