Logging on to Utilities with no TDPID

Tools
Enthusiast

Logging on to Utilities with no TDPID

Hello all:

My question is for any utility, but we can use BTEQ as an example.

.LOGON tdpid/username,logon

My understanding is the tdpid optional, however, if I run this from a bteq prompt:

.LOGON username,logon

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!!!

6 REPLIES
Senior Apprentice

Re: Logging on to Utilities with no TDPID

No magic, but a default for TDPID :-)

To get a successful logon, "dbc" must be resolvable to an ip-address.

Dieter

Enthusiast

Re: Logging on to Utilities with no TDPID

Hi Dieter:

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.

--Todd

Senior Apprentice

Re: Logging on to Utilities with no TDPID

Hi Todd,

"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.

Dieter

Enthusiast

Re: Logging on to Utilities with no TDPID

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...

.LOGON dbc,password 

...doesn't work...

C:\Users\Todd>bteq


 Teradata BTEQ 13.10.00.01 for WIN32.

 Copyright 1984-2010, Teradata Corporation. ALL RIGHTS RESERVED.

 Enter your logon or BTEQ command:

.LOGON dbc,password_removed

.LOGON dbc,password_removed

 *** Error:  Invalid logon!

 *** Total elapsed time was 1 second.

 Teradata BTEQ 13.10.00.01 for WIN32. Enter your logon or BTEQ command:

However, if I just use .logon and manually enter user name and password it works...


C:\Users\Todd>bteq

 Teradata BTEQ 13.10.00.01 for WIN32.

 Copyright 1984-2010, Teradata Corporation. ALL RIGHTS RESERVED.

 Enter your logon or BTEQ command:

.logon

.logon

UserId: dbc

Password:

 *** Logon successfully completed.

 *** Teradata Database Release is 13.00.00.12

 *** Teradata Database Version is 13.00.00.12

 *** Transaction Semantics are BTET.

 *** Session Character Set Name is 'ASCII'.

 *** Total elapsed time was 3 seconds.

 BTEQ -- Enter your SQL request or BTEQ command:

Senior Apprentice

Re: Logging on to Utilities with no TDPID

Hi Todd,

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:

http://developer.teradata.com/connectivity/articles/logging-on-teradata-database-sessions-via-bteq

Dieter

Enthusiast

Re: Logging on to Utilities with no TDPID

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!!!

--Todd