ORACLE from Shell scripts


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ORACLE from Shell scripts
# 1  
Old 11-22-2004
Error ORACLE from Shell scripts

Hi,

I have Oracle, and I want to execute simple queries in it. Is it possible to do this using a UNIX shell scripts. Are there any commands in Shell scripting where in I can communicate to ORACLE!?

Thanks,
# 2  
Old 11-22-2004
For other answers search for the username google and oracle on this forum.

I like to control the session automatically so I use:
Code:
UID=$1
PSWD=$2
exsql ()  {
     awk '{ if(NR == 1) {
        STR=sprintf("%s/%s",UI,PW)
        print STR
        print "set pagesize 80;"
        print "set linesize 240;"
        }
        print $0}' UI=$UID PW=$PSWD | sqlplus -s 
    }
    
echo " select * from mytable;" >exsql

This also prevents the username password from showing up in the ps -ef display.
# 3  
Old 11-24-2004
Hi, thanx 4 ur valualble suggessions. Iam in the right path now... Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Identify tables from Oracle sql scripts

Hi, Please let me know if you have any thoughts on how to read a table that has all the oracle sql files or shell scripts at the job and step level to identify all the tables that does merge, update, delete, insert, create, truncate, alter table (ALTER TABLE XYZ RENAME TO ABC) and call them out... (1 Reply)
Discussion started by: techmoris
1 Replies

2. Shell Programming and Scripting

Loading data in oracle using shell scripts

Hi , I have a scenario, i have a directory where i receive around 14-15 files at a interval of 20-40 min not fixed, i want to write a unix scripts which invoke sqlldr command to load files into oracle automatically as soon as the file hit the directory. Any help will be appreciated. ... (4 Replies)
Discussion started by: guddu_12
4 Replies

3. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

4. Shell Programming and Scripting

oracle scripts

Env: AIX 5.3 I was doing shell scripting and for my Oracle DB. Now there is a requirement to use Perl instead of Shell Can anyone give the equivalent of this command in Perl `Sqlplus -S /nolog <<EOF conn / as sysdba $sql1 $sql2 ... ... ... EOF` I heard DBI should... (3 Replies)
Discussion started by: ilugopal
3 Replies

5. Shell Programming and Scripting

Oracle DB Start shutdown scripts

Hi, We have a requirement wherein we do not want to share the Oracle DB sys and system passwords to be shared with the support desk. But they will be responsible for starting/shuting down the Database. Is it possible to write a shell script which will read the sys and system passwords from a... (0 Replies)
Discussion started by: narayanv
0 Replies

6. Shell Programming and Scripting

Interactive scripts for Oracle

Hello friends, I am a ORACLE user, we have some internal database file, lets say "demo.config" and an internal tool to patch this file....lets call that tool as "dbfixer". We have 100's-1000's of such files "demo.config" which need to get patched by the tool. So we need to write a script ...... (1 Reply)
Discussion started by: Newbie456267uni
1 Replies

7. Shell Programming and Scripting

run oracle procedure in unix scripts

for j in $(du -h $1| awk '{printf("%100-s \n",$2)}') do for a in $(ls -time $(find $j -name '*.txt') | awk '{printf("\n%s %s %s %s %s",$4,$7,$8,$10,$11)}') do echo "$a">output.txt done done exit 0 echo "Password : xxxxxx " > LOG/BGH_$3.out (0 Replies)
Discussion started by: utoptas
0 Replies

8. Shell Programming and Scripting

Calling oracle package Unix from shell scripts.

Hi, Can anyone tell me how to call a oracle package from a Unix shell script? I want to pass some input parameters to package and it will return me the output which I want to use further in my shell script. I want to know the way to capture the output values in my shell script. Please send some... (1 Reply)
Discussion started by: anil029
1 Replies

9. Shell Programming and Scripting

Oracle Passwords in Unix scripts

Hi Most of the shell scripts I am dealing with have to connect to oracle database . The username password is stored in a environment file which sets the variables for username and password . Set user id do not work on AIX so users who will execute these scripts need to have read or execute... (5 Replies)
Discussion started by: clifford
5 Replies

10. UNIX for Advanced & Expert Users

Connecting to Oracle through unix shell scripts

Hi, Can some one help me in connecting to oracle through unix shell scripts with examples. Regards Narayana Gupta (1 Reply)
Discussion started by: guptan
1 Replies
Login or Register to Ask a Question