Connecting to Oracle through unix shell scripts


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Connecting to Oracle through unix shell scripts
# 1  
Old 07-04-2005
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
# 2  
Old 07-04-2005
Use a HERE document. Search the forum for Oracle or HERE document to find several other examples.

Code:
$ORACLE_HOME/bin/sqlplus -s <<SQLPLUS > oracle.log 
$DB_id/$DB_pswd@$DB_server 
select to_char(sysdate,'YYYYMMDDHHMMSS') FROM dual; 
spool off 
SQLPLUS

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help need Connecting to Oracle DB from Unix

I have a table called CLARIFICATION in one of my schema in Oracle Data Base. I have to connect to oracle Data Base from Unix and compare the one of the column(Exec_Date) in CLARIFICATION table with Sysdate.If Exec_Date = Sysdate go head and run rest of the script otherwise exit out with out... (2 Replies)
Discussion started by: veeru
2 Replies

2. 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

3. UNIX for Dummies Questions & Answers

Connecting to Unix server through Oracle

Hi, I need some help regarding oracle with unix script Actually i have a shell script and i want that it gets triggered through a oracle Db.I dont have any idea how is it done, even whether it is possible....pls help.....!!!! (3 Replies)
Discussion started by: fidelis
3 Replies

4. Shell Programming and Scripting

Connecting to ORACLE through SHELL

Hi, I am trying to connect to oracle database (9.2.0.7.0) through Sun solaris. But I am unable to do so. The content of my script is as follows: Shell Sript: RESULT=`$ORACLE_HOME/bin/sqlplus schema/'pwd'@db << EOF set echo on; set feedback on; @/home/count/qry.sql` echo... (10 Replies)
Discussion started by: fidelis
10 Replies

5. 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

6. Shell Programming and Scripting

Connecting to Oracle by using ODBC on UNIX

Hi All, I have a requirement where I need to connect to Oracle database which is installed on WINDOWS machine. I dont have Oracle client installed on my AIX so i can't use SQLPLUS command. But ODBC to connect to Oracle is configured on my UNIX server. Can any one help me with the steps of... (1 Reply)
Discussion started by: Raamc
1 Replies

7. Shell Programming and Scripting

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... (8 Replies)
Discussion started by: satyakiran
8 Replies

8. UNIX for Dummies Questions & Answers

Doubt in Oracle connecting unix - Very urgent

I am using a oracle query from unix.. flag=`sqlplus -s <<EOF SELECT 'Y' FROM table_name WHERE cond1 = '${table_name}' AND DECODE('${var_a}','''NA''',own,'${var_b0}')= own exception when no_data_found then dbms_output.put_line(NVL(l_owner_flag,'X')); end; EOF` Its not validating the... (7 Replies)
Discussion started by: sivakumar.rj
7 Replies

9. Shell Programming and Scripting

Connecting to Oracle from Shell..What Am I doing Wrong

I have the following code in my shell script. . /apps/oracli/xxxxx/xxxx/oraEnv.9.2.0 sqlplus -s $DB_USER/$DB_PWD@$DB_NAME > xx.html <<EOF I am passing DBuser and DBname from a config file and the password from user. Config File : export DB_USER=xxx; export DB_NAME=xxx; I am getting... (1 Reply)
Discussion started by: dzyr4tt
1 Replies

10. Shell Programming and Scripting

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 Replies)
Discussion started by: mohanprabu
2 Replies
Login or Register to Ask a Question