Sponsored Content
Top Forums Shell Programming and Scripting connect to sqlplus in a script Post 302089221 by big123456 on Monday 18th of September 2006 06:26:08 AM
Old 09-18-2006
connect to sqlplus in a script

Hi,
I want to write a script, in which I will connect to sqlplus and do a quary and then exit
sqlplus user/pwd@database
select count(*) from table
exit.
and write the result in a log file.

How to write it ?
Many thanks before.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SQLPLUS in script

I have a script that passes a parameter to the sqlplus command that looks like the following: #!/bin/sh TARGET_SID=$1 AUXILIARY_SID=$2 sqlplus 'sys@$AUXILIARY_SID as sysdba' @shutdown.sql I keep getting the following error: ERROR: ORA-12154: TNS:could not resolve service name... (4 Replies)
Discussion started by: renichols
4 Replies

2. Shell Programming and Scripting

connect to sqlplus from shell

I'm writting a shell script and at the begining I login to sqlplus by sqlplus -l user_name/password@instance what I would like is to check if the database is down or not , and if the database has started moved to the next step else sleep for a certain time and then check again . I know how to... (4 Replies)
Discussion started by: aya_r
4 Replies

3. UNIX for Dummies Questions & Answers

Shell Script And SQLPLUS

i'm having real problems retrieving the returncode of my sqlplus-call. I found a lot of informations on the net, but havn't been able to get it running so far, so now i ask for some help ;) I do start the sqlplus out of my shell script with the parameters stored in the proc_clips.sql, which is... (6 Replies)
Discussion started by: maco_home
6 Replies

4. Shell Programming and Scripting

help me in sending parameters from sqlplus script to unix shell script

Can anybody help me out in sending parameters from sql*plus script to unix shell script without using flat files.. Initially in a shell script i will call sql*plus and after getting some value from some tables, i want that variable value in unix shell script. How can i do this? Please tell me... (2 Replies)
Discussion started by: Hara
2 Replies

5. UNIX for Dummies Questions & Answers

connect sqlplus from unix

hi, I have this basic query. I have created a new user on unix. I have given home directory and permission through chmod to create directory stucture. Now need to connect sqlplus. What permissions should we give, so that this works? Any help is appreciated. Thanks, Neha (1 Reply)
Discussion started by: nehak
1 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

SQLPLUS within shell script

Hi I want to connect to the Oracle database using a username/password and get back the query result(a numeric value) in a variable, which I can then compare using a conditional. Can anybody help me with this. Thanks Gaurav (4 Replies)
Discussion started by: gaurav_1711
4 Replies

8. UNIX for Advanced & Expert Users

Unable to connect to sqlplus from unix

Hi, I have been trying to connect to sqlplus the same way I used to do in my earlier company but I get these error messages , please suggest way out - user name - xyzuser schema name - xyzschema $ sqlplus xyzuser@xyzschema ksh: sqlplus: not found. $ sqlplus -s xyzuser@xyzschema... (5 Replies)
Discussion started by: dhirajdsharma
5 Replies

9. Shell Programming and Scripting

Connect to Oracle using sqlplus

I have logged into oracle using SQLPLUS. When I type any kind of query, there is only 1 answer - '2'. What is wrong with it? (1 Reply)
Discussion started by: Subhasis
1 Replies

10. 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
BF_TAR(1)																 BF_TAR(1)

NAME
bf_tar - shell script to write a tar file of a bogofilter directory to stdout SYNOPSIS
bf_tar [-r] [-R] bogofilter_directory DESCRIPTION
bf_tar bundles a bogofilter working directory in tar format and copies it to standard output (your console, or where you redirect it, see EXAMPLES below). OPTIONS
The -r option causes bf_tar to remove inactive log files after the archive has been written successfully. The default is to leave log files. The -R option causes bf_tar to remove inactive log files before the archive is written. This may reduce chances that the resulting archive is recoverable should it become damaged. The archive may be smaller though. The default is to leave log files. EXIT STATUS
The script exits with status code 0 if everything went well, and nonzero if it encountered trouble. EXAMPLES
o bf_tar ~/.bogofilter > outfile.tar Writes a standard .tar file containing the essential files from ~/.bogofilter to outfile.tar. o bf_tar ~/.bogofilter | gzip -9 -c > outfile.tar.gz Writes a gzipped .tar.gz file containing the essential files from ~/.bogofilter to outfile.tar.gz. o bf_tar `pwd`/mydirectory > outfile.tar Prepend $(pwd)/ or `pwd`/ if you want to specify an absolute path instead of a relative path. NOTES
This script is meant for use with Berkeley DB based bogofilter versions. This script requires a SUSv2 compliant pax utility. This script expects a SUSv2 compliant shell. Solaris systems should have the SUNWxcu4 package installed (when bogofilter is configured) so that /usr/xpg4/bin/sh can be used. 07/23/2007 BF_TAR(1)
All times are GMT -4. The time now is 05:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy