Connecting to oracle database from shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Connecting to oracle database from shell script
# 1  
Old 07-29-2005
Connecting to oracle database from shell script

Hi all,

I am satyakiran , i am new to the forum. i never done shell scripts for connecting to the data base (oracle) and fetching the data from the database( thru sql select statements ) i want to know
1. how to connect to the data base(oracle) using shell script
2. how to retrieve data from data base
3. how to process the data retrieved from database (i.e result set)
4. how to update the data base in turn.

Please help me out in solving this.

Thanks in advance

sincerely
satya
# 2  
Old 07-29-2005
1. how to connect to the data base(oracle) using shell script
Look at this post

2. how to retrieve data from data base
Post

3. how to process the data retrieved from database (i.e result set)
Post

4. how to update the data base in turn.
Post

Use the search to look through previous postings. They could help.

Vino
# 3  
Old 12-13-2007
Hi,

Like in windows we click the pl/sql icon and we write our code or any sql query to execute.Like wise how to write in unix environemnt and execute .

Hope someone will help me out.

Thanks ...
# 4  
Old 12-13-2007
Hi,

Suppose u hav written a script for scheduling job using "crontab",and u r doing ur job.
But according to requirement u need to change the execution of that job to some other time.What is the solution of that.

Actually in an interview someone asked me.I told ,i will change value for time in the crontab.

Waiting for ur reply...

Thanks ....
# 5  
Old 12-13-2007
Quote:
Originally Posted by sriku2005
Like in windows we click the pl/sql icon and we write our code or any sql query to execute.Like wise how to write in unix environemnt and execute .
First set up the oracle environment variables, normally by . oraenv or similar.

Code:
$ORACLE_HOME/bin/sqlplus

# 6  
Old 07-16-2008
connecting database from shell scripts

I want to know in details that what exactly we need to do to connect , retrieve and to work around the data.

I have seen several reply but no one makes me satisfied .
Please definitive.Smilie
# 7  
Old 03-16-2009
Bug

sqlplus -s Username/Password@schemaname
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to fix connection to Oracle database through shell script?

I have a question regarding how to connect to Oracle Database through shell script. 1. If I want call a stored procedure on Linux server as this, it works. $sqlplus /nolog SQL*Plus: Release 12.1.0.2.0 Production on Fri Jun 12 14:49:49 2015 Copyright (c) 1982, 2014, Oracle. All rights... (2 Replies)
Discussion started by: duke0001
2 Replies

2. Solaris

Connecting to Oracle database

Hi guys, long time no typing :D I have problems when I try to connect to Oracle database from SQL Developer which is located on my Windows box. Server is running Solaris 11/11 and Oracle 11 enterprise. I can log in locally with sys account to database, start it up and shut it down but when I... (2 Replies)
Discussion started by: solaris_user
2 Replies

3. Shell Programming and Scripting

How to connect to Oracle database using shell script?

Hi All, I am newbie to unix shell scripting. I want to connect to oracle database using shell script. I know how to connect DB using user name and password but my question is if my password is having '@' sign then how to connect. I have tried like below, cnt=`sqlplus -s /nolog << EOFSQL ... (3 Replies)
Discussion started by: pmotewar
3 Replies

4. Shell Programming and Scripting

Shell Script to connect to the oracle database

Hi Unix Gurus, I have a requirement to write a script, Oracle DB gets referesh every 6hrs, hence we need write a script to connect to the database , if it connects it should generate a file to proceed the next job application or when an error when connectiong to DB it should not generate any... (8 Replies)
Discussion started by: bshivali
8 Replies

5. UNIX and Linux Applications

Really simple shell script to create oracle database

Hello , I am new in this forum and need your help as I am totally confused :confused: I read a lot of threads and tried to search a lot but did not get the exact answer to my question. I just want a simple (content wise may be long) shell script to create oracle database. In detail:... (5 Replies)
Discussion started by: rahoolm
5 Replies

6. Shell Programming and Scripting

Connecting to oracle database

Hai i want to connect to oracle database from user input and create a view. ${ECHO} "Debut Creating View" ${ECHO} "Please Enter the User Name:" read user_name ${ECHO} "Please Enter the Connection String:" read con_string ${ECHO} "Please Enter the Password:" read pwd... (3 Replies)
Discussion started by: shenthil76
3 Replies

7. Shell Programming and Scripting

run shell script connecting to oracle from crontab

Hi, I have problems with running shell script connecting to Oracle from the crontab. Here is the script: #!/sbin/sh ORACLE_HOME=/opt/oracle/10g/ export ORACLE_HOME if then echo "Source path is not specified" exit fi /opt/oracle/10g/bin/sqlplus user/pass@testdb << EOF truncate table... (6 Replies)
Discussion started by: apenkov
6 Replies

8. Shell Programming and Scripting

Problem in Connecting to Oracle Database using KornShell

Hello, I am very new to Scripting. I am having a Kornshell Script below for connecting to Oracle database. But getting an error while executing it. #!/bin/ksh ssh -X root@192.168.2.127 <perimuka> sleep 5 su - oracle sqlplus <mraghunandanan>/<peri123> <<eof Can anyone tell what is wrong... (3 Replies)
Discussion started by: mraghunandanan
3 Replies

9. Shell Programming and Scripting

Need shell script to extract data from oracle database

shell script (4 Replies)
Discussion started by: frns5
4 Replies

10. Shell Programming and Scripting

Connecting to Oracle Database

if; sql="select username from dba_users where username = '$FromUser';" check_FromUser=`ExecSql "$sql"` I want to connect to Oracle database & check the users in the database, store the value in check_FromUser. First how to connect to Oracle database from the shell script ? Appreciate your... (4 Replies)
Discussion started by: dreams5617
4 Replies
Login or Register to Ask a Question