My question is for any utility, but we can use BTEQ as an example.
My understanding is the tdpid optional, however, if I run this from a bteq prompt:
I get an invalid logon.
How do you logon to a utility without using the tdpid (no hosts file)? How can it get this to work?
I could maybe understand if Teradata was running locally on your system, but this failed (at least in my test).
I'm confused how to set this up. Is it magic? :p
Thank you for your help on this!!!
Thank you for your reply. I'm still a little confused, but if anyone can help it is you! Thank you.
So if no TDPID is given then a default one is used? That makes sense.
And can you also set up user names (you refer to "dbc") to resolve to particular IPs in the TDP?
What if you have the same user name on two different remote systems? You can only set a default for one of them correct and you have to use a TDPID (host file) with the other?
Finally, if you want to bypass the hosts file this...
.LOGON username, password
...would work and use the default TDPID?
If that is the case I think I have a bug in my code! Looking forward to your response.
"dbc" doesn't mean the user dbc, it's just the default value for TDPID (dbc = DataBase Computer).
This default can be modified for utilities using CLI (like BTEQ or the load tools):
There's a file "clispb.dat" in the CLI installation directory and one of the entries is "i_dbcpath=dbc", this would be the global default used when no TPDID is supplied. When you set an environment variable "COPLIB" to a directory path where a copy of this file is located, you can specify a different default.
Check the CLI manual for details on this "System Parameter Block".
Btw, it's not bypassing the name resolution (hosts file etc.), it's just a default name used for the resolution. Of course you could also use an ip-address instead of a name, but this is not recommended for multi-node systems as it will prevent session balancing across nodes.
Thank you Dieter. That clears A LOT up! I still is a little magical. :p
I do have one more problem with logging in...
It sounds like I still need an entry in the hosts file for dbccop1 then. Is this correct? Here I've though all these years people were bypassing the hosts file somehow.
I've looked at the clispb.dat file on my pc and confirmed that the i_dbcpath is "dbc".
I've set and entry for this in my hosts file (DBCcop1).
However, I can only seem to successfully log in one way...
when BTEQ is used in interactive mode you *never* add the password to the ".logon [tdpid/]user", it's always entered after the pw prompt.
".LOGON user,password" is only for batch mode or .RUN FILE
You don't need an entry in the hosts file, but the TDPID must be resolvable using DNS or whatever.
There's an article on this topic:
Okay. Thank you. That makes sense again as it exposed the password.
I've just been used to using a batch script "bteq < scriptname" so I guessed that was the way to do it. Apparently the utilities are smart enough to know when you are redirecting input to it and when you are in interactive mode. Great!
So it may not be magic afterall, but it does take a Teradata wizard to help make sense of it all so thank you!!!