
Create External Tables using Amazon EFS with Amazon RDS for Oracle
Amazon RDS for Oracle has the ability to integrate with Amazon Elastic File System (Amazon EFS). In this post I share guidance on how to create Oracle external tables using EFS file system.
NOTE: As pre-requisite you should follow the guidance in the blog post to create an Amazon EFS file system, integrate it with Amazon RDS for Oracle and have an Amazon EC2 server with Amazon EFS file system mounted as
/efsdir
1
2
sudo mkdir /efsdir/external
sudo chmod -R 777 /efsdir/external
basketball_teams.txt
at /efsdir/external
and add the some rows using the following command.1
echo -e 10, Boston\\n20, Denver\\n30, Toronto > /efsdir/external/basketball_teams.txt
1
2
3
4
5
6
BEGIN
rdsadmin.rdsadmin_util.create_directory_efs(
p_directory_name => 'EXTERNAL_DIR_EFS',
p_path_on_efs => '/rdsefs-fs-05cef2152acda175/external');
END;
/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
CREATE TABLE basketball_teams (
id NUMBER,
team_name VARCHAR2(50)
)
ORGANIZATION EXTERNAL (
TYPE ORACLE_LOADER
DEFAULT DIRECTORY EXTERNAL_DIR_EFS
ACCESS PARAMETERS (
RECORDS DELIMITED BY NEWLINE
DNFS_DISABLE
FIELDS TERMINATED BY ','
MISSING FIELD VALUES ARE NULL
(id,team_name)
)
LOCATION ('basketball_teams.txt')
)
PARALLEL
REJECT LIMIT UNLIMITED;
1
select * from basketball_teams;
Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.