------------------------------oracle資料庫cpu超高問題分析捕捉 開始---------------------------------------
--根據程序號查詢對應的sql語句
select listagg(sql_text, '') within group(order by piece)
from v$sqltext a
where (a.hash_value, a.address) in
(select decode(sql_hash_value, 0, prev_hash_value, sql_hash_value),
decode(sql_hash_value, 0, prev_sql_addr, sql_address)
from v$session b
where b.paddr =
(select addr from v$process c where c.spid = '&pid'))
order by piece asc;
/select listagg(sql_text, '') within group(order by piece)
from (select sql_text, a.piece
from v$sqltext a
where (a.hash_value, a.address) in
(select decode(sql_hash_value,
0,prev_hash_value,
sql_hash_value),
decode(sql_hash_value, 0, prev_sql_addr, sql_address)
from v$session b
where b.paddr =
(select addr from v$process c where c.spid = '&pid'))
order by piece asc);
/--根據程序行找查詢語句
select addr,spid from v$process where spid='11296';
select sid,sql_id from v$session where paddr='0000000382c3e9e0';
select sql_text from v$sql where sql_id='00z33j9a8xm9b';
--根據程序號查詢並生成kill掉占用cpu過高的語旬
select 'alter system kill session ''' || t.sid || ',' || t.serial# || ''';'
from v_$session t
where t.sid =
(select sid
from v$session
where paddr = (select addr from v$process where spid = '21717'));
select /*+ ordered */
sql_text,a.*
from v$sqltext a
where (a.hash_value, a.address) in (
select decode (sql_hash_value,
0, prev_hash_value,
sql_hash_value
),decode (sql_hash_value, 0, prev_sql_addr, sql_address)
from v$session b
where b.paddr = (select addr
from v$process c
where c.spid =13415))
order by piece asc;
select * from v_$session t;
------------------------------oracle資料庫cpu超高問題分析捕捉 結束---------------------------------------
超高效能 key value 資料庫 Redis
redis是乙個高效能的key value資料庫。redis的出現,很大程度補償了memcached這類keyvalue儲存的不足,在部 分場合可以對關聯式資料庫起到很好的補充作用。它提供了python,ruby,erlang,php客戶端,使用很方便。前幾天微博發生了一起大的系統故障,很多技術的朋...
pl sql遠端訪問oracle資料庫的問題
pl sql遠端訪問oracle資料庫的問題 address list address protocol tcp host 130.81.100.101 port 1521 connect data service name scbus oraclebcv description address l...
oracle資料庫賦權 Oracle資料庫許可權
oracle資料庫許可權基本認識 一 oracle許可權 oracle系統提供三種許可權 object 物件級 system 系統級 role 角色級。許可權分類 1 系統許可權 系統規定使用者使用資料庫的許可權。系統許可權是對使用者而言 2 實體許可權 某種許可權使用者對其它使用者的表或檢視的訪問...