I was asked to provide a way to find journal receivers and discern whether or not they are attached or detached.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- description: Which journal receivers are currently attached? | |
-- | |
select attached_journal_receiver_library, attached_journal_receiver_name | |
from qsys2.journal_info | |
where journal_library = 'PRODLIB' | |
order by 1,2; | |
-- | |
-- description: Which journal receivers are detached? | |
-- | |
with attached(jl, jrcv) as ( | |
select attached_journal_receiver_library, attached_journal_receiver_name | |
from qsys2.journal_info | |
where journal_library = 'PRODLIB' | |
order by 1,2 | |
) | |
select objname as detached_jrnrcv, a.* | |
from table ( | |
qsys2.object_statistics('PRODLIB', '*JRNRCV') | |
) as a | |
where objname not in (select jrcv from attached) ; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment