Help required for Running SQLPLUS command from Bat file

 
Thread Tools Search this Thread
Special Forums Windows & DOS: Issues & Discussions Help required for Running SQLPLUS command from Bat file
# 1  
Old 01-28-2014
Lightbulb Help required for Running SQLPLUS command from Bat file

Hello All,

Good Afternoon.

I am new to this platform and I need one small help regarding running a SQL file from Bat file. Below is what I am doing,

1. I placed the below command in one Bat file.
Code:
start putty.exe -ssh user@host -pw pwd -m C:\2.txt

2. In 2.txt, I have below command.

Code:
sqlplus u/u@host @/root/home/sql1.sql

3. Sql1.sql has simple sql commands.

When I am invoking the bat file, its logging into putty and logging off and not doing any thing. Smilie

If I run separately 2.txt by logging into putty then its running properly.

Please help me out. If I posted wrongly then, please guide me.

Last edited by radoulov; 01-28-2014 at 07:07 AM..
# 2  
Old 01-28-2014
Any log files?
# 3  
Old 01-28-2014
No Sir, I don't have log file.
# 4  
Old 01-28-2014
Have putty write one.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help required with xargs to use sqlplus

Hello All, I have a requirement in which i need to run few Oracle sql files in parallel. I want to use xargs command to achieve parallelism. I tried below command: cat x|xargs -n 1 -P 5 sqlplus -s $usr/$pwd@$Host @{} File x has the list of sql files to be executed. I am getting the... (3 Replies)
Discussion started by: vikas_trl
3 Replies

2. Shell Programming and Scripting

Sqlplus error - sqlplus -s <login/password@dbname> : No such file or directory

i am using bash shell Whenever i declare an array, and then using sqlplus, i am getting sqlplus error and return code 127. IFS="," declare -a Arr=($Variable1); SQLPLUS=sqlplus -s "${DBUSER}"/"${DBPASS}"@"${DBASE} echo "set head off ; " > ${SQLCMD} echo "set PAGESIZE 0 ;" >> ${SQLCMD}... (6 Replies)
Discussion started by: arghadeep adity
6 Replies

3. Solaris

Error during running sqlplus command from shell script in Solaris

I am using following code to connect to oracle database from solaris shell script. which will try thrice to connect the database ...at the 4rth atempt it will exir=t. count=0 while ; do sqlplus -s $usrname/$password@dbSID <<-EOF | tee $logfile WHENEVER OSERROR EXIT 9; WHENEVER SQLERROR... (4 Replies)
Discussion started by: millan
4 Replies

4. Shell Programming and Scripting

Running sqlplus for 5 DB in a shell

Hi all, on AIX 6.1 I want to run the following but for 5 DB. How should I do that ? Using FOR, WHILE ???? How ? export ORACLE_SID=DB1 sqlplus / as sysdba << EOF whenever sqlerror exit sql.sqlcode; whenever oserror exit FAILURE set define off set head off set feedback off set echo off... (1 Reply)
Discussion started by: big123456
1 Replies

5. Shell Programming and Scripting

URGENT: cron job not running the sqlplus command in shell script

cron job not running the sqlplus command in shell script but the shell script works fine from command line.. Cronjob: 5 * * * * /home/dreg/script.sh script.sh: #!/bin/ksh /oracle/u000/app/oracle/product/10204/GEN/bin/sqlplus -s <user>/<pass>@<sid/home/dreg/sqlscript.sh ... (18 Replies)
Discussion started by: Ikea
18 Replies

6. Windows & DOS: Issues & Discussions

Can rsh command be used to call a bat file

I have a .bat file on windows, which converts a .xls file into .csv file and using a ksh script i would usually FTP this .csv file... Now i want to trigger this .bat form my ksh script. can i use rsh command in my FTP to run .bat file on windows and then ftp the generated .csv file...is... (19 Replies)
Discussion started by: bhagya2340
19 Replies

7. Shell Programming and Scripting

error running sqlplus from shell file

I am running a shell file following script on bash shell in solaris 10 ( echo abc@orcl echo abc echo "set feedback off" echo "truncate table SIndexDataTypeHst1_changes;" ) | sqlplus -s but getting the following error ERROR: ORA-01005: null password given; logon denied ... (3 Replies)
Discussion started by: mmunir
3 Replies

8. Shell Programming and Scripting

Running SQLPLUS from Shellscripting ...

Hi guys, I am facing issues while triggering sqlplus with "/" option I can connect to database with USER ID and password. but, if i just specify "/" option since it is "externally identiifed user" it doesn't work Any suggestions? mail me @ Removed. Regards, Giri (2 Replies)
Discussion started by: chittari
2 Replies

9. Shell Programming and Scripting

executing *.bat file on windows from Unix box via ftp command

I have created get_list.bat file containing following line: dir /B /O-d >file_list.txt I am executing ftp command from Unix box and transferring get_list.bat file to windows server. In my next ftp command I am trying to execute this test.bat file by entering this line: get_list or by... (9 Replies)
Discussion started by: alx
9 Replies
Login or Register to Ask a Question