×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
On 15-Aug-2016 10:58 -0500, Steinmetz, Paul wrote:
I would like to force or change the object owner on an object
restore.
Ideally the owner would be the desired value when saved. Restore
will assign the same owner as was recorded on the media, or to the
/default/ owner (QDFTOWN) when the same-named User Profile (USRPRF) does
not exist at the restored-to system.
Is there a simple way to achieve this?
Yes, relatively simple, esp. for /QSYS.LIB objects. But as reactive
vs proactive, and thus if there would be repeated restores, /expensive/
in terms of system resources if effected after each restore on the
restored-to system, as contrasted with effecting the changes just once
on the saved-from system completed prior to the save.
The Output (OUTPUT) feature of the restore functions could be used to
provide the list of objects for which ownership should be changed; any
number of means can be utilized to process such a list from which to
build\perform the required Change Object Owner (CHGOBJOWN) [or CHGOWN]
requests; e.g. RCVF in a CLP, a SQL query, etc. -- noting that for
non-/QSYS.LIB objects, the likely stream file as output would need to be
copied to a PF for native RLA reads. Rather than /batching/ the
changes, with use of a pre-created Output File (OUTFILE) from the model
file QASRRSTO with record format QSRRST and specification of Add Records
(*ADD) for the Output Member Options (OUTMBR) parameter, the effect can
be achieved more directly by making the records available to a Trigger
that had been added to the file for the upcoming *AFTER *INSERT activity
-- though not likely much value to do so.
Many objects come shipped with owner of QPGMR, and that is not our
desired owner.
As worded, the issue seems possibly to be for restore of ¿3rd party?
/products/? If so, then might be worth asking why they do not have an
/application/ user [that maybe needs to be created as a pre-requisite to
installing their product]; while use of QPGMR might seem fine from their
perspective, they should realize that QPGMR will not be the same to
every installation, so they should avoid that imposition. I kinda
expected that IBM emphasized that 3rd party app providers should use
their own profile to avoid such issues.? Anyhow, if they do\will not
provide for application user(s), having created and saved with owner
QPGMR [and ??], then perhaps asking that they provide a script [with
variable\parameter input capability] or command that allows assigning
the desired alternative to the user profile QPGMR [and ??]; that way the
customer\recipient of the media need not try to figure out, and possibly
muck-up something, what to change [and what can be safely changed, and
to what user, according to some required minimum Special Authority
(SPCAUT) or other requirements].
FWiW: If the objects are specific to a library or two, there are
likely to be command+programs already [I have probably posted one way
back in the day], that achieves what is desired; e.g. variants of
CHGOWNLIB or CHGLIBOWN tools have long existed to change ownership [of
both the library object] and all objects within the named library, to a
named user profile [possibly coded to omit redundant requests for any
objects already owned by the user named to become the new owner].
As an Amazon Associate we earn from qualifying purchases.