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
Solved

Checking database connectivity from Linux server to an Oracle database

Posted on 2013-11-14
3
7,952 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
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:
praveencpk 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

839 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