[Oracle] Resource Manager를 이용한 자원 제한 2

·2025년 9월 16일

오라클 관리

목록 보기
144/163

[실습1] Resource Manager로 undo 사용량을 제한하시오

-- scott 유져가 undo 사용량을 제한하도록 설정하시오

   -- new_undo_pool => 10

--  10 kb  제한 받는것 입니다.

SYSTEM> exec dbms_resource_manager.create_pending_area();

SYSTEM> begin
             dbms_resource_manager.update_plan_directive(
              plan=>'DAYTIME',
              group_or_subplan=>'ONLINE_USERS',
              new_undo_pool=> 10);
            end;
/

SYSTEM> exec dbms_resource_manager.submit_pending_area();

[실습2] scott으로 접속해서 가벼운 update를 실행합니다.


[실습3] scott 유져에서 undo 사용량을 과도하게 사용하는 update 문장을 수행하시오

SCOTT @ ORA19 > create  table sales500
  2             as
  3              select * from sh.sales;
            select * from sh.sales
                             *
3행에 오류:
ORA-30027: 실행 취소 할당량 위반 - 88(바이트) 가져오기 실                패


SCOTT @ ORA19 >

[실습4] scott이 충분한 undo를 사용할 수 있도록 언두 사용 제한을 받지 않도록 하시오

SYSTEM> exec dbms_resource_manager.create_pending_area();

SYSTEM> begin
             dbms_resource_manager.update_plan_directive(
              plan=>'DAYTIME',
              group_or_subplan=>'ONLINE_USERS',
              new_undo_pool=> -1);
            end;
/

SYSTEM> exec dbms_resource_manager.submit_pending_area();

[oracle@ora19c ~]$ sqlplus scott/tiger

SQL*Plus: Release 19.0.0.0.0 - Production on916 10:05:44 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

마지막 성공한 로그인 시간: 화 916 2025 09:59:25 +09:00

다음에 접속됨:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SCOTT @ ORA19 > create table sales500
  2            as
  3             select * from sh.sales;

테이블이 생성되었습니다.

SCOTT @ ORA19 >

--> -1을 쓰면 언두 사용제한이 풀림


문제1. 다시 scott 의 언두 사용을 10kb 로 제한하시오

SYSTEM> exec dbms_resource_manager.create_pending_area();

SYSTEM> begin
             dbms_resource_manager.update_plan_directive(
              plan=>'DAYTIME',
              group_or_subplan=>'ONLINE_USERS',
              new_undo_pool=> 10);
            end;
/

SYSTEM> exec dbms_resource_manager.submit_pending_area();

[oracle@ora19c ~]$ sqlplus scott/tiger

SQL*Plus: Release 19.0.0.0.0 - Production on916 10:08:19 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

마지막 성공한 로그인 시간: 화 916 2025 10:05:44 +09:00

다음에 접속됨:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SCOTT @ ORA19 > delete from sales500;
delete from sales500
            *
1행에 오류:
ORA-30027: 실행 취소 할당량 위반 - 7696(바이트) 가져오기 실패

문제2. scott이 다시 undo 사용을 충분히 할 수 있도록 풀어주시오

SYSTEM> exec dbms_resource_manager.create_pending_area();

SYSTEM> begin
             dbms_resource_manager.update_plan_directive(
              plan=>'DAYTIME',
              group_or_subplan=>'ONLINE_USERS',
              new_undo_pool=> -1);
            end;
/

SYSTEM> exec dbms_resource_manager.submit_pending_area();

0개의 댓글