프로시져 튜닝 요청 0 0 1,272

by 초보oracle [SQL Query] [2016.03.23 19:25:21]


안녕하세요 프로시져를 만들어서 실행하였으나 너무 오래걸려 튜닝 요청드립니다.

create or replace

proedure insert_team

IS

BEGIN

insert into team_temp A

select b.name,b.employee,b.local_full_name,b.retire,b.organization_code,b.job_title_code,b.job_title_name,b.user_id

from team

left outer join team_temp A on a.employee=b.employee

where a.employee is null and b.eai_seq_id in (select max(eai_seq_id) as eai_seq_id from team where application_flag='N' group by employee);

commit;

end;

이와 관련된 프로시져가 3개 더있습니다. (총4개 insert)

create or replace

procedure update_team

is

begin

merge

into ......

이와 관련된 프로시져가 3개 더있습니다. (총4개 Update)

이8개의 프로시져를 한프로시져를 통해 실행을 합니다.

create or replace

procedure sync

is

begin

update_team;

insert_team;

update team

set application_flag = 'Y'

where application_flag = 'N';

commit;

update_team2;

insert_team2

update team2

set application_flag = 'Y'

where application_flag = 'N';

commit;

update_team3;

update_team4;

insert_team3;

insert_team4;

update temp3

set application_flag = 'Y'

where application_flag = 'N';

commit;

end;

sync라는 프로시져가 매일 새벽3시에 실행되나 거의 한시간정도 걸리는거 같습니다.

이내용을 어떻게 질문해야할지 몰라서 일단 이렇게 올립니다.

궁금하신 사항 있으시면 댓글달아주시면 답변 드리겠습니다.

부탁드립니다.

댓글등록
SQL문을 포맷에 맞게(깔끔하게) 등록하려면 code() 버튼을 클릭하여 작성 하시면 됩니다.
로그인 사용자만 댓글을 작성 할 수 있습니다. 로그인, 회원가입