Skip to content

Instantly share code, notes, and snippets.

@forstie
Created October 23, 2019 14:18
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
I was asked to provide a way to find journal receivers and discern whether or not they are attached or detached.
--
-- 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