Informix之onparams语法及实例(日志部份)

本文介绍了Informix数据库管理系统中onparams命令的基本用法和实例,涉及添加、删除逻辑日志文件,修改物理日志大小等操作。通过onstat -l命令监控日志状态,展示如何进行日志管理,包括逻辑日志的切换和检查点调整。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

(其中红色字体为手工输入,蓝色字体为主要变化关注点。)

1、基本用法:

-bash-3.1$ onparams --

Usage:  onparams  { -a -d <DBspace> [-s <size>] [-i] }                      |

                  { -b -g <pagesize> [-n <number of buffers>]

                   [-r <number of LRUs>] [-x <maxdirty>] [-m <mindirty>] }  |

                  { -d -l <log file number> [-y] }                          |

                  { -p -s <size> [-d <DBspace>] [-y] }

 

    -a  - Add a logical log file

    -b  - Add a buffer pool

    -i  - Insert after current log

    -d  - Drop a logical log file

    -p  - Change physical log size and location

    -y  - Automatically responds "yes" to all prompts

-s没有指明大小,则取onconfig里配置文件中指定大小。

2、实例:

-bash-3.1$ onparams -a -d rootdbs -s 10000

Log operation started. To monitor progress, use the onstat -l command.

Logical log successfully added.

-bash-3.1$ onstat -l

IBM Informix Dynamic Server Version 11.50.UC1DE -- On-Line -- Up 00:02:14 -- 93844 Kbytes

Physical Logging

。。。。。。(略)

Logical Logging

Buffer bufused  bufsize  numrecs    numpages   numwrits   recs/pages pages/io

  L-3  0        16       11501      1245       998        9.2        1.2    

     Subsystem    numrecs    Log Space used

     OLDRSAM      11498      1202256      

     HA           3          132          

address  number   flags    uniqid   begin                size     used    %used

。。。。。。(略)

44e10758 10       A------  0        1:91263             10000        0     0.00

46dedec8 11       A------  0        1:110203             5000        0     0.00

 11 active, 11 total

(其中size显示为5000,因为其单位为页,而-sKB。)

-bash-3.1$ onparams -d -l 11

WARNING: Dropping a logical log file.

Do you really want to continue? (y/n)y

Logical log 11 successfully dropped.

-bash-3.1$ onparams -p -d rootdbs -s 2000

Do you really want to change the physical log? (y/n)y

Log operation started. To monitor progress, use the onstat -l command.

** WARNING ** Because the physical log has been modified, a level 0 archive

must be taken of the following space before an incremental archive will be

permitted for it: rootdbs

(see Dynamic Server Administrator's manual)

-bash-3.1$ onstat -l

IBM Informix Dynamic Server Version 11.50.UC1DE -- On-Line -- Up 00:08:38 -- 93844 Kbytes

Physical Logging

Buffer bufused  bufsize  numpages   numwrits   pages/io

  P-1  0        16       515        42         12.26

      phybegin         physize    phypos     phyused    %used  

      1:263            1000       317        0          0.00   

Logical Logging

。。。。。。(略)

3、转换逻辑日志:

-bash-3.1$ onstat -l

。。。。。。(略)

address  number   flags    uniqid   begin                size     used    %used

44e104d0 1        U-B----  1        1:1263              10000    10000   100.00

44e10518 2        U-B----  2        1:11263             10000    10000   100.00

44e10560 3        U-B----  3        1:21263             10000    10000   100.00

44e105a8 4        U---C-L  4        1:31263             10000     9741    97.41

44e105f0 5        A------  0        1:41263             10000        0     0.00

。。。。。。(略)

 10 active, 10 total

-bash-3.1$ onmode –l (将当前逻辑日志文件换到下一个)

-bash-3.1$ onstat -l

。。。。。。(略)

address  number   flags    uniqid   begin                size     used    %used

44e104d0 1        U-B----  1        1:1263              10000    10000   100.00

44e10518 2        U-B----  2        1:11263             10000    10000   100.00

44e10560 3        U-B----  3        1:21263             10000    10000   100.00

44e105a8 4        U-B---L  4        1:31263             10000     9742    97.42

44e105f0 5        U---C--  5        1:41263             10000        3     0.03

。。。。。。(略)

 10 active, 10 total

-bash-3.1$ onmode –c (调整last checkpoint到当前逻辑日志文件)

-bash-3.1$ onstat -l

。。。。。。(略)

address  number   flags    uniqid   begin                size     used    %used

44e104d0 1        U-B----  1        1:1263              10000    10000   100.00

44e10518 2        U-B----  2        1:11263             10000    10000   100.00

44e10560 3        U-B----  3        1:21263             10000    10000   100.00

44e105a8 4        U-B----  4        1:31263             10000     9742    97.42

44e105f0 5        U---C-L  5        1:41263             10000        5     0.05

。。。。。。(略)

 10 active, 10 total

(注,其中flags的意思如下。F: free,available for use;  B: backed-up;  C: currently receiving transactions;  U: used;  A: newly added;  L: contains last completed checkpoint.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值