-----------------------------------查看存儲過程的情況-----------------------------------------------------------
查看存儲過程內容:select text from user_source where name =upper(''sp_kr_pd_markplan_info'')
查看是否調用存儲過程:select * from dgdm_dw.tb_dw_sys_log where table_name=''TB_DW_MD_WORKF_MARKPLAN_CUR'';
查看分區的命令:從視圖user_tab_partitions 和 user_segments 中可以查詢到
刪除分區的命令:
單個刪:alter table table_name drop partition partition_name
刪除一個表下所有的分區:
SELECT ''alter table ''||owner||''.''||segment_name||'' drop partition ''||partition_name||'';''
from dba_segments where
segment_name like ''TB_MK_LS_USER_CELL_DTAL_MID''
order by partition_name
增加新分區命令:alter table table_name add partition partition_name values()
alter table dgdm_mk.TB_MK_SC_CALL_FEE_DAY add partition CALL_FEE_DAY_20070930 values(to_date(20070930,''yyyymmdd'') ) tablespace tbs_mk_list_data_3;
查看存儲過程中含有tb_kr_kpi_nuser_day:select * from user_source t where t.type like ''%tb_kr_kpi_nuser_day%''
查看表結構命令 select dbms_metadata.get_ddl(''TABLE'',''TB_KR_SC_VIP_MON'',''dgdm_kr'') from dual;
查看存儲過程命令 select text from user_source where name =upper(''sp_kr_pd_markplan_sta_QQt'');
編譯存儲過程 alter procedure sp_kr_pd_markplan_sta_QQt COMPILE;
壓縮分區或者表數據
execute immediate ''alter table tb_mk_user_opp_last_call_day move partition OPP_LAST_CALL_DAY_''||iv_date||'' compress'';
-------------------------------------批量執行存儲過程-----------------------------------------
run.sql內容:
var hhh number;
exec dgdm_mk.SP_DWMK_OPP_USER_CELL_MON(''20070815'',:hhh);
/
exec dgdm_mk.SP_DWMK_OPP_USER_INFO(''20070815'',:hhh);
/
exec dgdm_mk.SP_DWMK_OPP_USER_INFO_WEEK(''20070815'',