onstat -g nsc command: Print current shared memory connection information

Use the onstat -g nsc command to display information about shared memory connections either for all of the current connections or for a specified connection ID.

Figure 1. Syntax:

1  onstat   -g nsc?  client_id

If no client_id is provided, information about all current shared memory connections to the database server is given. If a client_id is provided then this command gives more detailed information about the shared memory connection with that ID.

Example output

This is output of onstat -g nsc with no client_id. It shows that there is only one user currently connecting to the database server through shared memory. That connection has an ID of 0.

Figure 2. onstat -g nsc command output
                                                                                
  clientid  clientPID      state #serverbufs #clientbufs    #rdwrts             
         0       6031  Connected           4           4         12             

This example shows output from running the command using a client_id of 0.

Figure 3. onstat -g nsc command with client id output
Network Shared Memory Status for Client: 0                                      
                                                                                
    clientid    clientPID        state  #serverbufs  #clientbufs      #rdwrts   
           0        18949    Connected            4            4       447048   
                                                                                
     needbuf        segid        semid       semnum     be_semid    be_semnum   
           0         1303       851969            0       851969           10   
                                                                                
  be_curread  be_curwrite   fe_curread  fe_curwrite                             
          -1            1            0            2                             
                                                                                
 be_nextread be_nextwrite  fe_nextread fe_nextwrite                             
           2            2            4            3                             
                                                                                
readyqueue                                                                      
  -1   -1   -1   -1   -1   -1   -1   -1   -1   -1   -1                          

     Server Buffers                             Client Buffers                  
  i: bufid     status   offset  fe_addr         bufid     status   offset  fe_addr
  0:     4      inuse     4474   804474             0      avail     3424   803424
  1:     5      inuse     4888   804888             1      avail     3838   803838
  2:     6      avail     4c9c   804c9c             2      inuse     3c4c   803c4c
  3:     7      avail     50b0   8050b0             3      avail     4060   804060
  4:    -1       free        0        0            -1       free        0       0
  5:    -1       free        0        0            -1       free        0       0

Output description

clientid
Server assigned ID
clientPID
Client process ID
state
State of connection
Connected
The client has established a connection with the server.
Con1
The server has successfully set up a connection with the client, but the client has not yet been notified of it.
Waiting
The server is in the process of setting up a connection with the client.
Reject
Client connection has been rejected by the server, normally because the server is shutting down or not yet in on-line mode.
Closed
Server has closed the connection with the client. Client might not be aware of the fact yet.
Not connected
Server is initializing internal structures for the connection.
Unknown
Connection has been closed and the client is aware of the fact. Server is cleaning up internal structures.
#serverbufs
Database server buffers currently allocated
#clientbufs
Client buffers currently allocated
#rdwrts
The total number of reads and writes performed through this connection since it was created.
The following items are only in the output if you run the onstat -g nsc command with a client_id:
needbuf
Indicates if server is waiting for a buffer to be freed
0
False
1
True
segid
Shared memory segment ID
semid
Semaphore ID
semnum
Semaphore number in the semaphore ID
be_semid
Backend semaphore ID
be_semnum
Backend semaphore number in the semaphore ID
be_curread
ID of backend buffer being read
be_curwrite
ID of backend buffer being written
fe_curread
ID of frontend buffer being read
fe_currwrite
ID of frontend buffer being written
be_nextread
ID of next backend buffer to be read
be_nextwrite
ID of next backend buffer to be written
fe_nextread
ID of next frontend buffer to be read
fe_nextwrite
ID of next frontend buffer to be written
readyqueue
Queue of the shared memory buffer ids
Buffers
i
Internal location key of message buffer
bufid
Message buffer ID
status
Status of message buffer
offset
Offset of memory buffer in shared memory segments
fe_addr
Frontend address of message buffer