Switching to an Oracle Database After Installation
If you want to use an Oracle database with SAM or Schema Registry after you have performed your initial HDF installation or upgrade, you can switch to an Oracle database. Oracle databases 12c and 11g Release 2 are supported
You have an Oracle database installed and configured.
- Log into Ambari Server and shut down SAM or Schema Registry.
- From the configuration screen, select Oracle as the database type and provide Oracle credentials, the JDBC connection string and click Save.
- From the command line where Ambari Server is running, register the Oracle JDBC driver jar:
sudo ambari-server setup --jdbc-db=oracle --jdbc-driver=/usr/share/java/ojdbc.jar
- From the host where SAM or Schema Registry are installed, copy the JDBC jar to the following
location, depending on which component you are updating.
cp ojdbc6.jar /usr/hdf/current/registry/bootstrap/lib/. cp ojdbc6.jar /usr/hdf/current/streamline/bootstrap/lib/.
- From the host where SAM or Schema Registry are installed, run the following command to create
the required schemas for SAM or Schema Registry.
export JAVA_HOME=/usr/jdk64/jdk1.8.0_112 ; source /usr/hdf/current/streamline/conf/streamline-env.sh ; /usr/hdf/current/streamline/bootstrap/bootstrap-storage.sh create export JAVA_HOME=/usr/jdk64/jdk1.8.0_112 ; source /usr/hdf/current/registry/conf/registry-env.sh ; /usr/hdf/current/registry/bootstrap/bootstrap-storage.sh createNote
You only this command run once, from a single host, to prepare the database.
- Confirm that new tables are created in the Oracle database.
- From Ambari, restart SAM or Schema Registry.
If you are specifying an Oracle database for SAM, run the following command after
you have restarted SAM.
export JAVA_HOME=/usr/jdk64/jdk1.8.0_112 ; source /usr/hdf/current/streamline/conf/streamline-env.sh ; /usr/hdf/current/streamline/bootstrap/bootstrap.sh
- Confirm that Sam or Schema Registry are available and turn off maintenance mode.