Stop tsprod1, tsprod2 DB
in 181
lsnrctl stop tsprod1
ps -ef|grep LOCAL=NO |grep -v grep |awk '{print $2}' | xargs kill -9
sqlplus / as sysdba
sql>shutdown immediate
in 182
lsnrctl stop tsprod2
ps -ef|grep LOCAL=NO |grep -v grep |awk '{print $2}' | xargs kill -9
sqlplus / as sysdba
sql>shutdown immediate
---
select 'alter system kill session ',''''||trim(t2.sid)||','||trim(t2.serial#)||''';'
from v$locked_object t1,
v$session t2
where t1.session_id=t2.sid
order by t2.logon_time;
select 'alter system kill session ',''''||trim(t2.sid)||','||trim(t2.serial#)||''';'
from v$session t2
where username ='DBMONOPR';
---
set head off feedback off
spool kill_sess.sql
select 'alter system kill session ',''''||trim(t2.sid)||','||trim(t2.serial#)||''';'
from v$session t2
where username !='SYS';
spool off
--kill from ospid
set linesize 120
set pagesize 120
column spid heading 'OSpid' format a8
column pid heading 'Orapid' format 999999
column sid heading 'Sess id' format 99999
column serial# heading 'Serial#' format 999999
column status heading 'Status' format a8
column pga_alloc_mem heading 'PGA alloc'
column username heading 'oracleuser' format a12
column osuser heading 'OS user' format a12
column program heading 'Program' format a28
SELECT
p.spid,
p.pid,
s.sid,
s.serial#,
s.status,
p.pga_alloc_mem,
s.username,
s.osuser,
s.program
FROM
v$process p,
v$session s
WHERE s.paddr(+) = p.addr
and s.sid in
(select trim(t2.sid)
from v$session t2
where username ='DBMONOPR')
kill -9