473,395 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Connecting To Oracle Database From Unix(script)

Hi all , i need the shell script which would connect to the oracle database xyz...
May 16 '07 #1
6 31445
-
Hi all , i need the shell script which would connect to the -oracle database xyz...
Pleas ellaborate on your question? Why would you need a script to connect to a database? Which Oracle database version are you using? Why can't you run sqlplus from the command line?

Please be clear on what you need, it helps us to be able to answer your question quicker if we do have answers.

Regards,
smashzone
May 16 '07 #2
with sqlplus we can connect , but i need the total syntax from shell prompt and after connecting to sql what steps to be followed to connect to oracle 9i database

-

Pleas ellaborate on your question? Why would you need a script to connect to a database? Which Oracle database version are you using? Why can't you run sqlplus from the command line?

Please be clear on what you need, it helps us to be able to answer your question quicker if we do have answers.

Regards,
smashzone
May 16 '07 #3
Definition of a script: a script is an automated sequence of related commands
Therefore, you dont need a script to connect to a database

Step 1
Login to your server (ssh <ip adress>) using program called putty as the oracle user and provide the relevant password

example:
login as: oracle
Sent username "oracle"
oracle@192.168.103.60's password:
Last login: Wed May 16 09:10:16 2007 from 192.168.103.184
[oracle@slayer ~]$


Step 2
Run the following command:
sqlplus system/password

Step 3
Use sqlplus as you would use it when your connecting using a windows machine.

HINT: Make sure that your logged on as an oracle user, otherwise you'll get an error like this:

[root@slayer ~]# sqlplus
-bash: sqlplus: command not found


Hope this helps, post again if u encounter any problems

Regards,
smashzone
May 16 '07 #4
Hi

I would like to create a unix script to connect to an ORACLE database using a oracle package. Also this script should provide functionality to call an oracle procedure that contains a parameter value that is passed to it. The parameter value passed to the procedure should be "editable" i.e user should be able to change it.

Please could you assist, shout if anything is unclear and i will try and re-phase
Aug 6 '07 #5
aeiou8
1
Hi,

I am also in need of some help pertaining to connecting to Oracle from a script. The logic I am trying to accomplish is:

1. log into Oracle.
2. execute a simple select query from the V$SESSION table.
3. have the output piped into a file.

I was planning to have this script set up in crontab to run every 30 mins. Any help will be appreciated. Thanks.
Oct 3 '07 #6
Hi,

I am also in need of some help pertaining to connecting to Oracle from a script. The logic I am trying to accomplish is:

1. log into Oracle.
2. execute a simple select query from the V$SESSION table.
3. have the output piped into a file.

I was planning to have this script set up in crontab to run every 30 mins. Any help will be appreciated. Thanks.

use "spool" in your sql file and call it to your script.
Dec 24 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: vishal | last post by:
Hi, I am writing my first script to execute a Oracle procedure through a unix script. Could you tell me how do I do error handling here? How do I know in my script if the procedure executed...
1
by: Yanick Quirion | last post by:
Hi all, I'm trying to find a simple code to connect to an Oracle Database (9i) with C under linux. I have a script that read a form from the web and I want to access my Oracle database with...
3
by: Tor Erik Soenvisen | last post by:
Hi, I need to export an Oracle database to a DDL-formated file. On the Web, I found a Python script that did exactly this for a MS Access database, but not one for Oracle databases. Does...
4
by: istruttorenuoto | last post by:
hi to everbody i need to write a unix script to do a sqlplus connection (using user id and password) to an oracle database and call a stored procedure. how could i do it? thanks to all
6
by: Sanket80 | last post by:
Hi, I have one shell script which runs a report and sends the output to user. The shell script has some queries written in it in SQL and hence when I execute a shell script via a concurrent...
0
by: paitosh | last post by:
Hi, Any body could suggest me what kind of unix script should i write to do a complete DB export using compress methods.
1
by: dr3586 | last post by:
Hi, I am new at this so I apologize if all is not correct. In ksh unix script I am trying to read values from text delimited file into oracle db table. I know that the read from the text file is...
1
by: ora2000 | last post by:
Hi I would like to create a unix script to connect to an ORACLE database using a oracle package. Also this script should provide functionality to call an oracle procedure that contains a parameter...
26
by: seemagoyal | last post by:
Hi, I don't have any experiance of UNIX and oracle. but i have got a short assignment for writing a unix script that will call a stored procedure. this script has to run this procedure after...
3
by: techquest | last post by:
Hi, I want to connect into oracle database and export the table data into a flat file using UNIX shell scripts. I cant use other GUI tools to do this, as the dataload will be in millions. hence if...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.