【问题标题】:Informix - Locked DB due to lock created by cancelled session?Informix - 由于取消会话创建的锁定而锁定数据库?
【发布时间】:2018-04-23 13:50:37
【问题描述】:

SI 尝试运行一个脚本来在我的 Informix 数据库中生成一个表,但该脚本在 EOF 处缺少换行符,因此我认为 Informix 无法读取它,因此该脚本被阻止,什么也不做。我不得不终止脚本并将新行添加到文件中,所以现在脚本工作正常,除了由于我突然终止脚本时创建的 locke 而没有创建表。

我是新手,很抱歉这个愚蠢的问题。 IBM 页面现在没有关于如何清理它的清晰简单的说明。

所以,我的问题是:我如何解锁锁,以便我可以继续在我的脚本中工作?

admin_proyecto@li1106-217 # onstat -k

IBM Informix Dynamic Server Version 12.10.FC9DE -- On-Line (CKPT REQ) -- Up 9 ds
Blocked:CKPT

Locks
address          wtlist           owner            lklist           type     tbz
44199028         0                44ca6830           0                HDR+S
44199138         0                44cac0a0           0                HDR+S
441991c0         0                44cac0a0           4419b6f0         HDR+IX
44199358         0                44ca44d0           0                    S
441993e0         0                44ca44d0           44199358         HDR+S
4419ac50         0                44cac0a0           441991c0         HDR+X
4419aef8         0                44ca44d0           441993e0         HDR+IX
4419b2b0         0                44ca79e0           0                    S
4419b3c0         0                44ca82b8           0                    S
4419b6f0         0                44cac0a0           44199138         HDR+X
4419b998         0                44ca8b90           0                    S
4419bdd8         0                44ca44d0           4419aef8         HDR+X
 12 active, 20000 total, 16384 hash buckets, 0 lock table overflows

【问题讨论】:

  • 线索在消息中 ;) (CKPT REQ) .... Blocked:CKPT 您的 IDS 服务器被阻塞等待检查点。检查您的在线日志 (onstat -m) 并阅读:www-01.ibm.com/support/docview.wss?uid=swg21148482
  • 您似乎再次陷入逻辑日志已满但未备份的问题,因此无法重用它们。 onstat -l 的输出是什么?
  • 我无法解决问题,所以我只运行了 oninit -i。我知道这会删除所有内容,但在这个阶段,这并不重要,因为我刚刚开始创建数据库。现在我重新创建了两个空间,它又可以正常工作了。我还更正了脚本,现在它没有挂起会话。
  • 使用目录而不是文件,@MatiasBarrios。
  • 您将以informix 运行,并使用onmode -wf LTAPEDEV=/new/location 对onconfig 文件进行更改。运行onmode 不带参数作为informix 以查看可用选项。 (说“as informix”是 POSIX 所说的“适当特权”的简写。)

标签: informix locked


【解决方案1】:

在我的“玩具”系统上,我通常将LTAPEDEV 指向一个目录:

LTAPEDEV /usr/informix/dumps/motor_003/backups

然后,当 Informix 由于其所有逻辑日志已满而阻塞时,我手动执行ontape -a 以将使用的逻辑日志备份到文件并释放它们以供重用。

例如,这里有一个 Informix 实例由于没有可用的逻辑日志而被阻止:

$ onstat -l

IBM Informix Dynamic Server Version 12.10.FC8DE -- On-Line (CKPT REQ) -- Up 00:18:58 -- 213588 Kbytes
Blocked:CKPT

Physical Logging
Buffer bufused  bufsize  numpages   numwrits   pages/io
  P-1  0        64       1043       21         49.67
      phybegin         physize    phypos     phyused    %used
      2:53             51147      28085      240        0.47

Logical Logging
Buffer bufused  bufsize  numrecs    numpages   numwrits   recs/pages pages/io
  L-1  13       64       191473     12472      6933       15.4       1.8
        Subsystem    numrecs    Log Space used
        OLDRSAM      191470     15247376
        HA           3          132

Buffer Waiting
Buffer  ioproc   flags
  L-1   0        0x21     0

address          number   flags    uniqid   begin                size     used    %used
44d75f88         1        U------  47       3:15053              5000        5     0.10
44b6df68         2        U---C-L  48       3:20053              5000     4986    99.72
44c28f38         3        U------  41       3:25053              5000     5000   100.00
44c28fa0         4        U------  42       3:53                 5000     2843    56.86
44d59850         5        U------  43       3:5053               5000        5     0.10
44d598b8         6        U------  44       3:10053              5000        5     0.10
44d59920         7        U------  45       3:30053              5000        5     0.10
44d59988         8        U------  46       3:35053              5000        5     0.10
 8 active, 8 total

在我的在线日志中:

$ onstat -m

04/23/18 18:20:42  Logical Log Files are Full -- Backup is Needed

所以我手动发出命令:

$ ontape -a

Performing automatic backup of logical logs.

File created: /usr/informix/dumps/motor_003/backups/informix003.ifx.marqueslocal_3_Log0000000041
File created: /usr/informix/dumps/motor_003/backups/informix003.ifx.marqueslocal_3_Log0000000042
File created: /usr/informix/dumps/motor_003/backups/informix003.ifx.marqueslocal_3_Log0000000043
File created: /usr/informix/dumps/motor_003/backups/informix003.ifx.marqueslocal_3_Log0000000044
File created: /usr/informix/dumps/motor_003/backups/informix003.ifx.marqueslocal_3_Log0000000045
File created: /usr/informix/dumps/motor_003/backups/informix003.ifx.marqueslocal_3_Log0000000046
File created: /usr/informix/dumps/motor_003/backups/informix003.ifx.marqueslocal_3_Log0000000047
File created: /usr/informix/dumps/motor_003/backups/informix003.ifx.marqueslocal_3_Log0000000048
Do you want to back up the current logical log? (y/n) n

Program over.

如果我再次检查逻辑日志的状态:

$ onstat -l

IBM Informix Dynamic Server Version 12.10.FC8DE -- On-Line -- Up 00:23:42 -- 213588 Kbytes

Physical Logging
Buffer bufused  bufsize  numpages   numwrits   pages/io
  P-2  33       64       1090       24         45.42
      phybegin         physize    phypos     phyused    %used
      2:53             51147      28091      36         0.07

Logical Logging
Buffer bufused  bufsize  numrecs    numpages   numwrits   recs/pages pages/io
  L-1  0        64       291335     15878      7023       18.3       2.3
        Subsystem    numrecs    Log Space used
        OLDRSAM      291331     22046456
        HA           4          176

address          number   flags    uniqid   begin                size     used    %used
44d75f88         1        U-B----  47       3:15053              5000        5     0.10
44b6df68         2        U-B----  48       3:20053              5000     5000   100.00
44c28f38         3        U---C-L  49       3:25053              5000     3392    67.84
44c28fa0         4        U-B----  42       3:53                 5000     2843    56.86
44d59850         5        U-B----  43       3:5053               5000        5     0.10
44d598b8         6        U-B----  44       3:10053              5000        5     0.10
44d59920         7        U-B----  45       3:30053              5000        5     0.10
44d59988         8        U-B----  46       3:35053              5000        5     0.10
 8 active, 8 total

逻辑日志现在被标记为“已备份”并且可以重复使用,并且 Informix 实例不再在 Blocked:CKPT 上被阻止。

【讨论】:

    猜你喜欢
    • 2011-03-09
    • 1970-01-01
    • 1970-01-01
    • 2021-11-27
    • 2020-03-22
    • 2019-05-05
    • 2012-12-25
    • 1970-01-01
    • 2021-11-06
    相关资源
    最近更新 更多