본문 바로가기

Database/PLSQL

(119)
120 - [Oracle PL/SQL] DML logs using package dbms_errlog 데이터 입력시 오류가 발생할때 어떻게 관리하는것이 좋은지 알아보겠습니다.107개의 데이터가 있습니다. select employee_id , first_name||' '||last_name namefrom employees;/*107 rows selected. */   테스트 준비drop table emp_c;/create table emp_c( employee_id number, ename varchar2(15) );select * from emp_c;/*no rows selected*/   오류가 발생하면 롤백이 발생하면서 정상적인 데이터도 입력이 되지 않는다insert into emp_cselect employee_id , first_name||' '||last_name namefrom employe..
119 - [Oracle PL/SQL] Trigger to open the PDB on start up. 1-      Connect as sys as sysdba2-      Make sure that you are on the root database ( the container )3-      You can make sure from this byshow con_nameit should give you like this CDB$ROOT 4-      Then you have to execute this codecreate or replace TRIGGER pdb_startupAFTER STARTUP ON DATABASEBEGINEXECUTE IMMEDIATE 'alter pluggable database all open';END;
118 - [Oracle PL/SQL] Remote Dependencies - Signature mode 원격 디비인 ict 유저로 로그인해서 아래 스크립트 실행--step 1--the User ICT is exist in remote database called newd--the user will create table, view on table, --and procedure read form the view --the user will check that all theses objects are valid--take code from heredrop table students;/create table students(student_id number, student_name varchar2(50), dob date );/insert into students(student_id,student_name,dob..
117 - [Oracle PL/SQL] Remote Dependencies - Time stamp ict@newd 에 접속해서 아래 스크립트를 실행step 1 - conn ictthe User ICT is exist in remote database called newdthe user will create table, view on table, and procedure read form the view the user will check that all theses objects are valid-- drop table students;/create table students(student_id number, student_name varchar2(100), dob date );/insert into students(student_id,student_name,dob) values (1,'aya ahm..
116 - [Oracle PL/SQL] Remote Dependencies - 환경 준비 디비 링크를 만들어서 다른 PDB에 접근하는 원격 Dependencies 대해서 알아보겠습니다. To read from remote DB, the DBA should create Database link.So the DBA will create link in orclpdb that read newd databasecreate public database link READ_REMOTEconnect to ictidentified by ictusing ‘newd';Now when user HR (orclpdb) need to query table from ict(newd): select * from table_name@database_link_nameExample : select * from students@..
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');------..