Solved

Checking database connectivity from Linux server to an Oracle database

Posted on 2013-11-14
3
6,089 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
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.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now