08/24: Oracle > performance
? = 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; ?
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; ?