管理员命令

启动数据库到在线模式

启动SinoDB。通过这个命令启动后,SinoDB进入在线服务状态,可以对外提供联机服务。
语法:

oninit -v

操作演示

[informix@vm84145 ~]$ oninit -v
Reading configuration file '/home/informix/sinodb/etc/onconfig.sinodb'...succeeded
Creating /INFORMIXTMP/.infxdirs...succeeded
Allocating and attaching to shared memory...succeeded
Creating resident pool 22166 kbytes...succeeded
Creating infos file "/home/informix/sinodb/etc/.infos.sinodb"...succeeded
Linking conf file "/home/informix/sinodb/etc/.conf.sinodb"...succeeded
Initializing rhead structure...rhlock_t 32768 (1024K)... rlock_t (13281K)... Writing to infos file...succeeded
Initialization of Encryption...succeeded
Initializing ASF...succeeded
Initializing Dictionary Cache and SPL Routine Cache...succeeded
Initializing encryption-at-rest if necessary...succeeded
Bringing up ADM VP...succeeded
Creating VP classes...succeeded
Forking main_loop thread...succeeded
Initializing DR structures...succeeded
Forking 1 'soctcp' listener threads...succeeded
Starting tracing...succeeded
Initializing 32 flushers...succeeded
Initializing SDS Server network connections...succeeded
Initializing log/checkpoint information...succeeded
Initializing dbspaces...succeeded
Opening primary chunks...succeeded
Validating chunks...succeeded
Initialize Async Log Flusher...succeeded
Starting B-tree Scanner...succeeded
Init ReadAhead Daemon...succeeded
Init DB Util Daemon...succeeded
Initializing DBSPACETEMP list...succeeded
Init Auto Tuning Daemon...succeeded
Checking database partition index...succeeded
Initializing dataskip structure...succeeded
Checking for temporary tables to drop...succeeded
Updating Global Row Counter...succeeded
Forking onmode_mon thread...succeeded
Creating periodic thread...succeeded
Creating VP cache drain thread...succeeded
Creating limits manager thread...succeeded
Starting scheduling system...succeeded
Verbose output complete: mode = 5
[informix@vm84145 ~]$ 

停止数据库

停止数据库,数据库进入离线模式。
语法:

onmode -ky

操作演示:

[informix@vm84145 ~]$ onmode -ky
[informix@vm84145 ~]$ onstat -
shared memory not initialized for INFORMIXSERVER 'sinodb'
[informix@vm84145 ~]$ 

停止数据库,并清理共享内存

停止数据库,并清理共享内存,数据库进入离线模式。
语法:

onclean -ky

操作演示:

[informix@vm84145 ~]$ onclean -ky
onclean: Cleaning up processes and resources for 'sinodb'...
 - Looking for the master daemon process: 3537
 - Looking for the shmem key: 52564803
 - Removed the shmem ID: 3440646
 - Looking for the shmem key: 52564804
 - Removed the shmem ID: 3473415
 - Looking for semaphore ID: 6422536
 - Removed the semaphore ID: 6422536
 - Looking for the shmem key: 52564801
 - Removed the shmem ID: 3375108
 - Looking for the shmem key: 52564802
 - Removed the shmem ID: 3407877
 - Looking for semaphore ID: 6455305
 - Removed the semaphore ID: 6455305
 - Looking for semaphore ID: 6488074
 - Removed the semaphore ID: 6488074
 - Looking for semaphore ID: 6520843
 - Removed the semaphore ID: 6520843
 - Looking for semaphore ID: 6553612
 - Removed the semaphore ID: 6553612
 - Looking for semaphore ID: 6586381
 - Removed the semaphore ID: 6586381
 - Looking for semaphore ID: 6619150
 - Removed the semaphore ID: 6619150
[informix@vm84145 ~]$ 

注意:onclean使用时机是当使用 onmode 命令无法正常数据库时,可以使用 onclean 强制关闭数据库。请谨慎使用 onclean 命令。当您执行 onclean 时,任何进行中的事务和进程都会中断,并且用户会话会突然断开,数据库服务器在重新启动时会回滚事务。

onmode

切换数据库到在线模式

当数据库处于单用户模式或静态模式时,可以通过这个命令,将数据库切换到在线模式,并对外提供数据库服务。
语法:

onmode -m

操作演示:

[informix@vm84145 ~]$ onstat -

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- Single-User -- Up 17:45:43 -- 2374324 Kbytes

[informix@vm84145 ~]$ onmode -m
[informix@vm84145 ~]$ onstat -

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 17:46:02 -- 2374324 Kbytes

[informix@vm84145 ~]$ 

切换数据库到离线模式

使用下面的命令,可以关闭数据库。当数据库出现意外情况(如rootdbs被意外删除),需要进行冷恢复时,需要先将数据库关闭。
语法:

onmode -k

操作演示:

[informix@vm84145 ~]$ onstat -

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 17:46:02 -- 2374324 Kbytes

[informix@vm84145 ~]$ onmode -k

This will take Sinoregal SinoDB Dynamic Server OFF-LINE -
Do you wish to continue (y/n)? y

There are 0 user threads that will be killed.
Do you wish to continue (y/n)? y
[informix@vm84145 ~]$ onstat -
shared memory not initialized for INFORMIXSERVER 'sinodb'
[informix@vm84145 ~]$ 

切换数据库到静态模式

当管理员在维护时,不希望有任何的SQL连接,对数据库进行操作,可以将数据库切换到静态模式。
语法:

onmode -s
onmode -u

参数
s:优雅地切换到静态模式。当有用户连接到数据库时,会等用户断开连接后再进行模式切换。
u:立即切换到静态模式。当有用户连接到数据库时,会直接杀掉用户连接,并进行模式切换。
操作演示:

[informix@vm84145 ~]$ onstat -

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 00:00:19 -- 2374324 Kbytes

[informix@vm84145 ~]$ onmode -s

This will perform a GRACEFUL SHUTDOWN -
Do you wish to continue (y/n)? y
[informix@vm84145 ~]$ onstat -

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- Quiescent -- Up 00:00:48 -- 2374324 Kbytes

[informix@vm84145 ~]$ 


和
[informix@vm84145 ~]$ onstat -

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 00:01:15 -- 2374324 Kbytes

[informix@vm84145 ~]$ onmode -u

This will perform an IMMEDIATE SHUTDOWN -
Do you wish to continue (y/n)? y

There are 0 user threads that will be killed.
Do you wish to continue (y/n)? y
[informix@vm84145 ~]$ onstat -

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- Quiescent -- Up 00:02:17 -- 2374324 Kbytes

[informix@vm84145 ~]$ 

切换数据库到单用户模式

切换到单用户模式,只允许管理员进行操作,不允许普通用户连接数据库。
语法

onmode -j

操作演示

[informix@vm84145 ~]$ onstat -

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 00:06:49 -- 2374324 Kbytes

[informix@vm84145 ~]$ onmode -j
This will change mode to single user. Only DBSA/informix can connect 
in this mode.
Do you wish to continue (y/n)? y

All threads which are not owned by DBSA/informix will be killed.
Do you wish to continue (y/n)? y
[informix@vm84145 ~]$ onstat -

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- Single-User -- Up 00:07:04 -- 2374324 Kbytes

[informix@vm84145 ~]$ 

切换逻辑日志文件

强制数据库做一次逻辑日志切换。切换后,新的逻辑日志将写入到下一个逻辑日志文件中。
语法

onmode -l

当前的逻辑日志被标记为C,将逻辑日志切换到下一个后,当前的逻辑日志(uniqid)由14变为15。
操作演示

[informix@vm84145 ~]$ onstat -l

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- Single-User -- Up 00:09:41 -- 2374324 Kbytes

Physical Logging
Buffer bufused  bufsize  numpages   numwrits   pages/io
  P-1  0        1024     37         3          12.33
      phybegin         physize    phypos     phyused    %used   
      3:53             1023945    84192      16         0.00    

Logical Logging
Buffer bufused  bufsize  numrecs    numpages   numwrits   recs/pages pages/io
  L-1  0        512      437        89         52         4.9        1.7     
        Subsystem    numrecs    Log Space used
        OLDRSAM      435        119912        
        HA           2          88            

address          number   flags    uniqid   begin                size     used    %used
475dffa8         7        F------  0        2:53               102390        0     0.00
475fbf88         8        A------  0        2:102443           102390        0     0.00
4886fd90         9        A------  0        2:204833           102390        0     0.00
4886fdf8         10       A------  0        2:307223           102390        0     0.00
4886fe60         11       U-B----  11       2:409613           102390       51     0.05
4886fec8         12       U-B----  12       2:512003           102390       10     0.01
4886ff30         13       U------  13       2:614393           102390    40589    39.64
4886ff98         14       U---C-L  14       2:716783           102390        7     0.01
473abf68         15       A------  0        2:819173           102390        0     0.00
47481f40         16       A------  0        2:921563           102390        0     0.00
 10 active, 10 total

[informix@vm84145 ~]$ onmode -l
[informix@vm84145 ~]$ onstat -l

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- Single-User -- Up 00:10:14 -- 2374324 Kbytes

Physical Logging
Buffer bufused  bufsize  numpages   numwrits   pages/io
  P-1  16       1024     86         5          17.20
      phybegin         physize    phypos     phyused    %used   
      3:53             1023945    84192      32         0.00    

Logical Logging
Buffer bufused  bufsize  numrecs    numpages   numwrits   recs/pages pages/io
  L-3  0        512      440        91         54         4.8        1.7     
        Subsystem    numrecs    Log Space used
        OLDRSAM      437        119996        
        HA           3          132           

address          number   flags    uniqid   begin                size     used    %used
475dffa8         7        F------  0        2:53               102390        0     0.00
475fbf88         8        A------  0        2:102443           102390        0     0.00
4886fd90         9        A------  0        2:204833           102390        0     0.00
4886fdf8         10       A------  0        2:307223           102390        0     0.00
4886fe60         11       U-B----  11       2:409613           102390       51     0.05
4886fec8         12       U-B----  12       2:512003           102390       10     0.01
4886ff30         13       U------  13       2:614393           102390    40589    39.64
4886ff98         14       U-----L  14       2:716783           102390        8     0.01
473abf68         15       U---C--  15       2:819173           102390        4     0.00
47481f40         16       A------  0        2:921563           102390        0     0.00
 10 active, 10 total

[informix@vm84145 ~]$ 

强制执行检查点

执行检查点,会将缓冲区中的“脏”块,写入数据文件。
语法

onmode -c
onmode -c block
onmode -c block <second>

操作演示:

[informix@vm84145 ~]$ onmode -c

强制执行检查点操作时,可以选择阻塞或不阻塞事务。

设置共享内存的常驻部分的强制驻留

开始共享内存的常驻部分的强制驻留
语法

onmode -r

操作演示

[informix@vm84145 ~]$ onstat -g seg

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 00:32:58 -- 2374324 Kbytes

Segment Summary:
id         key        addr             size             ovhd     class blkused  blkfree 
3637252    52564801   44000000         23408640         712648   R     5715     0       
3670021    52564802   45653000         2097152000       24577800 V     14892    497108  
3702790    52564803   c2653000         226308096        1        B     55251    0       
3735559    52564804   cfe26000         84439040         1        B     20615    0       
Total:     -          -                2431307776       -        -     96473    497108  

   (* segment locked in memory)
No reserve memory is allocated

[informix@vm84145 ~]$ onmode -r

This will set the shared memory buffer cache to RESIDENT -
Do you wish to continue (y/n)? y
Note that this command will be phased out in a future release. Please use
the OpenAdmin Tool (OAT) or onmode -w[mf] for dynamic configuration tuning.
[informix@vm84145 ~]$ onstat -g seg

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 00:33:17 -- 2374324 Kbytes

Segment Summary:
id         key        addr             size             ovhd     class blkused  blkfree 
3637252    52564801   44000000         23408640         712648   R*    5715     0       
3670021    52564802   45653000         2097152000       24577800 V     14892    497108  
3702790    52564803   c2653000         226308096        1        B     55251    0       
3735559    52564804   cfe26000         84439040         1        B     20615    0       
Total:     -          -                2431307776       -        -     96473    497108  

   (* segment locked in memory)
No reserve memory is allocated

[informix@vm84145 ~]$ 

取消共享内存的常驻部分的强制驻留

语法

the OpenAdmin Tool (OAT) or onmode -w[mf] for dynamic configuration tuning.
[informix@vm84145 ~]$ onstat -g seg

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 00:33:17 -- 2374324 Kbytes

Segment Summary:
id         key        addr             size             ovhd     class blkused  blkfree 
3637252    52564801   44000000         23408640         712648   R*    5715     0       
3670021    52564802   45653000         2097152000       24577800 V     14892    497108  
3702790    52564803   c2653000         226308096        1        B     55251    0       
3735559    52564804   cfe26000         84439040         1        B     20615    0       
Total:     -          -                2431307776       -        -     96473    497108  

   (* segment locked in memory)
No reserve memory is allocated

[informix@vm84145 ~]$ onmode -n

This will set the shared memory buffer cache to NON-RESIDENT -
Do you wish to continue (y/n)? y
Note that this command will be phased out in a future release. Please use
the OpenAdmin Tool (OAT) or onmode -w[mf] for dynamic configuration tuning.
[informix@vm84145 ~]$ onstat -g seg

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 00:35:17 -- 2374324 Kbytes

Segment Summary:
id         key        addr             size             ovhd     class blkused  blkfree 
3637252    52564801   44000000         23408640         712648   R     5715     0       
3670021    52564802   45653000         2097152000       24577800 V     14892    497108  
3702790    52564803   c2653000         226308096        1        B     55251    0       
3735559    52564804   cfe26000         84439040         1        B     20615    0       
Total:     -          -                2431307776       -        -     96473    497108  

   (* segment locked in memory)
No reserve memory is allocated

[informix@vm84145 ~]$ 

添加或删除虚拟管理器

SinoDB可以根据业务运行情况,动态增加和减少虚拟处理器的数量,以适应业务变化,让数据库运行更高效。
语法:

onmode -p +num <vp_class>
onmode -p -num <vp_class>

操作演示
查看当前的VP信息,当前的CPU VP共有2个。

[informix@vm84145 ~]$ onstat -g glo

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 00:49:00 -- 2374324 Kbytes

MT global info:
sessions threads  vps      lngspins time    
0        58       12       0        2940    

          sched calls     thread switches yield 0   yield n   yield forever
total:    141351          127127          14340     111284    6387     
per sec:  0               0               0         0         0        

Virtual processor summary:
 class       vps       usercpu   syscpu    total   
 cpu         2         0.91      0.33      1.24    
 aio         3         0.00      0.05      0.05    
 lio         1         0.00      0.02      0.02    
 pio         1         0.01      0.01      0.02    
 adm         1         0.06      0.09      0.15    
 soc         2         0.14      0.15      0.29    
 msc         1         0.00      0.00      0.00    
 fifo        1         0.01      0.01      0.02    
 total       12        1.13      0.66      1.79    

Individual virtual processors:
 vp    pid       class       usercpu   syscpu    total     Thread    Eff  
 1     19098     cpu         0.65      0.26      0.91      2.12      42%
 2     19099     adm         0.06      0.09      0.15      0.00       0%
 3     19100     lio         0.00      0.02      0.02      0.02     100%
 4     19101     pio         0.01      0.01      0.02      0.02     100%
 5     19102     aio         0.00      0.02      0.02      0.06      36%
 6     19103     msc         0.00      0.00      0.00      0.00       0%
 7     19104     fifo        0.01      0.01      0.02      0.02     100%
 8     19106     cpu         0.26      0.07      0.33      1.05      31%
 9     19107     soc         0.14      0.13      0.27      NA         NA
 10    19108     soc         0.00      0.02      0.02      NA         NA
 11    19109     aio         0.00      0.01      0.01      0.01     100%
 12    19110     aio         0.00      0.02      0.02      0.02     100%
                 tot         1.13      0.66      1.79    

动态增加5个CPU VP。

[informix@vm84145 ~]$ onmode -p +5 cpu

再次查看VP信息,当前的CPU VP有7个。

[informix@vm84145 ~]$ onstat -g glo

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 00:49:42 -- 2374324 Kbytes

MT global info:
sessions threads  vps      lngspins time    
0        58       17       0        2982    

          sched calls     thread switches yield 0   yield n   yield forever
total:    143260          128868          14508     112923    6387     
per sec:  60              60              0         55        0        

Virtual processor summary:
 class       vps       usercpu   syscpu    total   
 cpu         7         0.91      0.33      1.24    
 aio         3         0.00      0.05      0.05    
 lio         1         0.00      0.02      0.02    
 pio         1         0.01      0.01      0.02    
 adm         1         0.06      0.09      0.15    
 soc         2         0.14      0.15      0.29    
 msc         1         0.00      0.00      0.00    
 fifo        1         0.01      0.01      0.02    
 total       17        1.13      0.66      1.79    

Individual virtual processors:
 vp    pid       class       usercpu   syscpu    total     Thread    Eff  
 1     19098     cpu         0.65      0.26      0.91      2.63      34%
 2     19099     adm         0.06      0.09      0.15      0.00       0%
 3     19100     lio         0.00      0.02      0.02      0.02     100%
 4     19101     pio         0.01      0.01      0.02      0.02     100%
 5     19102     aio         0.00      0.02      0.02      0.06      36%
 6     19103     msc         0.00      0.00      0.00      0.00       0%
 7     19104     fifo        0.01      0.01      0.02      0.02     100%
 8     19106     cpu         0.26      0.07      0.33      1.06      31%
 9     19107     soc         0.14      0.13      0.27      NA         NA
 10    19108     soc         0.00      0.02      0.02      NA         NA
 11    19109     aio         0.00      0.01      0.01      0.01     100%
 12    19110     aio         0.00      0.02      0.02      0.02     100%
 13    19710     cpu         0.00      0.00      0.00      0.00       0%
 14    19711     cpu         0.00      0.00      0.00      0.00       0%
 15    19712     cpu         0.00      0.00      0.00      0.00       0%
 16    19713     cpu         0.00      0.00      0.00      0.00       0%
 17    19714     cpu         0.00      0.00      0.00      0.00       0%
                 tot         1.13      0.66      1.79    

[informix@vm84145 ~]$

动态减少3个CPU VP。

[informix@vm84145 ~]$ onmode -p -3 cpu
[informix@vm84145 ~]$

查看VP信息。CPU VP变为4个。

[informix@vm84145 ~]$ onstat -g glo

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 00:50:48 -- 2374324 Kbytes

MT global info:
sessions threads  vps      lngspins time    
0        58       14       0        3048    

          sched calls     thread switches yield 0   yield n   yield forever
total:    146262          131594          14784     115399    6387     
per sec:  45              45              0         43        0        

Virtual processor summary:
 class       vps       usercpu   syscpu    total   
 cpu         4         0.92      0.33      1.25    
 aio         3         0.00      0.05      0.05    
 lio         1         0.00      0.02      0.02    
 pio         1         0.01      0.02      0.03    
 adm         1         0.06      0.09      0.15    
 soc         2         0.14      0.15      0.29    
 msc         1         0.00      0.00      0.00    
 fifo        1         0.01      0.01      0.02    
 total       14        1.14      0.67      1.81    

Individual virtual processors:
 vp    pid       class       usercpu   syscpu    total     Thread    Eff  
 1     19098     cpu         0.66      0.26      0.92      2.64      34%
 2     19099     adm         0.06      0.09      0.15      0.00       0%
 3     19100     lio         0.00      0.02      0.02      0.02     100%
 4     19101     pio         0.01      0.02      0.03      0.03     100%
 5     19102     aio         0.00      0.02      0.02      0.06      36%
 6     19103     msc         0.00      0.00      0.00      0.00       0%
 7     19104     fifo        0.01      0.01      0.02      0.02     100%
 8     19106     cpu         0.26      0.07      0.33      1.06      31%
 9     19107     soc         0.14      0.13      0.27      NA         NA
 10    19108     soc         0.00      0.02      0.02      NA         NA
 11    19109     aio         0.00      0.01      0.01      0.01     100%
 12    19110     aio         0.00      0.02      0.02      0.02     100%
 13    19710     cpu         0.00      0.00      0.00      0.00       0%
 14    19711     cpu         0.00      0.00      0.00      0.01       0%
                 tot         1.14      0.67      1.81    

[informix@vm84145 ~]$ 

动态地启动、停止或重启监听线程

语法:

onmode -P <start|stop|restart> <instance_name>

操作演示
停止服务监听

[informix@vm84145 ~]$ onmode -P stop sinodb
[informix@vm84145 ~]$ 

使用dbaccess连接数据库。由于监听已经停止,dbaccess会在选择数据库执行一段时间后报错。

[informix@vm84145 ~]$ dbaccess - -
> database testdb;

  908: Attempt to connect to database server (sinodb) failed.
Error in line 1
Near character position 1
> 

启动监听。再次使用dbaccess连接数据库会立即成功。

[informix@vm84145 ~]$ onmode -P start sinodb
[informix@vm84145 ~]$ dbaccess - -
> database testdb;

Database selected.

> 

更新 onconfig 文件中指定配置参数的值

语法

onmode -wm <key=value>
onmode -wf <key=value>

说明:只有部分参数支持动态更改。
操作演示
只更新内存中的参数值,但不更新配置文件中的参数值。

[informix@vm84145 ~]$ onstat -c | grep LISTEN_TIMEOUT
# LISTEN_TIMEOUT             - The number of seconds that the server
LISTEN_TIMEOUT 60
[informix@vm84145 ~]$ onstat -g cfg | grep LISTEN_TIMEOUT
LISTEN_TIMEOUT            60
[informix@vm84145 ~]$ onmode -wm LISTEN_TIMEOUT=50
Value of LISTEN_TIMEOUT has been changed to 50 seconds.
[informix@vm84145 ~]$ onstat -c | grep LISTEN_TIMEOUT
# LISTEN_TIMEOUT             - The number of seconds that the server
LISTEN_TIMEOUT 60
[informix@vm84145 ~]$ onstat -g cfg | grep LISTEN_TIMEOUT
LISTEN_TIMEOUT            50
[informix@vm84145 ~]$ 

更新内存和配置文件中的参数值。

[informix@vm84145 ~]$ onstat -g cfg | grep LISTEN_TIMEOUT
LISTEN_TIMEOUT            50
[informix@vm84145 ~]$ onstat -c | grep LISTEN_TIMEOUT
# LISTEN_TIMEOUT             - The number of seconds that the server
LISTEN_TIMEOUT 60
[informix@vm84145 ~]$ onmode -wf LISTEN_TIMEOUT=70
Value of LISTEN_TIMEOUT has been changed to 70 seconds.
[informix@vm84145 ~]$ onstat -c | grep LISTEN_TIMEOUT
# LISTEN_TIMEOUT             - The number of seconds that the server
LISTEN_TIMEOUT  70              
[informix@vm84145 ~]$ onstat -g cfg | grep LISTEN_TIMEOUT
LISTEN_TIMEOUT            70
[informix@vm84145 ~]$ 

终止数据库服务器会话

语法:

onmode -z <session_id>

操作演示

[informix@vm84145 ~]$ dbaccess - -
> database testdb;

Database selected.

> !onstat -g ses

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 01:35:57 -- 2374324 Kbytes

session                                      #RSAM    total      used       dynamic 
id       user     tty      pid      hostname threads  memory     memory     explain 
60       informix -        0        -        0        16384      12560      off 
59       informix 0        20442    vm84145  1        73728      64776      off 
56       informix -        0        -        0        16384      14176      off 
53       informix -        0        -        1        417792     367968     off 
52       informix -        0        -        1        434176     370648     off 
51       informix -        0        -        1        622592     484920     off 
50       informix -        0        -        1        73728      67280      off 
3        informix -        0        -        0        16384      12560      off 
2        informix -        0        -        0        16384      12560      off 

> select * from t_user;


   f_userid f_username                                               f_age 

          2 Jack                                                        21

1 row(s) retrieved.

> !onmode -z 59
> select * from t_user;    

25582: Network connection is broken.
Error in line 1
Near character position 1
> 

在dbaccess中执行SQL时,由于Session被杀死,执行报错。

> info tables;


Table name



25582: Network connection is broken.
Error in line 1
Near character position 33
> 

onstat

打印数据库当前运行模式

语法

onstat -

操作演示:

[informix@vm84145 ~]$ onstat -

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 01:42:32 -- 2374324 Kbytes

打印onconfig文件内容

显示配置文件的内容。在输出中包含了配置文件的路径,可以通过该命令快速找到配置文件。
语法

onstat -c

操作演示

[informix@vm84145 ~]$ onstat -c

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 01:48:29 -- 2374324 Kbytes

Configuration File: /home/informix/sinodb/etc/onconfig.sinodb
##################################################################
# Licensed Material - Property of Sinoregal Corporation
#
# "Restricted Materials of Sinoregal Corporation"
#
# Sinoregal SinoDB Dynamic Server
# Copyright Sinoregal Corporation 0000, 2017. All rights reserved.
#
# Title: onconfig.std
# Description: Sinoregal SinoDB Dynamic Server Configuration Parameters
#
# Important: $INFORMIXDIR now resolves to the environment
# variable INFORMIXDIR. Replace the value of the INFORMIXDIR  
# environment variable only if the path you want is not under 
# $INFORMIXDIR.

.....

打印系统在线日志最新信息

查看online日志的最新信息。在输出信息中,也包含了online日志的路径信息,可以根据该日志路径,查看online日志的完整内容。
语法

onstat -m

操作演示

[informix@vm84145 ~]$ onstat -m

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 01:53:10 -- 2374324 Kbytes

Message Log File: /home/informix/sinodb/tmp/online.log

19:07:48  sid 59 - informix@vm84145 - pid 20442  terminated by onmode -z.
.
19:10:01  requested number of KAIO events (131072) exceeds limit (16384). using 16384.
19:11:09  sid 61 - informix@vm84145 - pid 20485  terminated by onmode -z.
.
19:11:58  Checkpoint Completed:  duration was 0 seconds.
19:11:58  Tue Mar  1 - loguniq 15, logpos 0x95018, timestamp: 0x22ce08 Interval: 1373

19:11:58  Maximum server connections 1 
19:11:58  Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0, Plog used 332, Llog used 72

19:11:58  Increasing # of AIO VPs to 4

19:16:59  Checkpoint Completed:  duration was 0 seconds.
19:16:59  Tue Mar  1 - loguniq 15, logpos 0x97018, timestamp: 0x22ce15 Interval: 1374

19:16:59  Maximum server connections 1 
19:16:59  Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0, Plog used 19, Llog used 2


[informix@vm84145 ~]$ 

打印物理日志和逻辑日志使用状态

显示物理日志缓冲区,逻辑日志缓冲区,逻辑日志使用情况等。
语法

onstat -l

操作演示

[informix@vm84145 ~]$ onstat -l

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 02:03:10 -- 2374324 Kbytes

Physical Logging
Buffer bufused  bufsize  numpages   numwrits   pages/io
  P-1  0        1024     830        17         48.82
      phybegin         physize    phypos     phyused    %used   
      3:53             1023945    84936      0          0.00    

Logical Logging
Buffer bufused  bufsize  numrecs    numpages   numwrits   recs/pages pages/io
  L-3  0        512      2542       245        137        10.4       1.8     
        Subsystem    numrecs    Log Space used
        OLDRSAM      2531       326868        
        HA           11         484           

address          number   flags    uniqid   begin                size     used    %used
475dffa8         7        F------  0        2:53               102390        0     0.00
475fbf88         8        A------  0        2:102443           102390        0     0.00
4886fd90         9        A------  0        2:204833           102390        0     0.00
4886fdf8         10       A------  0        2:307223           102390        0     0.00
4886fe60         11       U-B----  11       2:409613           102390       51     0.05
4886fec8         12       U-B----  12       2:512003           102390       10     0.01
4886ff30         13       U------  13       2:614393           102390    40589    39.64
4886ff98         14       U------  14       2:716783           102390        8     0.01
473abf68         15       U---C-L  15       2:819173           102390      153     0.15
47481f40         16       A------  0        2:921563           102390        0     0.00
 10 active, 10 total

[informix@vm84145 ~]$ 

物理日志标题

逻辑日志标题

flags

打印数据库空间和Chunk文件使用信息

查询数据库已经创建的数据库空间,及每个数据库空间的文件编号,文件数量,文件路径,文件大小,页大小等信息。
语法

onstat -d

操作演示

[informix@vm84145 ~]$ onstat -d

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 02:05:30 -- 2374324 Kbytes

Dbspaces
address          number   flags      fchunk   nchunks  pgsize   flags    owner    name
47481028         1        0x1        1        1        2048     N  BA    informix rootdbs
48a9e0d8         2        0x1        2        1        2048     N  BA    informix llogdbs
48a9e318         3        0x1        3        1        2048     N  BA    informix plogdbs
48a9e558         4        0x2001     4        1        8192     N TBA    informix tempdbs1
48a9e798         5        0x2001     5        1        8192     N TBA    informix tempdbs2
48a9e9d8         6        0x2001     6        1        8192     N TBA    informix tempdbs3
48a9ec18         7        0x11       7        1        8192     N BBA    informix bindbs1
48a9f028         8        0x8001     8        1        2048     N SBA    informix sbdbs1
48a9f268         9        0x1        9        1        2048     N  BA    informix datadbs1
48a9f4a8         10       0x1        10       1        2048     N  BA    informix datadbs2
48a9f6e8         11       0x1        11       1        2048     N  BA    informix datadbs3
48a9f928         12       0x1        12       1        2048     N  BA    informix datadbs4
48a9fb68         13       0x1        13       1        2048     N  BA    informix datadbs5
 13 active, 2047 maximum

Note: For BLOB chunks, the number of free pages shown is out of date.
      Run 'onstat -d update' for current stats.

Chunks
address          chunk/dbs     offset     size       free       bpages     flags pathname
47481268         1      1      0          1024000    1009415               PO-B-D /home/informix/dbs/rootdbs
48aa1028         2      2      0          1024000    47                    PO-B-D /home/informix/dbs/llogdbs
48aa2028         3      3      0          1024000    2                     PO-B-D /home/informix/dbs/plogdbs
48aa3028         4      4      0          64000      63947                 PO-B-- /home/informix/dbs/tempdbs1
48aa4028         5      5      0          64000      63947                 PO-B-- /home/informix/dbs/tempdbs2
48aa5028         6      6      0          64000      63947                 PO-B-- /home/informix/dbs/tempdbs3
48aa6028         7      7      0          512000    ~127872     128000     POBB-D /home/informix/dbs/bindbs1
48aa7028         8      8      0          512000     477454     477465     POSB-D /home/informix/dbs/sbdbs1
                                 Metadata 34482      25659      34482   
48aa8028         9      9      0          1024000    1019026               PO-B-D /home/informix/dbs/datadbs1-1
48aa9028         10     10     0          1024000    1023947               PO-B-D /home/informix/dbs/datadbs2-1
48aaa028         11     11     0          1024000    1023947               PO-B-D /home/informix/dbs/datadbs3-1
48aab028         12     12     0          1024000    1023947               PO-B-D /home/informix/dbs/datadbs4-1
48aac028         13     13     0          1024000    1023947               PO-B-D /home/informix/dbs/datadbs5-1
 13 active, 32766 maximum

NOTE: The values in the "size" and "free" columns for DBspace chunks are
      displayed in terms of "pgsize" of the DBspace to which they belong.


Expanded chunk capacity mode: always

[informix@vm84145 ~]$ 



标记值2(flags)

Chunks字段信息

chunk 状态信息标志说明

打印数据库空间和Chunk文件读写信息

查询数据库已经创建的数据库空间,及每个数据库空间的文件编号,文件数量,文件路径,页大小,每个文件的IO情况等信息。
语法

onstat -D

操作演示:

[informix@vm84145 ~]$ onstat -D

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 02:07:41 -- 2374324 Kbytes


Dbspaces

address          number   flags      fchunk   nchunks  pgsize   flags    owner    name
47481028         1        0x1        1        1        2048     N  BA    informix rootdbs
48a9e0d8         2        0x1        2        1        2048     N  BA    informix llogdbs
48a9e318         3        0x1        3        1        2048     N  BA    informix plogdbs
48a9e558         4        0x2001     4        1        8192     N TBA    informix tempdbs1
48a9e798         5        0x2001     5        1        8192     N TBA    informix tempdbs2
48a9e9d8         6        0x2001     6        1        8192     N TBA    informix tempdbs3
48a9ec18         7        0x11       7        1        8192     N BBA    informix bindbs1
48a9f028         8        0x8001     8        1        2048     N SBA    informix sbdbs1
48a9f268         9        0x1        9        1        2048     N  BA    informix datadbs1
48a9f4a8         10       0x1        10       1        2048     N  BA    informix datadbs2
48a9f6e8         11       0x1        11       1        2048     N  BA    informix datadbs3
48a9f928         12       0x1        12       1        2048     N  BA    informix datadbs4
48a9fb68         13       0x1        13       1        2048     N  BA    informix datadbs5
 13 active, 2047 maximum

Chunks

address          chunk/dbs     offset     page Rd  page Wr  pathname
47481268         1      1      0          2037     836      /home/informix/dbs/rootdbs
48aa1028         2      2      0          515      246      /home/informix/dbs/llogdbs
48aa2028         3      3      0          11       831      /home/informix/dbs/plogdbs
48aa3028         4      4      0          12       84       /home/informix/dbs/tempdbs1
48aa4028         5      5      0          12       88       /home/informix/dbs/tempdbs2
48aa5028         6      6      0          12       88       /home/informix/dbs/tempdbs3
48aa6028         7      7      0          509      0        /home/informix/dbs/bindbs1
48aa7028         8      8      0          14       1        /home/informix/dbs/sbdbs1
48aa8028         9      9      0          103      0        /home/informix/dbs/datadbs1-1
48aa9028         10     10     0          3        1        /home/informix/dbs/datadbs2-1
48aaa028         11     11     0          3        1        /home/informix/dbs/datadbs3-1
48aab028         12     12     0          3        1        /home/informix/dbs/datadbs4-1
48aac028         13     13     0          3        1        /home/informix/dbs/datadbs5-1
 13 active, 32766 maximum

NOTE: The values in the "page Rd" and "page Wr" columns for DBspace chunks 
      are displayed in terms of system base  page size.

Expanded chunk capacity mode: always

[informix@vm84145 ~]$ 

打印表空间信息

显示活动表空间的表空间信息。
语法

onstat -t

操作演示

[informix@vm84145 ~]$ onstat -t

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 02:08:29 -- 2374324 Kbytes

Tblspaces
 n address          flgs ucnt tblnum   physaddr         npages nused  npdata nrows  nextns
14 48c161a8         0    1    100001   1:14             600    505    0      420    4     
16 4912f028         0    2    100004   1:17             64     37     23     267    3     
17 48daf028         0    1    100005   1:18             128    128    69     3053   3     
18 48db0a08         0    1    100006   1:19             64     64     49     205    1     
19 48d6d950         0    1    100007   1:20             64     36     12     286    2     
21 48dc0028         0    1    100009   1:22             32     19     17     114    3     
22 48ce5708         0    1    10000a   1:23             8      3      1      2      1     
25 48dc0720         0    1    100013   1:32             256    140    109    551    6     
43 490d2028         0    5    100076   1:131            32     19     11     124    3     
44 48cdd9b8         0    1    100077   1:132            64     41     24     1057   2     
45 48ce2028         0    1    100078   1:133            64     58     45     192    1     
46 48cdd028         0    1    100079   1:134            32     27     8      180    2     
49 490d2a60         0    1    10007c   1:137            8      3      1      3      1     
50 48ce9028         0    1    100080   1:141            16     13     5      85     2     
53 48c269d8         0    1    100083   1:144            32     20     18     125    3     
55 490d5a80         0    1    100085   1:146            256    168    130    650    6     
60 48cee028         0    1    10008b   1:152            8      5      1      4      1     
63 48cef028         0    1    10008e   1:155            32     21     17     80     3     
73 48d94028         0    7    1000be   1:203            32     20     18     48     3     
74 48dd38b0         0    3    1000c0   1:205            4      2      0      0      1     
75 48d94748         0    1    1000c1   1:206            4      4      0      0      1     
76 48ce5028         0    2    1000c2   1:207            4      2      0      0      1     
77 48e917f0         0    5    1000c3   1:208            64     49     48     2000   4     
78 48f26028         0    2    1000c4   1:209            32     18     0      0      4     
79 48f266a8         0    2    1000c5   1:210            32     29     0      0      4     
80 48f5a028         0    3    1000c6   1:211            64     39     0      0      5     
87 48d4d028         0    1    1000d8   1:229            8      2      1      25     1     
88 48d4d650         0    1    1000d9   1:230            8      2      0      0      1     
91 48fca028         0    1    10011c   1:58325          32     18     17     534    3     
92 48fca670         0    1    10011d   1:58326          8      7      0      0      2     
95 48f5a688         0    1    100177   1:58781          16     14     7      80     2     
100 48f5e028         0    1    10017d   1:58787          8      3      1      2      1     
103 48f2b028         0    1    100186   1:58796          256    137    106    532    6     
110 49221658         0    1    100192   1:64589          8      4      3      13     1     
113 48ec27f0         0    1    100198   1:64595          64     64     22     347    4     
120 48c16870         0    1    200001   2:4              50     2      0      0      1     
121 48c17028         0    1    300001   3:4              50     2      0      0      1     
122 48c17910         2    1    400001   4:16             50     3      0      0      1     
123 48c18028         2    1    500001   5:16             50     3      0      0      1     
124 48c188d0         2    1    600001   6:16             50     3      0      0      1     
125 48c19028         0    1    800001   8:4              50     6      0      4      1     
129 48d61028         0    1    800005   8:8              7489   4      3      12     1     
130 48c22820         0    1    900001   9:4              200    200    0      184    3     
131 48ed7028         0    1    900002   9:5              32     18     10     116    3     
132 48eca918         0    1    900003   9:6              32     28     16     702    1     
134 48eca028         0    1    900005   9:8              16     16     5      114    1     
136 48ed79b0         0    1    900008   9:11             8      3      1      1      1     
137 492312c8         0    1    90000c   9:15             8      6      2      30     1     
151 4922c900         0    1    90004c   9:575            8      2      1      1      1     
153 48c23028         0    1    a00001   10:4             50     2      0      0      1     
154 48c23780         0    1    b00001   11:4             50     2      0      0      1     
155 48c24028         0    1    c00001   12:4             50     2      0      0      1     
156 48c24780         0    1    d00001   13:4             50     2      0      0      1     
 53 active, 156 total

[informix@vm84145 ~]$ 

显示全部表空间的表空间信息

语法

onstat -T

操作演示

[informix@vm84145 ~]$ onstat -T

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 02:11:27 -- 2374324 Kbytes

Tblspaces
 n address          flgs ucnt tblnum   physaddr         npages nused  npdata nrows  nextns
 1 48eeb9b0         8    0    6        0:0              0      0      0      0      0     
 2 4927e028         8    0    1a       0:0              0      0      0      0      0     
 3 48ebe028         8    0    1f       0:0              0      0      0      0      0     
 4 48eb05a0         8    0    27       0:0              0      0      0      0      0     
 5 4927e528         8    0    28       0:0              0      0      0      0      0     
 6 48fc4550         8    0    29       0:0              0      0      0      0      0     
 7 49272028         8    0    2a       0:0              0      0      0      0      0     
 8 49272528         8    0    2f       0:0              0      0      0      0      0     
 9 48eb0aa0         8    0    30       0:0              0      0      0      0      0     
10 48edd7f0         8    0    57       0:0              0      0      0      0      0     
11 4927ea28         8    0    58       0:0              0      0      0      0      0     
12 48eeb4b0         8    0    59       0:0              0      0      0      0      0     
13 48fc4050         8    0    99       0:0              0      0      0      0      0     
14 48c161a8         0    1    100001   1:14             600    505    0      420    4     
15 48bf4028         0    0    100002   1:15             4      3      1      6      1     
16 4912f028         0    2    100004   1:17             64     37     23     267    3     
17 48daf028         0    1    100005   1:18             128    128    69     3053   3     
18 48db0a08         0    1    100006   1:19             64     64     49     205    1     
19 48d6d950         0    1    100007   1:20             64     36     12     286    2     
20 48db2960         0    0    100008   1:21             16     16     6      152    2     
21 48dc0028         0    1    100009   1:22             32     19     17     114    3     
22 48ce5708         0    1    10000a   1:23             8      3      1      2      1     
23 48db38f8         0    0    10000e   1:27             8      4      0      0      1     
24 48db3028         0    0    100011   1:30             8      4      2      9      1     
25 48dc0720         0    1    100013   1:32             256    140    109    551    6     
26 48dc5290         0    0    100014   1:33             640    624    558    3901   8     
27 48dc7608         0    0    100015   1:34             128    95     44     300    5     
28 48db2028         0    0    100017   1:36             8      3      1      7      1     
29 48db94f0         0    0    100018   1:37             8      3      0      0      1     
30 48db4220         0    0    100019   1:38             8      4      0      0      1     
31 48dd3028         0    0    10001b   1:40             8      2      0      0      1     
32 48dba028         0    0    10001c   1:41             32     22     1      1      3     
33 48dbba38         0    0    100021   1:46             8      3      0      0      1     
34 48db0028         0    0    100030   1:61             16     11     3      93     2     
35 48dbb028         0    0    100031   1:62             8      4      0      0      1     
36 48d6d028         0    0    100033   1:64             8      3      0      0      1     
37 48f2d028         0    0    100046   1:83             8      6      1      23     1     
38 48f00928         0    0    100049   1:86             8      3      0      0      1     
39 48f477e8         0    0    10004c   1:89             32     29     18     372    1     
40 48f089a0         0    0    100058   1:101            8      4      1      29     1     
41 48eff238         0    0    100059   1:102            8      4      0      0      1     
42 48f5e888         0    0    10005b   1:104            8      3      0      0      1     
43 490d2028         0    5    100076   1:131            32     19     11     124    3     
44 48cdd9b8         0    1    100077   1:132            64     41     24     1057   2     
45 48ce2028         0    1    100078   1:133            64     58     45     192    1     
46 48cdd028         0    1    100079   1:134            32     27     8      180    2     
47 48cde028         0    0    10007a   1:135            8      8      2      50     1     
48 48d30028         0    0    10007b   1:136            8      6      3      19     1     
49 490d2a60         0    1    10007c   1:137            8      3      1      3      1     
50 48ce9028         0    1    100080   1:141            16     13     5      85     2     
51 48ce9a98         0    0    100081   1:142            8      4      1      16     1     
52 490b4028         0    0    100082   1:143            16     13     7      289    2     
53 48c269d8         0    1    100083   1:144            32     20     18     125    3     
54 490b4908         0    0    100084   1:145            8      4      1      55     1     
55 490d5a80         0    1    100085   1:146            256    168    130    650    6     
56 48c32028         0    0    100086   1:147            1280   1210   1069   7452   13    
57 48c52028         0    0    100087   1:148            384    316    263    1811   7     
58 48cdf028         0    0    100089   1:150            8      3      1      6      1     
59 48c26028         0    0    10008a   1:151            8      3      0      0      1     
60 48cee028         0    1    10008b   1:152            8      5      1      4      1     
61 48cee9f0         0    0    10008c   1:153            8      7      5      31     1     
62 48d0a978         0    0    10008d   1:154            360    360    210    991    6     
63 48cef028         0    1    10008e   1:155            32     21     17     80     3     
64 48c32a60         0    0    100090   1:157            8      6      1      25     1     
65 48cf2028         0    0    100093   1:160            8      3      0      0      1     
66 48cdf910         0    0    100094   1:161            8      2      0      0      1     
67 48c41028         0    0    100096   1:163            32     29     18     372    1     
68 48d0a028         0    0    100098   1:165            8      4      1      6      1     
69 48cf2920         0    0    10009a   1:167            8      4      1      2      1     
70 48cde980         0    0    1000a2   1:175            16     16     5      169    2     
71 48cefb08         0    0    1000a3   1:176            8      4      0      0      1     
72 490d5028         0    0    1000a5   1:178            8      3      0      0      1     
73 48d94028         0    7    1000be   1:203            32     20     18     48     3     
74 48dd38b0         0    3    1000c0   1:205            4      2      0      0      1     
75 48d94748         0    1    1000c1   1:206            4      4      0      0      1     
76 48ce5028         0    2    1000c2   1:207            4      2      0      0      1     
77 48e917f0         0    5    1000c3   1:208            64     49     48     2000   4     
78 48f26028         0    2    1000c4   1:209            32     18     0      0      4     
79 48f266a8         0    2    1000c5   1:210            32     29     0      0      4     
80 48f5a028         0    3    1000c6   1:211            64     39     0      0      5     
81 48c0b028         0    0    1000c7   1:212            128    88     87     291    4     
82 48c0b730         0    0    1000c8   1:213            4      4      0      0      1     
83 48c0e7f0         0    0    1000c9   1:214            4      2      0      0      1     
84 48c10028         0    0    1000ca   1:215            4      4      0      0      1     
85 48f325e0         0    0    1000cb   1:216            8      6      5      31     1     
86 48f47028         0    0    1000cd   1:218            4      2      0      0      1     
87 48d4d028         0    1    1000d8   1:229            8      2      1      25     1     
88 48d4d650         0    1    1000d9   1:230            8      2      0      0      1     
89 48d308c0         0    0    1000de   1:235            8      2      1      1      1     
90 48c106d0         0    0    10011b   1:58324          64     62     61     4056   4     
91 48fca028         0    1    10011c   1:58325          32     18     17     534    3     
92 48fca670         0    1    10011d   1:58326          8      7      0      0      2     
93 48f9d7f0         0    0    10011e   1:58327          8      6      0      0      2     
94 48f00028         0    0    10011f   1:58328          8      2      0      0      1     
95 48f5a688         0    1    100177   1:58781          16     14     7      80     2     
96 48f5c028         0    0    100178   1:58782          32     24     13     591    1     
97 48ead3d8         0    0    100179   1:58783          64     41     32     132    1     
98 48ef77f0         0    0    10017a   1:58784          16     13     4      79     1     
99 48f08028         0    0    10017b   1:58785          8      7      2      43     1     
100 48f5e028         0    1    10017d   1:58787          8      3      1      2      1     
101 48efc1e0         0    0    100181   1:58791          8      5      1      9      1     
102 48efb9d8         0    0    100184   1:58794          8      4      2      11     1     
103 48f2b028         0    1    100186   1:58796          256    137    106    532    6     
104 48f23028         0    0    100187   1:58797          640    604    543    3795   8     
105 48f32028         0    0    100188   1:58798          64     50     42     288    4     
106 48f5caf0         0    0    10018a   1:58800          8      3      1      6      1     
107 48efb028         0    0    10018b   1:58801          8      3      0      0      1     
108 48efd028         0    0    10018c   1:58802          8      4      0      0      1     
109 48efdac0         0    0    10018f   1:58805          8      2      0      0      1     
110 49221658         0    1    100192   1:64589          8      4      3      13     1     
111 48d61578         0    0    100195   1:64592          32     24     23     431    3     
112 48e49028         0    0    100196   1:64593          16     15     14     653    2     
113 48ec27f0         0    1    100198   1:64595          64     64     22     347    4     
114 48ec0728         0    0    100199   1:64596          16     11     0      0      3     
115 48e49528         0    0    10019a   1:64597          32     20     19     1140   3     
116 48fc4a50         0    0    10019b   1:64598          1016   947    946    86028  11    
117 48ebe528         0    0    10019c   1:64599          768    749    0      0      9     
118 48ec0028         0    0    10019d   1:64600          384    272    0      0      8     
119 48eb0050         0    0    10019e   1:64601          256    145    144    4161   6     
120 48c16870         0    1    200001   2:4              50     2      0      0      1     
121 48c17028         0    1    300001   3:4              50     2      0      0      1     
122 48c17910         2    1    400001   4:16             50     3      0      0      1     
123 48c18028         2    1    500001   5:16             50     3      0      0      1     
124 48c188d0         2    1    600001   6:16             50     3      0      0      1     
125 48c19028         0    1    800001   8:4              50     6      0      4      1     
126 48c195b8         0    0    800002   8:5              4      2      1      1      1     
127 48c21028         0    0    800003   8:6              4      2      1      1      1     
128 48c215b8         0    0    800004   8:7              1326   2      1      1      1     
129 48d61028         0    1    800005   8:8              7489   4      3      12     1     
130 48c22820         0    1    900001   9:4              200    200    0      184    3     
131 48ed7028         0    1    900002   9:5              32     18     10     116    3     
132 48eca918         0    1    900003   9:6              32     28     16     702    1     
133 49233998         0    0    900004   9:7              64     39     30     123    1     
134 48eca028         0    1    900005   9:8              16     16     5      114    1     
135 48ba8960         0    0    900006   9:9              8      7      2      43     1     
136 48ed79b0         0    1    900008   9:11             8      3      1      1      1     
137 492312c8         0    1    90000c   9:15             8      6      2      30     1     
138 49220028         0    0    90000e   9:17             8      3      1      16     1     
139 4914b9d8         0    0    90000f   9:18             16     9      7      49     2     
140 49220810         0    0    900010   9:19             8      4      1      21     1     
141 484cc910         0    0    900011   9:20             256    174    136    672    6     
142 48ba8028         0    0    900015   9:24             8      3      1      6      1     
143 4914b028         0    0    900016   9:25             8      3      0      0      1     
144 49150028         0    0    900017   9:26             8      5      1      1      1     
145 49272a28         0    0    900019   9:28             207    195    151    744    3     
146 49150ac0         0    0    90001a   9:29             8      5      3      11     1     
147 4922c028         0    0    90001f   9:34             8      3      0      0      1     
148 49233028         0    0    90002e   9:49             8      7      2      42     1     
149 4922b3f0         0    0    90002f   9:50             8      4      0      0      1     
150 484cc028         0    0    900031   9:52             8      3      0      0      1     
151 4922c900         0    1    90004c   9:575            8      2      1      1      1     
152 49221028         0    0    9000b3   9:2085           0      0      0      0      0     
153 48c23028         0    1    a00001   10:4             50     2      0      0      1     
154 48c23780         0    1    b00001   11:4             50     2      0      0      1     
155 48c24028         0    1    c00001   12:4             50     2      0      0      1     
156 48c24780         0    1    d00001   13:4             50     2      0      0      1     
 53 active, 156 total

[informix@vm84145 ~]$ 

打印锁信息

语法:

onstat -k

操作演示:

[informix@vm84145 ~]$ onstat -k

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 02:12:45 -- 2374324 Kbytes

Locks
address          wtlist           owner            lklist           type     tblsnum  rowid    key#/bsiz
4424d0b0         0                475b09c0           0                    S    100002   204         0       
4424d138         0                475b1b50           0                HDR+S    100002   204         0       
4424d2d0         0                475b1288           448c9550         HDR+S    100002   201         0       
4424d710         0                475b2ce0           0                    S    100002   204         0       
448c9550         0                475b1288           0                    S    100002   204         0       
 5 active, 100000 total, 32768 hash buckets, 0 lock table overflows

[informix@vm84145 ~]$ 


锁类型

打印系统运行状态统计

显示数据库运行时的一些重要统计信息。
语法

onstat -p

操作演示

[informix@vm84145 ~]$ onstat -p

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 02:14:11 -- 2374324 Kbytes

Profile
dskreads   pagreads   bufreads   %cached dskwrits   pagwrits   bufwrits   %cached
2167       2728       38492      94.37   1062       2178       4184       74.62  

isamtot    open       start      read       write      rewrite    delete     commit     rollbk
33839      1640       1907       10654      1439       271        32         116        0

gp_read    gp_write   gp_rewrt   gp_del     gp_alloc   gp_free    gp_curs   
2          0          0          0          0          0          2         

ovlock     ovuserthread ovbuff     usercpu  syscpu   numckpts   flushes   
0          0            0          2.71     1.81     11         24        

bufwaits   lokwaits   lockreqs   deadlks    dltouts    ckpwaits   compress   seqscans  
47         0          17290      0          0          2          27         125       

ixda-RA    idx-RA     da-RA      logrec-RA  RA-pgsused lchwaits  
601        144        71         2          206        43      

[informix@vm84145 ~]$ 

重复运行命令

可以使用-r参数,每隔指定秒数,执行一次命令。
语法

onstat -r <seconds>

操作演示

[informix@vm84145 ~]$ onstat -r 2

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 02:19:44 -- 2374324 Kbytes


Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 02:19:46 -- 2374324 Kbytes


Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 02:19:48 -- 2374324 Kbytes


Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 02:19:50 -- 2374324 Kbytes

......
[informix@vm84145 ~]$


打印用户线程

语法

onstat -u

操作演示;

[informix@vm84145 ~]$ onstat -u

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 02:20:57 -- 2374324 Kbytes

Userthreads
address          flags   sessid   user     tty      wait             tout locks nreads   nwrites
47599028         ---P--D 1        informix -        0                0    0     63       860
475998f0         ---P--F 0        informix -        0                0    0     0        903
4759a1b8         ---P--F 0        informix -        0                0    0     0        109
4759aa80         ---P--F 0        informix -        0                0    0     0        45
4759b348         ---P--F 0        informix -        0                0    0     0        1
4759bc10         ---P--F 0        informix -        0                0    0     0        1
4759c4d8         ---P--F 0        informix -        0                0    0     0        1
4759cda0         ---P--F 0        informix -        0                0    0     0        1
4759d668         ---P--F 0        informix -        0                0    0     0        1
4759df30         ---P--F 0        informix -        0                0    0     0        0
4759e7f8         ---P--F 0        informix -        0                0    0     0        0
4759f0c0         ---P--F 0        informix -        0                0    0     0        0
4759f988         ---P--F 0        informix -        0                0    0     0        0
475a0250         ---P--F 0        informix -        0                0    0     0        0
475a0b18         ---P--F 0        informix -        0                0    0     0        0
475a13e0         ---P--F 0        informix -        0                0    0     0        0
475a1ca8         ---P--F 0        informix -        0                0    0     0        0
475a2570         ---P--F 0        informix -        0                0    0     0        0
475a2e38         ---P--F 0        informix -        0                0    0     0        0
475a3700         ---P--F 0        informix -        0                0    0     0        0
475a3fc8         ---P--F 0        informix -        0                0    0     0        0
475a4890         ---P--F 0        informix -        0                0    0     0        0
475a5158         ---P--F 0        informix -        0                0    0     0        0
475a5a20         ---P--F 0        informix -        0                0    0     0        0
475a62e8         ---P--F 0        informix -        0                0    0     0        0
475a6bb0         ---P--F 0        informix -        0                0    0     0        0
475a7478         ---P--F 0        informix -        0                0    0     0        0
475a7d40         ---P--F 0        informix -        0                0    0     0        0
475a8608         ---P--F 0        informix -        0                0    0     0        0
475a8ed0         ---P--F 0        informix -        0                0    0     0        0
475a9798         ---P--F 0        informix -        0                0    0     0        0
475aa060         ---P--F 0        informix -        0                0    0     0        0
475aa928         ---P--F 0        informix -        0                0    0     0        0
475ab1f0         ---P--- 6        informix -        0                0    0     0        0
475abab8         Y--P--D 43       informix -        4413fd40         0    0     0        0
475ac380         Y--P--D 8        informix -        48aa07e8         0    0     525      0
475acc48         ---P--D 9        informix -        0                0    0     0        0
475addd8         ---P--D 13       informix -        0                0    0     0        35
475aef68         ---P--D 14       informix -        0                0    0     2        0
475af830         ---P--D 15       informix -        0                0    0     0        0
475b00f8         ---P--D 16       informix -        0                0    0     0        0
475b09c0         ---P--- 52       informix -        0                0    1     598      40
475b1288         ---P--- 51       informix -        0                0    2     1        43
475b1b50         ---P--- 50       informix -        0                0    1     0        0
475b2418         ---P--B 48       informix -        0                0    0     0        0
475b2ce0         ---P--- 53       informix -        0                0    1     398      92
 46 active, 128 total, 50 maximum concurrent

[informix@vm84145 ~]$ 


flags说明

打印事务

语法

onstat -x

操作演示:


[informix@vm84145 ~]$ onstat -x

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 1 days 01:54:53 -- 2374324 Kbytes

Transactions
                                                                                           est.    
address          flags userthread       locks  begin_logpos      current logpos    isol    rb_time  retrys coord
475e0028         A---- 47599028         0      -                 -                 COMMIT  -        0      
475e0398         A---- 475998f0         0      -                 -                 COMMIT  -        0      
475e0708         A---- 4759a1b8         0      -                 -                 COMMIT  -        0      
475e0a78         A---- 4759aa80         0      -                 -                 COMMIT  -        0      
475e0de8         A---- 4759b348         0      -                 -                 COMMIT  -        0      
475e1158         A---- 4759bc10         0      -                 -                 COMMIT  -        0      
475e14c8         A---- 4759c4d8         0      -                 -                 COMMIT  -        0      
475e1838         A---- 4759cda0         0      -                 -                 COMMIT  -        0      
475e1ba8         A---- 4759d668         0      -                 -                 COMMIT  -        0      
475e1f18         A---- 4759df30         0      -                 -                 COMMIT  -        0      
475e2288         A---- 4759e7f8         0      -                 -                 COMMIT  -        0      
475e25f8         A---- 4759f0c0         0      -                 -                 COMMIT  -        0      
475e2968         A---- 4759f988         0      -                 -                 COMMIT  -        0      
475e2cd8         A---- 475a0250         0      -                 -                 COMMIT  -        0      
475e3048         A---- 475a0b18         0      -                 -                 COMMIT  -        0      
475e33b8         A---- 475a13e0         0      -                 -                 COMMIT  -        0      
475e3728         A---- 475a1ca8         0      -                 -                 COMMIT  -        0      
475e3a98         A---- 475a2570         0      -                 -                 COMMIT  -        0      
475e3e08         A---- 475a2e38         0      -                 -                 COMMIT  -        0      
475e4178         A---- 475a3700         0      -                 -                 COMMIT  -        0      
475e44e8         A---- 475a3fc8         0      -                 -                 COMMIT  -        0      
475e4858         A---- 475a4890         0      -                 -                 COMMIT  -        0      
475e4bc8         A---- 475a5158         0      -                 -                 COMMIT  -        0      
475e4f38         A---- 475a5a20         0      -                 -                 COMMIT  -        0      
475e52a8         A---- 475a62e8         0      -                 -                 COMMIT  -        0      
475e5618         A---- 475a6bb0         0      -                 -                 COMMIT  -        0      
475e5988         A---- 475a7478         0      -                 -                 COMMIT  -        0      
475e5cf8         A---- 475a7d40         0      -                 -                 COMMIT  -        0      
475e6068         A---- 475a8608         0      -                 -                 COMMIT  -        0      
475e63d8         A---- 475a8ed0         0      -                 -                 COMMIT  -        0      
475e6748         A---- 475a9798         0      -                 -                 COMMIT  -        0      
475e6ab8         A---- 475aa060         0      -                 -                 COMMIT  -        0      
475e6e28         A---- 475aa928         0      -                 -                 COMMIT  -        0      
475e7198         A---- 475ab1f0         0      -                 -                 COMMIT  -        0      
475e7508         A---- 475abab8         0      -                 -                 COMMIT  -        0      
475e7878         A---- 475ac380         0      -                 -                 DIRTY   -        0      
475e7be8         A---- 475acc48         0      -                 -                 COMMIT  -        0      
475e7f58         A---- 475b2ce0         0      -                 -                 NOTRANS -        0      
475e82c8         A---- 475b09c0         0      -                 -                 NOTRANS -        0      
475e8638         A---- 475addd8         0      -                 -                 COMMIT  -        0      
475e89a8         A---- 475aef68         0      -                 -                 COMMIT  -        0      
475e8d18         A---- 475af830         0      -                 -                 COMMIT  -        0      
475e9088         A---- 475b00f8         0      -                 -                 COMMIT  -        0      
475e93f8         A---- 475b1288         0      -                 -                 NOTRANS -        0      
475e9768         A---- 475b2ce0         1      -                 -                 DIRTY   -        0      
475e9ad8         A---- 475b1288         2      -                 -                 DIRTY   -        0      
475e9e48         A---- 475b09c0         1      -                 -                 DIRTY   -        0      
475ea1b8         A---- 475b1b50         1      -                 -                 COMMIT  -        0      
475ea528         A---- 475b2418         0      -                 -                 COMMIT  -        0      
 49 active, 128 total, 51 maximum concurrent

[informix@vm84145 ~]$ 


flags标志说明

打印操作系统的信息

语法

onstat -g osi

操作演示

[informix@vm84145 ~]$ onstat -g osi

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 1 days 02:15:17 -- 2374324 Kbytes


Machine Configuration....
OS Name                                 Linux
OS Release                              3.10.0-957.el7.x86_64
OS Node Name                            vm84145
OS Version                              #1 SMP Thu Nov 8 23:39:32 UTC 2018
OS Machine                              x86_64
Number of processors                    4
Number of online processors             4
System memory page size                 4096 bytes
System memory                           7821 MB
System free memory                      7200 MB
Number of open files per process        1024
shmmax                                  9223372036854775807
shmmin                                  1
shmids                                  4096
shmNumSegs                              9223372036854775807
semmap                                  <<  UnSupported  >>
semids                                  128
semnum                                  32000
semundo                                 <<  UnSupported  >>
semNumPerID                             250
semops                                  32
semUndoPerProc                          <<  UnSupported  >>
semUndoSize                             20
semMaxValue                             32767

[informix@vm84145 ~]$ 

打印环境变量值

语法

onstat -g env

操作演示

[informix@vm84145 ~]$ onstat -g env

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 1 days 02:20:24 -- 2374324 Kbytes

Server start-up environment:

Variable            Value [values-list]
CLIENT_LOCALE       zh_cn.utf8
DBDELIMITER         |
DBPATH              .
DBPRINT             lp -s
DBTEMP              /home/informix/sinodb/tmp
                    [/home/informix/sinodb/tmp]
                    [/tmp]
DB_LOCALE           zh_cn.utf8
IGNORE_UNDERFLOW    1
INFORMIXDIR         /home/informix/sinodb
                    [/home/informix/sinodb]
                    [/usr/informix]
INFORMIXSERVER      sinodb
INFORMIXSQLHOSTS    /home/informix/sinodb/etc/sqlhosts.sinodb
INFORMIXTERM        termcap
                    [termcap]
                    [terminfo]
LANG                en_US.UTF-8
LC_COLLATE          en_US.UTF-8
LC_CTYPE            en_US.UTF-8
LC_MONETARY         en_US.UTF-8
LC_NUMERIC          en_US.UTF-8
LC_TIME             en_US.UTF-8
LKNOTIFY            yes
LOCKDOWN            no
NODEFDAC            no
ONCONFIG            onconfig.sinodb
PATH                /home/informix/sinodb/bin:/home/informix/sinodb/extend/krak
                     atoa/jre/bin:/usr/bin:/usr/lib64/qt-3.3/bin:/home/informix
                     /perl5/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/u
                     sr/sbin:/home/informix/.local/bin:/home/informix/bin:.
SERVER_LOCALE       en_US.819
SHELL               /bin/bash
TERM                vt100
                    [vt100]
                    [dumb]
TERMCAP             /home/informix/sinodb/etc/termcap
                    [/home/informix/sinodb/etc/termcap]
                    [/etc/termcap]


[informix@vm84145 ~]$ 

打印配置参数的当前值

语法

onstat -g cfg [full | diff | tunable | msg] [param_name]

操作演示

[informix@vm84145 ~]$ onstat -g cfg

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 1 days 04:44:30 -- 2374324 Kbytes

Configuration Parameter List

name                      current value
ROOTNAME                  rootdbs
ROOTPATH                  /home/informix/dbs/rootdbs
ROOTOFFSET                0
ROOTSIZE                  2048000
MIRROR                    0
MIRRORPATH                /home/informix/sinodb/tmp/demo_on.root_mirror
MIRROROFFSET              0
DBSERVERNAME              sinodb
DBSERVERALIASES           
SERVERNUM                 0
MSGPATH                   /home/informix/sinodb/tmp/online.log
CONSOLE                   /home/informix/sinodb/tmp/online.con
TAPEDEV                   /home/informix/backup
TAPESIZE                  0
TAPEBLK                   32
LTAPEDEV                  /home/informix/backup
......
ENCRYPT_SMX               0
EILSEQ_COMPAT_MODE        0
CDR_AUTO_DISCOVER         0
IFXGUARD                  enable=1,timeout=-1
SMX_NUMPIPES              1

[informix@vm84145 ~]$ 

打印 checkpoint 历史记录和配置建议

语法

onstat -g ckp

操作演示

[informix@vm84145 ~]$ onstat -g ckp

Sinoregal SinoDB Dynamic Server Version 12.10.FC8 -- On-Line -- Up 1 days 05:21:56 -- 2374324 Kbytes

AUTO_CKPTS=On   RTO_SERVER_RESTART=Off   

                                                                    Critical Sections                          Physical Log    Logical Log    
           Clock                                  Total Flush Block #      Ckpt  Wait  Long  # Dirty   Dskflu  Total    Avg    Total    Avg   
Interval   Time      Trigger    LSN               Time  Time  Time  Waits  Time  Time  Time  Buffers   /Sec    Pages    /Sec   Pages    /Sec  
1420       17:12:05  CKPTINTVL  15:0x18c6018      0.0   0.0   0.0   0      0.0   0.0   0.0   336       336     329      0      66       0     
1421       18:12:05  CKPTINTVL  15:0x1902018      0.0   0.0   0.0   0      0.0   0.0   0.0   326       326     321      0      60       0     
1422       19:12:05  CKPTINTVL  15:0x1952018      0.0   0.0   0.0   0      0.0   0.0   0.0   351       351     343      0      80       0     
1423       20:07:06  CKPTINTVL  15:0x195a018      0.0   0.0   0.0   0      0.0   0.0   0.0   9         9       26       0      8        0     
1424       20:12:06  CKPTINTVL  15:0x1990018      0.0   0.0   0.0   0      0.0   0.0   0.0   315       315     314      1      54       0     
1425       21:07:06  CKPTINTVL  15:0x1998018      0.0   0.0   0.0   0      0.0   0.0   0.0   9         9       27       0      8        0     
1426       21:12:06  CKPTINTVL  15:0x19d3018      0.0   0.0   0.0   0      0.0   0.0   0.0   326       326     322      1      59       0     
1427       22:02:06  CKPTINTVL  15:0x19db018      0.0   0.0   0.0   0      0.0   0.0   0.0   10        10      28       0      8        0     
1428       22:12:06  CKPTINTVL  15:0x1a11018      0.0   0.0   0.0   0      0.0   0.0   0.0   316       316     313      0      54       0     

Max Plog       Max Llog       Max Dskflush   Avg Dskflush   Avg Dirty      Blocked      
pages/sec      pages/sec      Time           pages/sec      pages/sec      Time         
10240          1280           0              146            0              0            

[informix@vm84145 ~]$