Solved

Checking database connectivity from Linux server to an Oracle database

Posted on 2013-11-14
3
10,002 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

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

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

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…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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.:
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Suggested Courses

626 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