Sqlplus inside shell script writing to tmp file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sqlplus inside shell script writing to tmp file
# 1  
Old 10-26-2013
Hammer & Screwdriver Sqlplus inside shell script writing to tmp file

Hi,
facing an issue while calling sqlplus inside shell script. It for some reason goes to tmp file to write something and i get error as permission denied as i dont have access there.
ANy idea why sqlplus writes in /tmp and how to change or stop this ?
# 2  
Old 10-26-2013
The 1st thing to ask yourself is why doesn't every user on your system have permission to create files in /tmp?

Then you can look at your documentation for sqlplus. Is there an option to specify a different location for temp files?

Many UNIX and UNIX-like utilities that use non-trivial amounts of temporary file space will look for a TMPDIR environment variable. If $TMPDIR expands to the name of a directory and sqlplus uses the conventional meaning of TMPDIR, it will put temporary files in the directory named by $TMPDIR instead of in /tmp. So, you could try something like:
Code:
TMPDIR=/path/to/tmp_directory sqlplus args...

# 3  
Old 10-26-2013
Thanks Don

Thanks Don. Its on production so we dont have access on tmp. can we set diffrent location for specific shell ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem with writing into a file through shell script

Hi all, I have a shell script which I use to login to the server from the client and then from the server I run a bunch of other scripts to complete my task. I am having problems with the script below- #!/bin/bash while read line do connections=`echo $line | cut -d " " -f 1` period=`echo... (3 Replies)
Discussion started by: joydeep4u
3 Replies

2. Shell Programming and Scripting

Format the output from sqlplus while writing to log file.

Hi I have developed bash script to connect to database and execute .sql files. I am logging some statements in to log file using echo. While logging I am adding the date in front of the log statements which makes sense. I am unable to add date in front of output from the sqlplus and sqlldr,... (8 Replies)
Discussion started by: murtymvvs
8 Replies

3. Shell Programming and Scripting

Error while using sqlplus command inside 'if' condition in an unix shell script

Hi all, I am using the below given sqlplus command in my unix script to invoke a stored procedure which returns a value .It works fine. RET_CODE=$(/opt/oracle/product/10.2.0.4.CL/bin/sqlplus -S $USER/$PASSWD@$DB_NAME <<EOF EXEC MY_PKG.MY_SP (:COUNT); PRINT COUNT; commit; ... (6 Replies)
Discussion started by: Shri123
6 Replies

4. Shell Programming and Scripting

Help with writing shell script file

I am trying to prompt the user using tput command to read the information ( 5 last names, first names and grades) from the keyboard. Save the data in a file called student.txt. Sort the file by last name and display it on the screen My pseudocode is as follow: Pseudocode: Initialize... (1 Reply)
Discussion started by: jestaton
1 Replies

5. Shell Programming and Scripting

Shell Script to remove spaces while writing to the file

Hello Folks, I want to get the results from a SQL query which needs to be exported to a .txt file. My Script is something like #!/bin/ksh db2 connect to DATABASE user user_name using pwd; touch test.txt isResult=0; isResult= `db2 -x select 'ABC',COL_B from TABLE_A WHERE COL_B=CONDITION`... (6 Replies)
Discussion started by: dinesh1985
6 Replies

6. Shell Programming and Scripting

(Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script

Hi, I need help urgently for following issue. Pls help me to resolve this issue. I am calling sql script file(file1.sql) from UNIX Shell Script(script1.ksh) using sql plus and trying to create flat file that contains all records returned from SQL query in SQL script(file1.sql) I given... (6 Replies)
Discussion started by: praka
6 Replies

7. Shell Programming and Scripting

Shell script for a writing the directory structure to a file

Hi All, I am new user of shell scripting has come up with a problem. that I have a directory structure like : Home | |--------A | |----trunk | |-------A_0_1/ | | | |-------A_0_2/ | |--------B | ... (6 Replies)
Discussion started by: bhaskar_m
6 Replies

8. UNIX for Dummies Questions & Answers

HELP! writing shell script with c++ file

how would i write a shell script to count number of one-line comments in a c++ file. please help with coding thank you. (1 Reply)
Discussion started by: deadleg
1 Replies

9. Shell Programming and Scripting

writing Enter key inside in shell script

for automating telnet using shell script..... as we enter alphabetic characters inside shell script...how can we do the same for the enter key......Is there any character for the enter key so the enter key need not be pressed manually...... (3 Replies)
Discussion started by: bishweshwar
3 Replies

10. UNIX for Advanced & Expert Users

writing to /tmp

Hi all, I need your help. I am using Linux - Mandrake 8.x version. Somehow, the system /tmp directory became unwritable. What can be the problem is this case I am trying to write to /tmp and the permission right for this dir are: drwxrwxrwt 20 root root 1024 Mar 16 17:26... (3 Replies)
Discussion started by: vtran4270
3 Replies
Login or Register to Ask a Question