Connect to remote database from solaris system


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Connect to remote database from solaris system
# 1  
Old 01-21-2010
Connect to remote database from solaris system

Hi,

i need to connect to a oracle database available in a remote PC (reachable from the host solaris server). I have added the tnsnames of that remote DB in to the tnsnames.ora file of the host solaris server.

Am able to ping that IP. How do i connect to that DB for running sql queries....That remote PC does not have telnet or ssh options.....
# 2  
Old 01-21-2010
Command-line connects to an Oracle DB are usually done with sqlplus, eg
Code:
sqlplus scott/tiger@ORACLE

Syntax is
Code:
sqlplus user/password@SID

# 3  
Old 01-21-2010
HI

This i tried, but unfotunately the remote system tnsnames.ora file does not have the SID....only SERVICE_NAME available

(SERVICE_NAME = IMS)
# 4  
Old 01-21-2010
As far as I remember, the service name and the SID should work the same (eg. you can usually substitute one for the other)
# 5  
Old 01-21-2010
HI

AM GETTING THE FOLLOWING ERROR

Quote:
#sqlplus scott/tiger@IMS

SQL*Plus: Release 9.2.0.6.0 - Production on Thu Jan 21 16:06:01 2010

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

ERROR:
ORA-12154: TNS:could not resolve service name


Enter user-name: scott
Enter password:
ERROR:
ORA-07217: sltln: environment variable cannot be evaluated.
# 6  
Old 01-21-2010
Actually u need to add the remote DB service name in your local tnsnames.ora file.

Say IMS is the service name on Solaris server. And you are connecting from a windows pc. then the tnsnames.ors file should have the entry of IMS.

After adding this you can connect
sqlplus system/manager@IMS
# 7  
Old 01-21-2010
I have added all those stuff.....

---------- Post updated at 06:00 PM ---------- Previous update was at 05:02 PM ----------

am able to CONNECT through windows pc by the following method....but not succeeded in Solaris server.

Code:
C:\Documents and Settings\Administrator>sqlplus scott/tiger@"(DESCRIPTION=(
ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=x.x.x.x)(PORT = 1521)))(CONNECT_D
ATA=(SERVICE_NAME=IMS)))"

SQL*Plus: Release 9.0.1.0.1 - Production on Thu Jan 21 17:28:27 2010

(c) Copyright 2001 Oracle Corporation.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies

2. Shell Programming and Scripting

Connect to Oracle database

could someone please help me in shell scripting. i want to connect to oracle database which is on remote sever. requirement: 1 want to check files in source directory if file exist then a execute a corresponding batch jobs on unix sever and fetch data from oracle database which is on remote... (2 Replies)
Discussion started by: refi123
2 Replies

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

4. AIX

AIX Remote Connect Fail With “No more multiple IP addresses to connect” Error

We have a production server at a client site running AIX. And recently when users are trying to connect to it via telnet, it prompts "No more multiple IP addresses to connect". Can I know what does this error mean? and how to rectify this? Thanks. (2 Replies)
Discussion started by: a_sim
2 Replies

5. Solaris

Solaris system and database migration help

HI, let me explain you the current situation. We have three server with OS Solaris and oracle products. Following is the somewhat detail, 1st Server= oracle DB 2nd Server= Oracle Warehouse builder 3rd Server= Oracle Business Intelligence Enterprise Manager Question: these three... (0 Replies)
Discussion started by: malikshahid85
0 Replies

6. Windows & DOS: Issues & Discussions

how to connect to sybase database?

hi, I'd like to connect to a Sybase ASE 12 through a a graphic user interface (GUI) that run on windows and solaris10, because i need to do some querys. The database is running on solaris 10. I'm not an expert using databases, but i know how to use some SQL commands through command line... (3 Replies)
Discussion started by: danin
3 Replies

7. IP Networking

how you connect to a database

i am working on informix database can any body helps me with coding how to connect to it on solaris (3 Replies)
Discussion started by: ramneek
3 Replies

8. Programming

How to connect database in TC

Anybody please help me how connect a database file in TC for windows. regards Senthil. K (5 Replies)
Discussion started by: Senthil
5 Replies

9. Shell Programming and Scripting

Can i connect from a .sh or .sc to a database?

please, help me-.... i need connect to a database Sybase IQ 12 and I don't know if i can do it using a shell program. if it's posibble, please tell me how... please, help me, because I don't know what to do.... thanks... jonathan (1 Reply)
Discussion started by: DebianJ
1 Replies

10. Programming

¿how can I connect C to a database?

hi, please, help me i need connect my program in C whit a SybaseIQ 12 database i´m programming in solaris 5 (unix) please, help me, because i don`t know what to do... thanks.. jonathan (0 Replies)
Discussion started by: DebianJ
0 Replies
Login or Register to Ask a Question