All Forums Tools
vikaschopra 5 posts Joined 02/13
02 Feb 2013
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

garyadmin2 2 posts Joined 07/10
14 Mar 2013

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
 

garyadmin3 3 posts Joined 11/11
14 Mar 2013

 

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 

 

 

M.Saeed Khurram 544 posts Joined 09/12
You must sign in to leave a comment.