Solved

Checking database connectivity from Linux server to an Oracle database

Posted on 2013-11-14
3
8,944 Views
Last Modified: 2013-11-14
I have an entry for  an Oracle database in my tnsnames.ora fiel on a Linux server. I need to check connectivity so I tried using tnsping:

>tnsping DBName


I get an error "-bash: tnsping: command not found"

Is ther something I am doing wrong? is there a better way to check database connectivity from Linux?
0
Comment
Question by:YZlat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 19

Expert Comment

by:xterm
ID: 39648291
You need to use the full path to the script - use the locate command to find it, see below.

[root@intx ~]# locate tnsping
/opt/oracle_8i/bin/tnspingO
/opt/oracle_8i/bin/tnsping

[root@intx ~]# /opt/oracle_8i/bin/tnsping

TNS Ping Utility for Linux: Version 8.1.7.0.0 - Production on 14-NOV-2013 10:23:03

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

TNS-03502: Message 3502 not found; No message file for product=network, facility=TNS
0
 
LVL 12

Accepted Solution

by:
Praveen Kumar Chandrashekatr earned 250 total points
ID: 39648416
The environment variable is not set in OS login. So first export the oracle home and SID then try tnsping.

for expample

#export ORACLE_HOME=/u01/oracle/product/11.2.0/db1
#export PATH=/bin:/usr/bin:/usr/local/bin:/usr/bin/X11:$ORACLE_HOME/bin: $HOME/bin:.
#export ORACLE_SID = ORCL

#tnsping DBname

you can also set it these environement varibales in .profile, .bash_profile file.

here is the doc which will talk about environment varibales.
http://docs.oracle.com/html/B10812_06/chapter1.htm
0
 
LVL 35

Author Comment

by:YZlat
ID: 39648833
Thanks Praveen!
0

Featured Post

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question