TDP-ID

Database
N/A

TDP-ID

Hi,

I am able to logon to Teradata Database using SQL Assistant.

To logon to the same server using BTEQ, we need TDPID of the server to use with .logon command. Could anyone help me to find out how I can find the TDP-id of my teradata server.

Thanks.
4 REPLIES
Teradata Employee

Re: TDP-ID

If you are logging on other than from a mainframe, TDPID is the prefix for your Teradata hostnames (which must be set up in DNS or hosts file). Default is "dbc".

If you use MyTD as the TDPID, then MyTDcop1 should resolve to an IP address for your Teradata server. If you have multiple IPs then define MyTDcop2, MyTDcop3, etc. You can/should also define ABC as an alias for some or all of the "cop" IPs.

On a mainframe, TDPID is the four-character subsystem name assigned to the Teradata Director Program. Default is TDP0.
N/A

Re: TDP-ID

Hi,

I have tried to do this but still not successful.

Let me give you some back ground.

I am making the entry in the host file (c:\WINNT\system32\drivers\etc) as follows.

xxx.xx.xxx.x1 MyTD1
xxx.xx.xxx.x2 MyTD2 , as we have multiple servers.

Then, I try to logon using .logon username/MyTD1,password;
But it still fails.

Could you please explain in bit more detail if possible by citing an example.

Thanking you in advance.
N/A

Re: TDP-ID

Hi

Inorder to access BTEQ you must ensure that you have your TeraData system defined in your ETC\host file (c:\windows\system32\drivers\etc). You must open this file, you can use NOTEPAD for this.

This file should look something like this:

27.0.0.1 localhost DemoTDATcop1
??.??.???.??? dev devcop1
??.??.???.??? qa qacop1
??.??.???.??? prod prodcop1

Column1
The ??.??.???.??? is the current TCP/IP address of the server.

Column2
This the name of your TeraData System, ie. TeraDev or dev

Column3
This is the same name as the TeraData system but YOU MUST include the cop1 after it.

Now in you BTEQ you logon as follows (lets assume the dev system):

.logon dev/userid,password;

I suggest that you rather create a member with this line in and save it as LogonD.txt and call the password for this file using the following SYNTAX:

.run file = c:\TeraData\LogonD.txt

Lastly you might want to put all you SQL (DML, DDL, DCL) into a sperate file let say QUERY.txt, let assuem the following will be run (and if you have the correct access)

************************************** QUERY.TXT *****************************
run file = c:\TeraData\LogonD.txt
Delete from dba.dbstats where RunDate = Current_Date;

insert into dba.dbstats
sel *
from dbc.diskspace
where databasename in (
sel Databasename from dbc.databases where DBKind = 'D' and
OwnerName = 'SYSDBA' )
Order by DatabaseName;
.logoff
******************************************************************************

Now you can execute this either on the DOS command line as:
BTEQ < QUERY.TXT

OR you can create a DOS Batch file as follows:
On the DOS Command line type ==> EDIT QUERY.BAT

In side this file type:
BTEQ < QUERY.TXT > query.log

and save. The > pipe put the out put instead of on the screen into a file called query.log. You can either view this file to see ant errors. The first BTEQ with out the ">" pipe with display the errors on screen.

I trust this will help.....

N/A

Re: TDP-ID

Hi,

Finally i am able to logon to BTEQ. Thanks a lot. It seems that I was doing some minor mistakes that was preventing me from logging into the database.

Thanks once again.