如何处理DB2的I期刊状态

问题描述 投票:0回答:2

要测试一个自动清理DB2 for i中2天以上日志的qshell脚本,我需要在状态中使用一些非附加或在线的日志(该脚本会跳过具有此类状态的日志)。有人可以帮助我,并建议如何使用System I导航器或SQL语句更改/更新日志状态。

目前,我在“日志接收器”部分中有“已附加”状态的项目,当我更改日记的接收器时,将创建一个新的日志接收器处于附加状态,前一个接收器将移动到在线状态。我还没有找到任何方法将它们转移到其他状态。我也尝试使用SQL语句从DISPLAY_JOURNAL获取一些信息但是取得了成功。

select * from TABLE (QSYS2.DISPLAY_JOURNAL(
    'QSYS2',    -- put the JOURNAL_LIBRARY parameter value instead of 'JOURNAL_LIBRARY' (VARCHAR(10))
    'QSQJRN',   -- put the JOURNAL_NAME parameter value instead of 'JOURNAL_NAME' (VARCHAR(10))
    '', -- put the STARTING_RECEIVER_LIBRARY parameter value instead of 'STARTING_RECEIVER_LIBRARY' (VARCHAR(10))
    '', -- put the STARTING_RECEIVER_NAME parameter value instead of 'STARTING_RECEIVER_NAME' (VARCHAR(10))
    '', -- put the STARTING_TIMESTAMP parameter value instead of 'STARTING_TIMESTAMP' (TIMESTAMP)
    '', -- put the STARTING_SEQUENCE parameter value instead of 'STARTING_SEQUENCE' (DECIMAL(21,0))
    '', -- put the JOURNAL_CODES parameter value instead of 'JOURNAL_CODES' (VARCHAR(48))
    '', -- put the JOURNAL_ENTRY_TYPES parameter value instead of 'JOURNAL_ENTRY_TYPES' (VARCHAR(1200))
    '', -- put the OBJECT_LIBRARY parameter value instead of 'OBJECT_LIBRARY' (VARCHAR(10))
    '', -- put the OBJECT_NAME parameter value instead of 'OBJECT_NAME' (VARCHAR(10))
    '', -- put the OBJECT_OBJTYPE parameter value instead of 'OBJECT_OBJTYPE' (VARCHAR(10))
    '', -- put the OBJECT_MEMBER parameter value instead of 'OBJECT_MEMBER' (VARCHAR(10))
    '', -- put the USER parameter value instead of 'USER' (VARCHAR(10))
    '', -- put the JOB parameter value instead of 'JOB' (VARCHAR(26))
    ''  -- put the PROGRAM parameter value instead of 'PROGRAM' (VARCHAR(10))
    )) AS X

SQL Error [42704]: [SQL0204] DISPLAY_JOURNAL in QSYS2 type *N not found.
  [SQL0204] DISPLAY_JOURNAL in QSYS2 type *N not found.

db2 db2-400
2个回答
0
投票

DISPLAY_JOURNAL仅在7.2版本之后可用

但是,你没有足够的选项来控制期刊删除吗?我让IBM我管理它们Methods to reduce the storage that journal receivers use


1
投票

日记接收器状态不是像数据库表中的状态字段那样可以更改的状态。它是对象本身的状态。您可以删除接收器一旦更改,并且不再是连接的接收器。但是,如果您尝试删除尚未保存的接收器,它将为您提供相应的消息。您可以保存日志接收器,即使它已连接,但最好的办法是,如果您不希望系统为您管理接收器,则更改接收器后保存接收器,然后您可以自由删除接收器随时。

所以也许你应该保存具有在线状态的接收器,然后你可以允许你的脚本删除它们。

© www.soinside.com 2019 - 2024. All rights reserved.