I created a .bteq script that looks like below:
.logmech LDAP;
.logon WM1/u0s000y,pwd;
SQL script here
.logoff;
And the above script is called in .bat file using below command:
BTEQ < Trial.bteq
But when i run this using windows task scheduler, it is throwing me a prompt asking me to select a program to run the BTEQ script. Looks like the scheduler does not know what program to use to run the BTEQ script.
What should I do to make the scheduler use teradata client for executing BTEQ script?
Thanks,
Batch call should probably be:
type Trial.bteq | bteq
Related
I have a shell script at Unix Server which contain sqlplus commands to do some validation.and I can run script using putty and see required result.In Unix server I have set up Oracle path and Library path in .bash_profile file. So when I start putty , it get loaded and can understand sqlplus command.
Now Challenge is
when I call that shell script from Jenkins(Windows node) then I get error "sqlplus command not found". Here I call .bash_profile file first then my shell script which have sqlplus commands.
Please help.
Set up the PATH as an environment variable in your Jenkins job definition. More details here:
How to set up environment variables in Jenkins
I have one shell script test.sh that displays 'WELCOME' and kept in unix server /home/xxx/
Now, I want to execute this from Sql prompt.
I tried with some code with sys priviledge.but could work and getting error like ORA-29540: class does not exist
and I think there is error while executing shell command.
Here, I have created all objects in the database.
can any one help me on this please ?.
So, what I understand is you need to execute a shell script from sql prompt.
From the SQL*Plus prompt, do !sh script_name. (! is used to temporarily exit out of SQL*Plus and execute a shell command)
I created a sample.sh file on the home directory and it contains echo "welcome";
I started SQL*Plus and did
SQL> !sh sample.sh
The output is welcome
Also, when you get an ORA error, it is generally an Oracle error.
I had builded .amj script from Teradata OLELoad GUI which connects to access and load data
to Teradata ?
I was able to successfully run the script using OLELoad GUI Utility.
Is there a way to run .amj file from command prompt ?
Thanks.
When you launch the script with OLELoad you have to use a TTU as Fastload, Bteq or whatever. You can do the same from the command line. You just have to call the TTU you choose (for example Fastload) with your script in the parameter section.
Example:
Bteq.exe < Your_script.txt
You mention that you are using an amj file. That file must be referred into your script.
You should be able to reference the .AMJ file as part of an INMOD on some of the Teradata Utilities. Refer to the Teradata Tools and Utilities Manual for the Teradata OLE DB Access Module here for examples.
I am using ssh exec ant task in my script for executing some commands in unix system(change permission,etc)
i am executing these scripts from a distributed system. After the execution of the script,
In case of changing file permissions, the permissions are not changed as in the script.
How can i capture the error message that has been thrown by the unix system in the system we have executed the script?
You can use the output or outputProperty attributes of the sshexec task.
I am executing a script manually on my UNIX system manually, it runs successfully and updated required records in ORACLE database. How ever when I exwcute the same script with crontab my process exits with the error code 127.
On analysing further, I got there is some problem in these statements.
LOGFILE=sachin
ORALOGIN=abc/abc#abcd
cmd='sqlplus ${ORALOGIN} < SQLS >> ${SVC_HOME}/LOGFILES/${LOGFILE}.date +%Y-%m-%d';
eval $cmd
Please suggest a solution
Are you sure that ${ORALOGIN} and ${LOGFILE} are valid ENV variables when cron executes the script?
Sometimes scripts that work for users don't work for cron because cron executions don't have all the ENV variables that users have.
In the interactive enviroment do
env | grep ORACLE
Long time since I've used sqlplus, but I recall it required some environment variables to function (ORACLE_HOME?) and I'm suspecting your cron job environment does not have these set.