Download presentation
Presentation is loading. Please wait.
Published byCalvin Miller Modified over 9 years ago
1
Loading the Data Warehouse (Chapter10) Data Warehousing Lab. Semester 2 HyunSuk Jung
2
2 Data Warehousing Lab. DW Import n Reflexive partner to Export. p Export: to copy Oracle data to a compressed binary file readable only by Oracle. p Import: to copy data from that file back into one or more Oracle tables n Reads only files created by Export. n Backup strategy used by most Oracle installations. n Migration strategy : from operational systems into the Oracle data warehouse
3
3 Data Warehousing Lab. DW Modes of Operation n The owner of the tables in the source database n Tables belonging to more than one user n If the imported tables do not already exist ModeDetails Full DatabaseExports and imports the complete database. This includes all data, structure definitions, and the files that support the database. UserExports and imports the data and corresponding data definitions for one or more users. TableExports and imports the data and corresponding data definitions for one or more tables, belonging to one ore more owners.
4
4 Data Warehousing Lab. DW Parameters Fed to Import ParameterDetailsDefault Ignore Import 중 create 명령을 실행할 때 만나게 되는 에러들을 무시할 것인지 결정 (Y/N 플래그 ) N Commit 배열 단위로 commit 을 할 것인가를 결정. 기본적으로 테이블 단위로 commit 한다. 배열의 크기는 buffer 에 의해 설정된다. N Fromuser EXPORT 덤프 파일로부터 읽혀져야 하는 객체들을 갖고 있는 데이터베이스 계정 None Touser EXPORT 덤프 안에 있는 객체들이 IMPORT 될 데이터베이스 계정 None Full FULL EXPORT 덤프 파일이 IMPORT 할때 사용한다.
5
5 Data Warehousing Lab. DW Five parameter 설명 n The Ignore Parameter Imp userid=account/account full=y file=account ignore=y n The Commit Parameter p “save” Imp userid=account/account full=y file=account ignore=y commit=y n Fromuser, Touser, and Full Parameters p Must be coded on the call to Import
6
6 Data Warehousing Lab. DW Import 예제 n 예제 1) 전체 database 가 import 된다. (Full Level) imp userid=system/manager file=‘C:\full.dmp’ full=y n 예제 2) Scott 의 user import 를 실행한다. (User Level) imp userid=scott/tiger file=‘C:\scott.dmp’ n 예제 3) 다른 계정으로 IMPORT 하기. scott user 의 데이터를 export 해서 test user 에게 import 하는 예제 exp userid=system/manager file=‘C:\scott.dmp’ owner=scott imp userid=system/manager file=‘C:\scott.dmp’ fromuser=scott touser=test
7
7 Data Warehousing Lab. DW PL/SQL Approach n n 오라클 자체에 내장되어 있는 프로시져 언어 블록 구조를 갖는다. SQL 문을 지원하는 제어문, 반복문 등을 지원한다. PL/SQL 은 그 자신의 컴파일 엔진을 가지고 있다. 목적 : SQL 문을 블록단위로 처리하므로 network 상에서의 처리속도를 향상시킨다. 지원하는 TOOL : ORACLE FORMS,DEVELOPER/2000,SQL*plus. n n Powerful and very flexible tool n n Part of the data warehouse transformation solution
8
8 Data Warehousing Lab. DW PL/SQL Approach n n Modularization : stand-alone program n n Creating routine p Data reading p Data validation p Data creation p Business rules p Data parsing p Data transform p Data loading
9
9 Data Warehousing Lab. DW UTL_FILE n n Utl_file package 를 사용함으로써 일반 file 에 대한 input/output 을 수행할 수 있다. n n Limitations p A maximum string length of 1KB p Maximum of ten files open simultaneously. p Files must be placed in directories identified in the init.ora parameter of utl_file_directory. n n Logical series of steps to load data into the data warehouse 1. Open datafile for reading 2. Loop through each file record 3. Parse record 4. Transform and load data into the warehouse 5. Verify load status 6. Close data file 7. Return status to the user
10
10 Data Warehousing Lab. DW Dynamic SQL n n Dynamic SQL Steps in a Program 1. Open cursor (open_cursor) 2. Parse statement (parse) 3. Bind input variables (bind_variable) 4. Execute statement (execute) 5. Retrieve values of output variables (retrieve_variable) 6. Close cursor (close_cursor) n n With Oracle8i dbms_sql.parse(l_cursor_id, l_sql, dbms_sql.native); l_lows:= dbms_sql.execute(l_cursor_id); dbms_sql.close_cursor(l_cursor_id); execute immediate l_sql;
11
11 Data Warehousing Lab. DW Dynamic SQL n n Why you would want to use Dynamic SQL? p Table-driven loading structure p Changes to physical environment (new tables added each month) p Increase modularity of code : 프로그램의 재사용성 (reusability) 을 증가시킬 수 있다. “It’s really good”
12
12 Data Warehousing Lab. DW OWB(Oracle Warehouse Builder) OWB 란 ? OWB 란 ? 기업 데이터 웨어하우스, 데이터 마트 및 e-Business 애플리케이션을 디자인, 구현 및 관리하기 위한 도구 Oracle9i Developer 제품군에 포함되어 있다.
13
13 Data Warehousing Lab. DW OWB 기본 기능 Metadata 중심의 source 정의 metadata source 를 OWD 의 repository 로 import
14
14 Data Warehousing Lab. DW OWB 기본 기능 Graphical mapping and transformation design Graphical mapping and transformation design high-level mapping : source table 을 target table 로 mapping
15
15 Data Warehousing Lab. DW OWB 기본 기능 detailed-level mapping : transformation 시 수행되는 칼럼과 칼럼간의 mapping 변환 library 통해 PL/SQL 로 모듈 생성 후 재사용 가능 변환 시 필요한 경우 customize 할 수 있음
16
16 Data Warehousing Lab. DW 장점 (1/2) 신속한 DW 설계 신속한 DW 설계 OWB 의 visual model, wizard 중심의 GUI 사전 정의된 변환 라이브러리 에러 없는 코드 작성 에러 없는 코드 작성 DW 개발 이전에 객체, 매핑, 변환 등을 확인 생성된 객체 : Foreign, Unique, Primary Key 를 지닌 table view, 구체화된 view, fact, dimension, hierarchy, level, index, partition, table 공간 등이 포함
17
17 Data Warehousing Lab. DW 장점 (2/2) 신속하고 정확한 데이터 로딩 신속하고 정확한 데이터 로딩 Oracle8i 를 데이터 로딩을 제공하는 변환 엔진으로 사용 wizard 중심의 interface : 기본 및 direct path loader 를 통해 flat file 로부터 데이터를 로딩하기 위한 제어 파일을 생성 중앙 집중화된 메타데이타 관리 중앙 집중화된 메타데이타 관리 CWM(Common Warehouse Model) 을 통해 메타데이타를 수집, 배포 애플리케이션 통합 애플리케이션 통합 Oracle Application 11i e-Business Intelligence 가 사전 패키지화된 DW 제공
18
18 Data Warehousing Lab. DW ETL Code Generator Tools n n ETI*EXTRACT(Evolutionary Technologies International) p 데이터 이동의 자동화
19
19 Data Warehousing Lab. DW Oracle Transparent Gateways n n OWB 와 함께 사용되는 oracle 제품 n n 오라클이 아닌 데이타베이스를 access
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.