PowerWire.eu

Independent IBM i, AIX and Linux news and tech tips for Europe and beyond

  • Home
  • News
  • Technical Articles
    • IBM i
    • AIX
    • Linux
    • VIOS
  • Subscribe
  • About Us
  • Contact Us
  • Advertise with PowerWire.eu

WRKRDBDIRE part 2 – MYSELF and DDMDRDA

May 10, 2022 by David Shears Leave a Comment

Some of you may remember an article I wrote in December 2019 about using WRKRDBDIRE and DDM to get data from a V5R4 system. Recently I came across a couple of extra scenarios when pulling data from systems, so it seems a perfect opportunity for a part 2 article.

First off, what if I want to test DDM connectivity but I only have one server/partition available? Well luckily IBM have thought of this and there are two special names that can be used. The full article is here but to summarise the key point:

If you want to make a DRDA connection to the local system database, such as for program testing, there are two special RDB names that can be used for that purpose: ME and MYSELF

Using the ADDRDBDIRE command that we discussed last time, you can set up an entry such as:

ADDRDBDIRE RDB(MYSELF) RMTLOCNAME(loopback *IP)

You can then prefix your statements with ‘myself’ to pull from the local machine. Again, using my example from the last article:

 select * from mnis820.shearsd.emlrolk 

Becomes

 select * from myself.shearsd.emlrolk 

This is an edge case scenario, but one that’s useful to keep in your back pocket for the day you suddenly find yourself needing it. In most situations, if you wanted data from the local machine, you wouldn’t be going through DDM to get it.

A second scenario, which is more of a shortcut than anything else, is QDDMSERVER and QDDMDRDASERVER.

These are two special values that can be used in the ADDSVRAUTE command. If you don’t have a specific server auth entry for a given system, the connection will be attempted with the credentials on this entry. Again, IBM do quite a nice detailed breakdown if you’re interested.

QDDMDRDA is the better choice normally as it was PTF’d back to V5R4. I mention QDDM here for those of you who find yourself on an old system that doesn’t have the relevant PTFs, or maybe never got to V5R4 (they’re still out there!) I’m sure someone in the comments will correct me if I’m wrong on the PTFs.

Using the ADDSVRAUTE command I add the DDMDRDRA entry:

 ADDSVRAUTE USRPRF(SHEARSD) SERVER(QDDMDRDASERVER) USRID(SHEARSD) PASSWORD()

Meaning my DSPSVRAUTE command now has the original server specific entry, and my new generic one.

When I connect to MNIS820 it’ll still use the specific entry, but any other server I try to touch will use the new entry. In most cases, I’d recommend using specific entries where possible, as clearly, you’re not sharing passwords across partitions/servers. But if you have a use case where you’re replicating between multiple servers/partitions then this can save you having to create multiple entries on each one.

Hopefully this is helpful to some people out there who come across these edge cases, what other scenarios have you found for RDBDIRE and authorisation? Do you have a preferred method that hasn’t been discussed yet?

Filed Under: IBM i, Technical Articles Tagged With: IBM i, IBM Power Systems

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Free monthly newsletter signup

News

A screen a story – Not our problem anymore

Last week I ran into an issue, which did teach me something new about the command WRKPRB. After checking a … [Read More...]

Raspberry Pi and Machine Learning

In my last article, I demonstrated how I used Machine Learning on the Raspberry Pi to determine if a … [Read More...]

Shield Advanced Solutions – new Messaging and Monitoring solutions

September 2022 – Toronto As Shield Advanced Solutions celebrates the significant milestone, 25 years of … [Read More...]

More articles from this section

Quick Links

  • Advertise
  • Subscribe

Follow Us…

  • Email
  • LinkedIn
  • Twitter

Search This Website

Copyright © 2023 · Cue Communications · All Rights Reserved

Log in