Kill session using OS commands
In various critical situations Oracle DBA has to decide to kill existing session or kill the background process of Oracle database. At this moment remote Oracle DBA should need to terminate session/process called as termination of session of any instance.
If you want kill or terminate process using only operating system command only.How can you kill process in Unix?
We can check running processes in Unix and Linux using "ps" command. We are able to get process id from said command.
Now use "kill" command with "-9" syntax to kill process id as given below example.kill command with -9 for ensure not blocking command and surity if execution of "kill" command.
For using ORAKILL utility we should need process id from sqlplus. ORAKILL utility is shipped with Oracle software itself. When we install Oracle software same time ORAKILL also is being installed in ORACLE_HOME\bin folder. It can kill process same as "kill -9" command in Unix/Linux. But one drowback of this utility that is we need process id using sqlplus and from v$process,v$session data dictionary views as follows.
Now we can kill server process of 1456 of scott user using ORAKILL utility from command line of Windows as follows.
C:\> orakill instance_name spid
Example
C:\> orakill orcl 1456
We will get following message in our command prompt of windows.
"Kill of thread id 1456 in instance ORCL successfully signalled[sic]."
Kill Session: Kill process/session using operating system commands. Sometimes it is necessary to terminate process using system commands. View large
But if sometime SQL*Plus doesn't working like database stuck or instance hang situation. We need to terminate Oracle instance. But we are unable to execute command using SQL*Plus "shutdown abort" or our shutdown abort command also stuck in Windows. Then how can we terminate instance? Yes, we can restart instance service from service menu. But if we want to use only command line then how to terminate instance or kill instance or background process.
We can use TASKKILL command for terminating instance. Using tasklist command we can get thread id of Oracle.exe and using TASKKILL command we can terminate or kill instance in command line as follows.
Alternate we can stop and start service of Oracle instance using command line option of service as follows.It can be done using "NET start" and "NET stop" command using instance service name.
Means there are different ways to kill session or process in Unix and Windows. Both operating system has own command options.
Dbametrix is expert remote dba service provider team. Dbametrix has solid understanding to make SLA as per specification and requirement of client and end users. Dbametrix believes to provide remote DBA services of database administration using SLA. Due to this reason Dbametrix offers SLA based cost effective remote dba plans. Client of Dbametrix can able to put trust on company because Dbametrix delivers cost effective remote dba plan using Service Level Agreement SLA and response time matrix.
Check another articles on same topic of different execution type.