Solved

tnsping

Posted on 2002-03-28
10
1,154 Views
Last Modified: 2012-08-13
Want to do a tnsping from ASP. Any suggestions?
0
Comment
Question by:JOK
[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
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 11

Expert Comment

by:thunderchicken
ID: 6903078
Are you trying to connect to an oracle database through ASP?  I guess I've never heard that term before, but I've been able to connect to oracle through ASP...
0
 
LVL 20

Expert Comment

by:jitganguly
ID: 6903103
2 ways to do it.

1. Use Run method of WSH
Dim oShell
Set oShell = WScript.CreateObject ("WSCript.shell")
oShell.run "cmd /K CD C:\ & Dir"
Set oShell = Nothing

2. Go to www.serverobjects.com and download ASPExec and you can run command line programs with that.

2nd method is advisable

TC,
tnsping is pinging to Oracle db, works the same way as ping
0
 
LVL 11

Expert Comment

by:thunderchicken
ID: 6903137
So you can ping the Oracle server to see if it's up?  That's a good idea to do...  :-)

Thanks
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 1

Expert Comment

by:ParthaChoudhury
ID: 6903228
Even you can ping the server through a shell command in your program, how are you going to check what the result is?

- Partha
0
 
LVL 3

Author Comment

by:JOK
ID: 6903420
Don't really care about connecting to the db this way, I know I can do it (since I've done it ;)

Today was the first time I've heard about tnsping. I guess its like ping, but it sees if the oracle service is up and running (like jitganguly said).

Don't know how to check the result 'cuz I don't know much about it yet.
0
 
LVL 3

Author Comment

by:JOK
ID: 6903426
Wonder why I don't just try a simple connection, then look at any error code. Hmmmm
0
 
LVL 20

Accepted Solution

by:
jitganguly earned 100 total points
ID: 6903437
You should use some simple connection with error checking

on error resume next
conn.Open "Driver={Microsoft ODBC for Oracle};" & _
     "Server=" & Application("dbserver") & ";" & _
     "Database=" & Application("dbdatabase") & ";" & _
     "Uid=" & Application("dbuser") & ";" & _
     "Pwd=" & E2P(Application("dbpass")) & ";"

if err.number <> 0 then
     Response.Write "<br><br><br><br><br><br><br><br><br><br><br><font size=3 face=arial>"
     Response.Write " <p align=center style=color:red><b>Error !!! Unable to connect to Database ! Please contact Help Desk</b></p></font>"
     set conn = nothing
     response.end
end if
0
 
LVL 3

Author Comment

by:JOK
ID: 6913541
did moreorless what jitganguly suggested. Simple query to a small table that I can run on command. Err tells me if db is ok.
0
 
LVL 20

Expert Comment

by:jitganguly
ID: 6913728
if everythings ok then why 'B' ? Remember this is a free service and I spent some time to solver your problem, don't you think you appreciate my help with some good grading
0
 
LVL 3

Author Comment

by:JOK
ID: 6913933
1) I had the idea already about connecting to the db. I didn't need help with that part of it, but I appreciated the code.
2) coulda actually printed the error message.
3) I am the Help Desk. Why would I contact myself? -granted u didn't know that.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

690 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