Oracle external table
DB CAFE
thumb_up 추천메뉴 바로가기
- DBA { Oracle DBA 명령어 > DBA 초급 과정 > DBA 고급 과정 }
- 튜닝 { 오라클 튜닝 목록 }
- 모델링 { 데이터 모델링 가이드 }
ORACLE/SQL 외부테이블 생성실습
--sysdba로 접속
SQL> grant create any directory to hr;
--권한이 부여되었습니다.
--===>hr 오라클 사용자에게 디렉토리 접근권한을 줌
SQL> conn hr/hr
--연결되었습니다.
SQL> create directory ext_data_file as 'C:\oracle';
--디렉토리가 생성되었습니다.
--외부 table
create table t_ext (
first_name varchar2(15), last_name varchar2(15), phone_name varchar2(15)
)
organization external
(
type oracle_loader
default directory ext_data_file
access parameters
(
fields terminated by ','
(
first_name, last_name, phone_name
)
)
location('112.csv') --한글이 들어간 외부파일일 경우 UTF-8으로 저장해야함
);
select * from t_ext;
--파일 조작은 불가능