Archives

You are currently viewing archive for August 2009
Category: Oracle
Posted by: hajime osako
? = needs to check later.

STATSPACK ?

V$SESSION
V$SESSION_WAIT ?

set pagesize 200
select to_char(sysdate, 'MM-DD HH24:MI:SS') time from dual;
select sid, serial#, username, status, server, machine, terminal, program, sql_address, sql_hash_value from v$session where type != 'BACKGROUND' and username is not null; ?

select sid, seq#, event, p1, p2, p3, seconds_in_wait, state from v$session_wait where state = 'WAITING' and event not like 'SQL*NET message%' and event != 'smon timer' and event != 'pmon timer' and event != 'rdbms ipc message' and event != 'wakeup time manager'; ?

select sql_text from v$sqltext where hash_value = &hash_value and address = &address order by piece; ?

select executions, disk_reads, buffer_gets, row_processed, cpu_time, elapsed_time as elapsed_ms from v$sqlarea where has_value = &hash_value and address = &address; ?

select resource_name, current_utilization, max_utilization, limit_value from v$resource_limit; ?

alter session set events '10046 trace name context forever, level 8'; ?

set autotrace traceonly ?
select 1 from dual;?

#Bind variable
variable b0 number
begin :b0 := 100; enc;
select count(*), min(sal) from emp where sal < :b0; ?

Category: Linux tips
Posted by: hajime osako
AIX .profile and .ksrc files

* /etc/profile File
* /etc/environment File
* .profile File
* .env File

Category: Linux tips
Posted by: hajime osako
Category: MS tips
Posted by: hajime osako
SQL Server 2005 でのパフォーマンス問題のトラブルシューティング

select
scheduler_id,
current_tasks_count,
runnable_tasks_count
from
sys.dm_os_schedulers
where
scheduler_id < 255


select top 50
sum(qs.total_worker_time) as total_cpu_time,
sum(qs.execution_count) as total_execution_count,
count(*) as number_of_statements,
qs.plan_handle
from
sys.dm_exec_query_stats qs
group by qs.plan_handle
order by sum(qs.total_worker_time) desc

Category: MS tips
Posted by: hajime osako
SQL Server クエリ待機の状況を確認する - 戦艦ゆにっき

1.select
2. wait_type as '待機の種類',
3. waiting_tasks_count as '待機数',
4. wait_time_ms as '総待機時間',
5. max_wait_time_ms as '最大待機時間',
6. signal_wait_time_ms as '準備時間'
7.from sys.dm_os_wait_stats
8.order by wait_time_ms desc
Category: Linux tips
Posted by: hajime osako
Category: Linux tips
Posted by: hajime osako