Hi folks,
I want to kill all process of oracle user and won't kill shell, should i try this? Please confirm.
1st way
pgrep -u oracle | sudo xargs kill -9
2nd way
killall -u oracle
3rd way
su - oracle -c /sbin/killall5
Please suggest.
Do you want to terminate the oracle instance or an oracle user session? If it's the latter, then I would avoid killing an OS process if you can.
As a DBA capable account, have a look at the 'table' v$session. It lists various columns. If you can identify the one to clear out, you need to execute:-
alter system kill session ('sid,serial#') ;
Insert the appropriate values for sid and serial# from the v$session table. if that doesn't do the trick, then you may need to look at the start time to confirm the OS process id and terminate that will a kill -9
If you really want to terminate an oracle instance then (depending on version) you would be better to connect with either
-
svrmgrl
then connect internal
or
-
sqlplus
then / as sysdba
when prompted for the user-name.
In each case, you can issue the shutdown command. This allows for options such as immediate (signal all processes to stop & roll-back) and abort (crash instance, roll-back will be at next startup)
I hope that this helps,
Robin
Liverpool/Blackburn
UK