X

Move data between Oracle Database and Apache Hadoop using high speed connectors.

  • June 22, 2016

Using Oracle SQL Connector for HDFS with Oracle Wallet

It is easy to use Oracle SQL Connector for HDFS with a
client-side Oracle Wallet.  Oracle Wallet
is a secure container that stores authentication and signing credentials. This is a secure way to automate connections
to the database and simplify large-scale deployments that rely on password
credentials to connect to the database.

Refer to Oracle Wallet documentation here.

You can create the OSCH external table from either the
database node, or from a Hadoop node, edge node, or Hadoop client. If you using a Hadoop node, edge node or
Hadoop client, you will likely not have a database client installed. You will need to copy tnsnames.ora and
sqlnet.ora from the database install location to a location on your client to
use Wallet (see below).

Below is an example of using Oracle Wallet with Oracle SQL
Connector for HDFS on the Oracle Big Data Lite VM.

Step 1

1. 1. Create a Wallet store

prompt> mkstore –wrl  <wallet_location> -create
For example,
prompt> mkstore –wrl /home/oracle/oracle_wallet
-create

Step 2

2. 2. Create a credential to log into the database

prompt> mkstore –wrl <wallet_location> -createCredential
<db_connect_string> <user>

For example,
prompt> mkstore –wrl /home/oracle/oracle_wallet -create
orcl moviedemo

3.

If       Step 3

          If you are creating the OSCH external table from
a Hadoop node, edge node, or Hadoop client, copy the files $ORACLE_HOME/network/admin/tnsnames.ora
and $ORACLE_HOME/network/admin/sqlnet.ora from ORACLE_HOME to a location on
your client.

4.     Step 4

      Make the entry in tnsnames.ora as documented in
the Oracle Wallet documentation. This
might already exist. For example:

ORCL =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST =
localhost)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = orcl)

)

)

5.     Step 5

        Make the entry in sqlnet.ora as documented in
the Oracle Wallet documentation. For
example:

WALLET_LOCATION =

(SOURCE =

(METHOD = FILE)

(METHOD_DATA =

(DIRECTORY = /home/oracle/oracle_wallet)

)

)

SQLNET.WALLET_OVERRIDE =
TRUE

Now you are ready to use this Wallet
credential with OSCH.

Step 1

Add the following properties to the OSCH config
properties.

oracle.hadoop.connection.wallet_location

Example:

<property>

<name>oracle.hadoop.connection.wallet_location</name>

<value>/home/oracle/oracle_wallet</value>

</property>

oracle.hadoop.connection.tnsEntryName

Example:

<property>

<name>oracle.hadoop.connection.tnsEntryName</name>

<value>orcl</value>

</property>

oracle.hadoop.connection.tns_admin

Example:

<property>

<name>oracle.hadoop.connection.tns_admin</name>

<value>/u01/app/oracle/product/12.1.0.2/dbhome_1/network/admin</value>

</property>

Step 2

Remove the following connection properties that
might have been used to connect to the database by interactively typing the
password.

oracle.hadoop.connection.url
and oracle.hadoop.connection.user

Now you are ready to use OSCH and connect to the database
using Oracle Wallet. Run your OSCH
commands as before. OSCH will use the
credentials stored in Oracle Wallet and will not prompt you for a password.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.