1,索引:
exec dbms_stats.gather_table_stats(ownname=>'etl',tabname=>'f_p10ids_classcode_l');
analyze index index1 validate structure:
analyze index index1 compute statistics:
2, 謂詞上移 & 謂詞下推 predicate push
e, cbo hint:no_unnest,push_subq,push_pred的用法 http://www.itpub.net/viewthread.php?tid=1308385
3, table join :
key: semi
4,分析函式:
select address
,disk_reads
,executions
,100 * ratio_to_report(disk_reads) over() pct
from sys.v_$sql
where command_type != 47
order by disk_reads desc ;
5 ,使用如下語句,查出此時,系統消耗多的sql
-- etl
drop table temp_v$sql ;
create table temp_v$sql (
sql_id varchar2(30),
sql_text varchar2(1000),
executions varchar2(30),
parse_calls varchar2(30),
disk_reads varchar2(30),
buffer_gets varchar2(30),
user_io_wait_time varchar2(30),
rows_processed varchar2(30),
cpu_time varchar2(30),
elapsed_time varchar2(30),
type varchar2(30),
dttm date
) ;-- ccframe
delete from etl.temp_v$sql ;
commit;
insert into etl.temp_v$sql
select sql_id
,max(sql_text) sql_text
,sum(executions) executions
,sum(parse_calls) parse_calls
,sum(disk_reads) disk_reads
,sum(buffer_gets) buffer_gets
,sum(user_io_wait_time) user_io_wait_time
,sum(rows_processed) rows_processed
,sum(cpu_time) cpu_time
,sum(elapsed_time) elapsed_time
,'before'
,sysdate
from sys.v_$sql
where command_type != 47
commit;
insert into etl.temp_v$sql
select sql_id
,max(sql_text) sql_text
,sum(executions) executions
,sum(parse_calls) parse_calls
,sum(disk_reads) disk_reads
,sum(buffer_gets) buffer_gets
,sum(user_io_wait_time) user_io_wait_time
,sum(rows_processed) rows_processed
,sum(cpu_time) cpu_time
,sum(elapsed_time) elapsed_time
,'after'
,sysdate
from sys.v_$sql
where command_type != 47
commit;
select *
from (select bef.sql_id
,bef.sql_text
,aft.executions - bef.executions executions
,trunc((100 * ratio_to_report(aft.executions - bef.executions) over()),2) pct_executions
,aft.parse_calls - bef.parse_calls parse_calls
,trunc((100 * ratio_to_report(aft.parse_calls - bef.parse_calls) over()),2) pct_parse_calls
,aft.disk_reads - bef.disk_reads disk_reads
,trunc((100 * ratio_to_report(aft.disk_reads - bef.disk_reads) over()),2) pct_disk_reads
,aft.buffer_gets - bef.buffer_gets buffer_gets
,trunc((100 * ratio_to_report(aft.buffer_gets - bef.buffer_gets) over()),2) pct_buffer_gets
,aft.user_io_wait_time - bef.user_io_wait_time user_io_wait_time
,trunc((100 * ratio_to_report(aft.user_io_wait_time - bef.user_io_wait_time) over()),2) pct_io_wait_time
,aft.rows_processed - bef.rows_processed rows_processed
,trunc((100 * ratio_to_report(aft.rows_processed - bef.rows_processed) over()),2) pct_rows_processed
,aft.cpu_time - bef.cpu_time cpu_time
,trunc((100 * ratio_to_report(aft.cpu_time - bef.cpu_time) over()),2) pct_cpu_time
,aft.elapsed_time - bef.elapsed_time elapsed_time
,trunc((100 * ratio_to_report(aft.elapsed_time - bef.elapsed_time) over()),2) pct_elapsed_time
from etl.temp_v$sql bef, etl.temp_v$sql aft
where bef.sql_id = aft.sql_id
and bef.type = 'before'
and aft.type = 'after') tt
order by elapsed_time desc; --sql ordered by elapsed time
order by cpu_time desc; --sql ordered by cpu time
order by buffer_gets desc ;-- sql ordered by gets
order by disk_reads desc ; -- sql ordered by reads
order by executions desc ; -- sql ordered by executions
order by parse_calls desc; --sql ordered by parse calls
6 常用aix命令:
ls | awk '' | sh
git 本人常用命令
切換到要操作的專案資料夾 cd projectpath 例如,cd downloads g25 platform sdk 檢視專案的分支們 包括本地和遠端 git branch a 例如,git branch a 建立分支x git branch x 切換分支到x git checkout x 建立...
本人常用Linux命令集錦ing
1,apt get apt get install openssh server 安裝軟體openssh server apt get remove openssh server 解除安裝openssh server軟體 2,cd cd etc sysconfig 進入 etc sysconfig ...
vue本人常用外掛程式彙總(常更新)
1.移動端ui外掛程式 mint ui 2.vue狀態管理vuex,持久化外掛程式 vuex persist 3.nuxt大多數也需要用到vuex,但是用vuex persist就不合適了,幸好有另外乙個vuex persistedstate 4.個人用的最多的移動端布局解決方案 hotcss 原始...