|
|
|
Junior Member
      
Group: Forum Members
Last Login: 11/17/2008 1:17:54 AM
Posts: 16,
Visits: 79
|
|
hello everyone
The application i am working on has a front-end developed on .net, and i connected that to Teradata using .NET provider.
Our organization have an ETL server between TERADATA warehouse and my application server. all the teradata utilities like bteq, fastexport etc are installed on that ETL server.
So, all my BTEQ scripts, fld etc are on that server..suggest me a way to execute these commands to run scripts... like bteq xyz.out with a button click on application in C# in visual studio 2005.
i worked with putty but how to automatically login via putty is not known to me and how to pass parameter to it???
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: Yesterday @ 7:30:07 AM
Posts: 197,
Visits: 611
|
|
Hello,
Is it a windows based Teradata machine?
Regards,
Adeel
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 11/17/2008 1:17:54 AM
Posts: 16,
Visits: 79
|
|
|
no the teradata machine is UNIX based.
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: Yesterday @ 7:30:07 AM
Posts: 197,
Visits: 611
|
|
Then you might be able to use "PLink.exe". I haven't tried it myself, but you can use it as:
plink.exe -ssh -pw pass -noagent -m commands.txt user@10.0.0.2
For reference:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
http://fixunix.com/ssh/253629-how-pass-command-script-remote-computer-over-putty-ssh-execute.html
HTH.
Regards,
Adeel
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 11/17/2008 1:17:54 AM
Posts: 16,
Visits: 79
|
|
thank you very much, it is working great.... but i have few problems regarding commands.txt file:
1.when i put bteq and then .logon tdedw1/ ; in file it shows that you are successfully logged on but when i write few more command below that i.e.
BTEQ
.logon tdedw1/ ;
show table orderdetails;
it shows nothing after saying successful login.
2. when i tried to run a script saying BTEQ result.log
it gives error
C:\Documents and Settings\agandhi1\Desktop>plink.exe -ssh -noagent -m commands.t
xt user@10.xx.xxx.xxxx -pw abc
00024: Could not start program (bteq result.log): The system cannot fin
d the file specified.
FATAL ERROR: Server refused to start a shell/command
whereas with putty same command is working.
the test.btq includes:
.LOGON tdedw1/user,abc;
show table orderdetails;
thank you for your responses :-)
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: Yesterday @ 7:30:07 AM
Posts: 197,
Visits: 611
|
|
Well...you need to save the script and pass it to BTEQ, for that you will have to use direction operator e.g. "BTEQ < Script1.btq". Following is the sample BTEQ script:
.LOGON system1/user1,password1;
DATABASE DB1;
SELECT * FROM TABLE1;
.LOGOFF;
HTH.
Regards,
Adeel
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 11/17/2008 1:17:54 AM
Posts: 16,
Visits: 79
|
|
1st of all i am sorry my second point was a typing mistake it was bteq< test.btq instead of BTEQ result.log.
As u said,i put bteq result in commands.txt and executed the command:
C:\Documents and Settings\agandhi1\Desktop>plink.exe -ssh -pw password1 -noagent user1@10.xx.xx.xxx -m commands.txt
it gives error:
00050: Could not start program (BTEQ< test.btq): The system cannot find the file specified.
FATAL ERROR: Server refused to start a shell/command
i then tried:
C:\Documents and Settings\agandhi1\Desktop>plink.exe -ssh -pw Training_04 -noagent appl_student_t_04@10.xx.xx.xxx "BTEQ<test.btq"
it gives error:
00049: Could not start program (BTEQ<test.btq): The system cannot find the file specified.
FATAL ERROR: Server refused to start a shell/command
then i tried giving the full path of test.btq but it again gave error:
00055: Could not start program (D:\EDWTraining\user\BTEQ<test.btq): The filename, directory name, or volume label syntax is incorrect.
My test.btq has:
.LOGON tdedw1/user1,password1;
DATABASE abc;
select * from orderdetails;
.LOGOFF;
My commands.txt contain:
"BTEQ<test.btq" tried with quotes and also without quotes.
1 thing why it says server refused to start a shell/command?
Regards
akhshay gandhi
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: Yesterday @ 7:30:07 AM
Posts: 197,
Visits: 611
|
|
Try creating a shell script and running that, also check for rights/permissions and the file paths.
Regards,
Adeel
|
|
|
| | |