본문 바로가기

전체 글

(667)
115 - [Oracle PL/SQL] Dependencies - Reducing invalidation 새로운 기능은 패키지의 마지막 부분에 추가뷰를 통해서 테이블을 참조하기
114 - [Oracle PL/SQL] Dependencies - Impact on the Package 시노님의 원본 테이블이 변경되어도 오류가 발생하지 않는 경우는 아래와 같다  구조가 다른 테이블 간의 시노님 변경에 대해서 알아보겠습니다.  테스트 준비select * from products;drop table products;--다른 구조의 테이블간에 시노님이 변경되는 경우를 확인해보자--오류가 발생/미발생 경우가 있다.drop table all_products;drop synonym s_products ;-- 원본 테이블 생성create table all_products(producut_id number, producut_name varchar2(30), producut_category varchar2(20));-- 테이블에 데이터 추가insert into all_products values (1,..
113 - [Oracle PL/SQL] Dependencies - Impact on the Package 테스트용 패키지와 프로시져 생성create or replace package pkgis procedure p1;end;/create or replace package body pkgis procedure p1 is begin dbms_output.put_line ('welcome'); end;end;/--프로시져에서 패키지.프로시져 호출create or replace procedure call_from_pkgisbegin pkg.p1;end;select object_name, object_type, created, statusfrom user_objectswhere lower(object_name) in ('pkg','call_from_pkg');------..
112 - [Oracle PL/SQL] Dependencies - Impact on the Procedure 테스트 준비 - 프로시져 생성 및 상태 확인create or replace procedure p1isbeginfor i in (select cust_id from customer) loop dbms_output.put_line(i.cust_id); end loop;end;/create or replace procedure p2isbeginfor i in (select * from customer) loop dbms_output.put_line(i.cust_id); end loop;end;-- 새로 생성한 프로시져 2개의 상태는 정상select object_name, object_type, created, statusfrom user_objectswhere lower(object_name) in..
111 - [Oracle PL/SQL] Dependencies - Impact on the Function 테스트 준비--impact on the function when adding/altering orginal tablecreate or replace function get_cust_name ( p_cust_id number) return varchar2is v_name customer.name%type;begin select name into v_name from customer where cust_id=p_cust_id; exception when others then return null;end;-- 현재 모든 객체는 정상select object_name, object_type, created, statusfrom user_objectswhere lowe..
110 - [Oracle PL/SQL] Dependencies - Impact on the View Impact of Adding/ Altering column for the Referenced Table   원본 테이블의 변화가 view 에 주는 영향-- 테스트 준비DROP TABLE customer/create table customer( cust_id number, name varchar2(100), tel varchar2(10));create or replace view v_customerasselect cust_id,namefrom customer;/create or replace view v2_customerasselect *from customer;   -- 객체들의 상태는 모두 정상select object_name, object_type, created, statusfrom user_..
109 - [Oracle PL/SQL] Dependencies - 객체의 4가지 상태 원본 테이블에 대한 변경 및 영향-- 테스트 준비drop table students;drop view v1_students;drop view v2_students;drop procedure print_all_students;drop procedure print_all_students_from_v1;create table students(student_id number, student_name varchar2(30), dob date );/insert into students(student_id,student_name,dob) values (1,'aya ahmed','1-jan-1980');insert into students(student_id,student_name,dob) values (2,'sar..
108 - [Oracle PL/SQL] Dependencies - Direct/Indirect Direct 의존관계의 객체들   inDirect 의존관계의 객체들      코드를 통해서 Direct/Indirect 개념을 확인해보자-- 데이터 준비drop table students/create table students(student_id number, student_name varchar2(20), dob date )/ insert into students(student_id,student_name,dob) values (1,'aya ahmed','1-jan-1980');insert into students(student_id,student_name,dob) values (2,'sara mahmoud','1-jan-1980');insert into students(student_id,studen..