Problem in Connecting to Oracle Database using KornShell


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem in Connecting to Oracle Database using KornShell
# 1  
Old 12-10-2008
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 in this script?
# 2  
Old 12-10-2008
Quote:
Originally Posted by mraghunandanan
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 in this script?
what error are you getting??
try putting eof
#!/bin/ksh
ssh -X root@192.168.2.127 <perimuka>
sleep 5
su - oracle
sqlplus <mraghunandanan>/<peri123> <<eof
eof
# 3  
Old 12-10-2008
Error message

Hi vidyadhar... Actually when i am trying to execute the script I am getting the error as mentioned below:

syntax error at line 3: `newline' unexpected
# 4  
Old 12-10-2008
There appears to be a few fundamental understanding problems here.
I deduce (or guess) the following:

1) Need to remove all the less-than and greater-than signs around your text strings.

2) The script containing the Oracle "sqlplus" commands needs to be on server 192.168.2.127 .

3) The oracle "sqlplus" needs to be preceded by commands to set the Oracle environment.

4) The Oracle "sqlplus" commands go between the sqlplus line and a line containing only "eof".
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Identify a specific environment Oracle variable to connect a remote Oracle database ?

Good evening I nned your help pls, In an unix server i want to connect to a remote oracle databse server by sqlplus. I tried to find out the user/passwd and service name by env variable and all Ive got is this: ORACLE_SID_REPCOL=SCL_REPCOL ORACLE_SID=xmeta ORACLE_SID_TOL=SCL_PROTOLCOL... (2 Replies)
Discussion started by: alexcol
2 Replies

2. Linux

Problem in accessing Oracle Database Server from Linux Machine

I am facing a strange issue in connecting to Oracle database from Linux Machine - The connectivity is not failing all the time , the failure to success ratio is 1:70. - Error "ORA-12545: Connect failed because target host or object does not exist" - Majority of the time the connection... (6 Replies)
Discussion started by: balaji kumar
6 Replies

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

4. Shell Programming and Scripting

Execution problem on kornshell

HI, Requirement: I need to pass space between argument value for the paramter "GPG_PUBLIC_UID" but whenever i use single quotes or double quotes while supplying value for the arguments to the script, i see the value of the field "GPG_PUBLIC_UID" is getting splitted and my script fails to... (6 Replies)
Discussion started by: reachaysh
6 Replies

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

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

7. UNIX for Advanced & Expert Users

problem connecting to oracle 10g after NCR node reboot

Hi All, I am facing a connection problem with Oracle 10g on Solaris 10 when my application (started by /etc/rc3.d at node reboot) tries to establish a session after reboot of the node where my application is running (NCR UNIX (MP RAS)). I find that my application (run as a deamon process)... (1 Reply)
Discussion started by: sowjanya
1 Replies

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

9. UNIX for Dummies Questions & Answers

Having A Problem Connecting to Oracle Using Cron

Can someone tell me how to prevent this? stty: standard input: Invalid argument ERROR: ORA-12154: TNS:could not resolve the connect identifier specified SP2-0306: Invalid option. Usage: CONN where <logon> ::= <username> | / ERROR: ORA-12162: TNS:net service name is incorrectly... (1 Reply)
Discussion started by: goodmis
1 Replies
Login or Register to Ask a Question