- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Need A Script
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
Forums
Discussions
Discussions
Discussions
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
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
03-19-2004 10:10 PM
03-19-2004 10:10 PM
Need A Script
I have a script in the cron that shutsdown my Database. I have now found that the database does not go down and needs manual intervention to kill some of the hanging processess.
The ps -ef give the following output
orasag 7454 1 2 05:51:57 ? 0:04 oracleSAG (LOCAL=NO)
orasag 6515 1 0 05:45:50 ? 0:03 oracleSAG (LOCAL=NO)
orasag 6700 1 0 05:45:54 ? 0:59 oracleSAG (LOCAL=NO)
orasag 7262 1 0 05:49:57 ? 0:04 oracleSAG (LOCAL=NO)
orasag 7274 1 2 05:49:58 ? 0:13 oracleSAG (LOCAL=NO)
orasag 6648 1 2 05:45:53 ? 0:03 oracleSAG (LOCAL=NO)
orasag 6818 1 0 05:46:01 ? 0:00 oracleSAG (LOCAL=NO)
orasag 6824 1 0 05:46:01 ? 0:11 oracleSAG (LOCAL=NO)
orasag 7096 1 0 05:47:56 ? 0:04 oracleSAG (LOCAL=NO)
orasag 6682 1 0 05:45:54 ? 0:58 oracleSAG (LOCAL=NO)
orasag 6533 1 0 05:45:50 ? 0:03 oracleSAG (LOCAL=NO)
orasag 7256 1 0 05:49:56 ? 0:00 oracleSAG (LOCAL=NO)
orasag 6768 1 0 05:45:56 ? 0:04 oracleSAG (LOCAL=NO)
orasag 6732 1 0 05:45:55 ? 0:00 oracleSAG (LOCAL=NO)
I need a script that could identify all PID's for the processess that belong to orasag and where LOCAL=NO and perform a 'kill -9 ' for those PIds.
thankyou in advance
Faizer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2004 10:34 PM
03-19-2004 10:34 PM
Re: Need A Script
# perl -MProc::ProcessTable -e'$x=getpwnam"orasag";kill 9,map{$_->pid}grep{$_->uid==$x&&$_->cmndline=~/LOCAL=NO/)@{Proc::ProcessTable->new()->table}'
too terse?
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2004 10:37 PM
03-19-2004 10:37 PM
Re: Need A Script
How about:
kill -9 $(ps -ef | grep -v grep | grep "LOCAL=NO" | awk '/oracleSAG/ {print $2}')
Check this first, before adding the kill -9 string, to make sure i did not make a typo.
HTH,
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2004 11:07 PM
03-19-2004 11:07 PM
Re: Need A Script
kill -9 $(ps -ef | grep -v grep | grep ^orasag | grep "LOCAL=NO" | awk '/oracleSAG/ {print $2}')
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2004 12:04 AM
03-20-2004 12:04 AM
Re: Need A Script
Thanks for the correction.
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2004 01:26 AM
03-20-2004 01:26 AM
Re: Need A Script
syntax error The source line is 1.
The error context is
>>> oracleSAG/{ <<<
awk: Quitting
The source line is 1.
best regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2004 02:58 AM
03-20-2004 02:58 AM
Re: Need A Script
for i in $(ps -ef | grep -v grep | grep orasag | grep oracleSAG | grep | grep 'LOCAL=NO' | awk '{print $2}')
do
kill -9 $i
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2004 08:38 AM
03-20-2004 08:38 AM
Re: Need A Script
Try a space between / and {
HTH,
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2004 02:28 PM
03-20-2004 02:28 PM
Re: Need A Script
SELECT SID, SERIAL#, STATUS, SERVER, USERNAME FROM V$SESSION
If a user session is processing a transaction (ACTIVE status) when it is terminated, the transaction is rolled back and the user immediately receives the following message:
ORA-00028: your session has been killed
If the session is not making a SQL call to Oracle (is INACTIVE) when it is terminated, the ORA-00028 message is not returned immediately.
Check the following link as well:
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96521/manproc.htm#3849
Have a look at tnsnames.ora also.
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2004 09:02 PM
03-20-2004 09:02 PM
Re: Need A Script
Thankyou for the time spent on this. Both the scripts provided worked.
Thanks a lot
Faizer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2004 11:49 PM
03-20-2004 11:49 PM
Re: Need A Script
please have a look at this:
http://forums1.itrc.hp.com/service/forums/helptips.do?#28
thanks,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2004 04:43 AM
03-22-2004 04:43 AM
Re: Need A Script
I was also looking for a similar script. Thank you and all for this great help. Can you give points to all these helpfull guys.