BTEQ login help-LDAP and ksh

Tools
Enthusiast

BTEQ login help-LDAP and ksh

Not only I am a newbie to bteq, bu to ksh as well. I want to invoke bteq via ksh/unix. A coworker shared following script. I need to modify it as mylogin credentials require ldap.

  • Primary question-How do I modify the following script to make it work with ldap.  
  • Secondary question-If someone can explain how the following script works, that will be an added bonus.

Any insight is appreciated.

Thanks

vcbteq

----script

#!/usr/bin/ksh

# start bteq with optional sql file input

# usage: xxx <file>(.sql) /dn (d=dated log files; n=no logging)

#

USER="username"

PASSWD="password"

dateforlog=`date +%Y%m%d%H%M%S`

if [ -z $1 ]; then

bteq .logon xxx/$USER,$PASSWD

elif [ -z $2 ]; then

bteq .logon xxx/$USER,$PASSWD < $1.sql > $1.log

ls -ltr $1.log

elif [ $2 == "/d" ]; then

bteq .logon xxx/$USER,$PASSWD < $1.sql > $1_${dateforlog}.log

cp -f $1_${dateforlog}.log $1.log

ls -ltr $1_${dateforlog}.log

elif [ $2 == "/n" ]; then

bteq .logon xxx/$USER,$PASSWD < $1.sql

else null

fi

3 REPLIES

Re: BTEQ login help-LDAP and ksh

assuming your Teradata system has been configured to use LDAP -  then using your network userid and password try:

bteq

.logmech LDAP

.logon xxx/$USER,$PASSWD

and any gateway errors will be on :-

  DBc.Software_Event_LogV

to check if your teradata database is configured, sign onto a node and run this, key your password when prompted:-

/opt/teradata/tdat/tdgss/xxxx/bin/tdsbind -u userid

Re: BTEQ login help-LDAP and ksh

assuming your Teradata system has been configured to use LDAP -  

then using your network userid and password try: 

bteq 

.logmech LDAP 

.logon xxx/$USER,$PASSWD 

 and any gateway connection errors will be on :- 

  DBc.Software_Event_LogV 

 to check if your teradata database is configured, sign onto a node and run this, key your password when prompted: 

 /opt/teradata/tdat/tdgss/xxxx/bin/tdsbind -u userid 

Enthusiast

Re: BTEQ login help-LDAP and ksh