External Table Directories
COL DIRECTORY_PATH form a60
col DEFAULT_DIRECTORY_NAME form a30
select distinct default_directory_name, directory_path
from dba_external_tables,
dba_directories
where directory_name = default_directory_name;
Reverse Engineer External Tables with Trimming of Data
set head off
select 'set long 5000' ||chr(10)||
'select dbms_metadata.get_ddl(''TABLE'''||','''||table_name||''','''||owner||''') from dual;'
from dba_external_tables where owner in ('CI','CO','CDG','UA');
External Table Examples
drop directory [directory name];
create directory Gtdocid_dir as [directory path];
grant read on directory [directory name] to public;
grant write on directory [directory name] to public;
drop table [table name];
create table [table name] (
[column name] [DATA_TYPE]
)
organization external (
type oracle_loader
default directory [directory name]
access parameters (
fields terminated by ' ' lrtrim
(
[column name]
)
)
location ([Source File])
);
grant select on sys.[table name] to public;