ALTIBASE常用監控語句

2021-05-24 01:31:45 字數 1289 閱讀 6049

以下是在altibase記憶體資料庫管理過程常用語句:

統計服務執行緒狀態

select type, state, count(*) from v$service_thread group by type, state;

檢視終端會話

select comm_name, count(*) from v$session group by comm_name order by 1 desc;

檢視阻塞會話

select a.comm_name client_ip, client_pid client_pid from v$session a , v$service_thread b where a.service_thread_id=b.id and b.type='dedicated';

查詢前5個用時最多的sql

select query, total_time from v$statement order by 2 desc limit 5;

檢視執行緒配置

select name, value1 from v$property where name like 'multiplexing%';

檢視複製阻塞的情況

select * from v$repgap;

語句鎖v$lock, v$lock_statement, v$lock_wait

檢視資料庫記憶體分配情況

select mem_alloc_page_count , mem_free_page_count  from v$database;

檢視記憶體資料庫總的分配大小

select sum(alloc_size) from v$memstat;

檢視表占用的空間

select a.name, b.table_name ,d.fixed_alloc_mem+d.var_alloc_mem mem_alloc_size ,

d.fixed_used_mem+d.var_used_mem used_size 

from x$tablespaces a, system_.sys_tables_ b, x$table_info c ,v$memtbl_info d

where b.table_oid=c.table_oid and c.tablespace_id=a.id and d.table_oid=c.table_oid 

and b.table_name not like 'sys_%' and b.table_name not like 'next_%'

order by a.name desc , b.table_name asc; 

oracle監控常用語句

資料庫例項查詢 select from gv version rdbms資訊 select from gv version where banner like oracle sql net版本資訊 select from gv version where banner like tns sga資訊 ...

Oracle監控語句

檢視資料庫鏈結數 select from v session 檢視那些使用者在使用資料庫 select distinct username from v session 檢視資料庫的sid select name from v database 檢視系統被鎖的事務時間 select from v l...

Oracle監控語句

檢視資料庫鏈結數 select from v session 檢視那些使用者在使用資料庫 select distinct username from v session 檢視資料庫的sid select name from v database 檢視系統被鎖的事務時間 select from v l...