- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- shell scripts for tnsping
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2005 06:03 PM
тАО09-26-2005 06:03 PM
I need to know a shell script which can perform tnsping on 5 oracle database every 30 minutes and record the output in a file.
Thanks,
Shiv
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2005 06:06 PM
тАО09-26-2005 06:06 PM
Re: shell scripts for tnsping
You can use "ping" script to perform tnsping. Just replace ping with tnsping.. and change sleep to 1800.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=960333
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2005 06:09 PM
тАО09-26-2005 06:09 PM
Solution# tnsping.ksh
db1=
db2=
db3=
db4=
db5=
stime=1800
while [ 1 ]
do
tnsping $db1 >> /tmp/tnsping_$db1.log 2>&1
tnsping $db2 >> /tmp/tnsping_$db2.log 2>&1
tnsping $db3 >> /tmp/tnsping_$db3.log 2>&1
tnsping $db4 >> /tmp/tnsping_$db4.log 2>&1
tnsping $db5 >> /tmp/tnsping_$db5.log 2>&1
sleep $stime
done
# END
exit 0
Again you can use the script without sleep + while [ 1 ] with cron as,
0,30 * * * * /tmp/tnsping.ksh 1>/dev/null 2>&1
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2005 06:12 PM
тАО09-26-2005 06:12 PM
Re: shell scripts for tnsping
We can not use the same script as your link. It is needed some modification to check the DB not hostname ;). tnsping will not use option of -c count also ;) :)
Shiv,
Running command line using sleep will not be a effecient way. Use cron schedular with the scripts.
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2005 06:16 PM
тАО09-26-2005 06:16 PM
Re: shell scripts for tnsping
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2005 06:28 PM
тАО09-26-2005 06:28 PM
Re: shell scripts for tnsping
allow me also to add that tnsping only shows that "there be a listener on that port". It does not show that "the database you want that listener to hook you up with exists and is up"
in short, the listener can be up without the database being up!
I would suggest that you also include something like:
sqlplus /nolog <
connect scott/tiger@mydb
select to_char(sysdate,'dd/mm/yyyy hh24:mi') from dual;
exit;
EOF
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2005 05:59 PM
тАО09-27-2005 05:59 PM
Re: shell scripts for tnsping
to do a dummy login like
create a list of remote connect descriptors for each db's to check.
Then for each db connect descriptor in the list do
sqlplus t/t@yourdb.world
and check for the return message which
exclusively should be only:
Enter user-name:
ERROR: ORA-01017: invalid username/password; logon denied
and do this 3 times with sleep pauses of 10 seconds intervals, thus where any success is success, to account for temporary time-outs
or other glitches.
If you would like the complete script let me
know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2005 12:06 AM
тАО09-28-2005 12:06 AM
Re: shell scripts for tnsping
the tnsping really is used to check the /etc/tnsnames.ora syntax and if the listener of a remote server is up.
To be sure that teh databse be up you have to connect to it by listener using a sample script xx:
cat xx
remote_database=xx
sqlplus -s <