Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Checking database connectivity from Linux server to an Oracle database

Posted on 2013-11-14
3
Medium Priority
?
10,894 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 1000 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

Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

Question has a verified solution.

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

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
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.
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

730 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