Oracle REST Data Service

Oracle Cloud Infrastructure Storage Software Appliance – Installation and Configuration

The Oracle Cloud Infrastructure Storage Software Appliance – also known as Oracle Storage Cloud Software Appliance OSCSA – acts as a gateway between classic storage and the Oracle Cloud Infrastructure Object Storage Service. The appliance can be installed on an on-premises Linux system or in an Oracle Compute Cloud machine and runs in a Docker container. It offers a local cache where clients can place their files before the OSCSA moves them into the Storage Service. The communication between a client with a filesystem to the OSCSA works with NFSv4, from the OSCSA to the Object Storage Service, Oracle is using their REST interface. Traffic from the OSCSA to and from the Oracle cloud can be encrypted and compressed.

In this blog post first I will show you how you can install and configure the OSCSA in an on-premises environment. In a second step I configure an on-premises database server which uses the Object Storage Service as Oracle RMAN backup location.

Key Features

  • Compression and Exncryption
  • File Versioning
  • End-to-end Data Integrity with Checksum Verification
  • Support for Data Archival (Oracle Storage Archive Class)
  • Pin files to the appliance cache for faster access

Where to get the OSCSA and more Information

Requirements

  • Two dual-core CPUs (4-core CPUs recommended)
  • Minimum memory requirements (based on the maximum number of files that can be uploaded to the appliance filesystem):
    • 16 GB for filesystems up to 1 million files
    • 32 GB for filesystems up to 5 million files
    • 64 GB for filesystems up to 10 million file
  • Minimum disk size required to install Docker: 10 GB
  • Oracle Linux 7 with UEK Release 4 or later
  • Docker 1.12.6
  • NFS version 4.0

The installation and configuration of the required Oracle Linux components OL7 with UEK4, Docker and NFS is very well described in the “Using Oracle…” guide. Please take a look in the guide, it’s straight forward. The OSCSA installer does not start when the requirements are not fullfilled. 

My Test Environment

OSCSA breitenbach.martinberger.local Oracle Linux 7.4 100GB Storage
Database Server zuchwil.martinberger.local Oracle Linux 7.4 Oracle RDBMS 12.1.0.2
Traditional Cloud Account cloud.oracle.com Zone EM2 Oracle Cloud Infrastructure Object Storage Classic

Firewall

Port 32771 (Appliance Web Interface) ,  32772 (NFS) and 32773 (REST) have to be opened on the appliance machine. If you don’t want to use these port numbers, you can set them during the installation process. Execute as user root:

# firewall-cmd --permanent --zone=public --add-port=32771/tcp
# firewall-cmd --permanent --zone=public --add-port=32772/tcp
# firewall-cmd --permanent --zone=public --add-port=32772/tcp
# firewall-cmd --reload

File Content

All installation steps are executed as OS user root. The Oracle Storage Cloud Software Appliance Software Release 16.3.1.3 is available on my local machine in folder /stage. The extracted OSCSA file contains a file called OSCSA_GATEWAY_README.txt where you can get more information about the installation and configuration possibilities like proxy etc.

# tar xvfz oscsa-OnPrem-16.3.1.3.0.tar.gz
./
./oscsa_gw:1.3.0.tar
./oscsa
./oscsa-install.sh
./oscsa-config.sh
./helper-install-oscsa.sh
./oscsaOSCSA_GATEWAY_README.txt-control.sh
./
./OSCSA_RELEASE_NOTES.txt

Installation

The installation starts by executing oscsa-install.sh. I have added the parameter -a = advanced so I am able to set ports for NFS, Administrative Web Interface and REST. Oracle recommends for the cache storage a minimal size. I have ignored that for my test environment.

# ./oscsa-install.sh -a
Checking that docker is installed and using the correct version
Pass found docker version Docker version 17.06.2-ol, build d02b7ab

*************************************
Checking host prerequisites
*************************************

Detected linux operating system
Checking kernel version
Pass kernel version 4.1.12-94.3.9.el7uek.x86_64 found
Checking NFS version
Pass found NFS version 4

*************************************
All prerequisites have been met
*************************************



*************************************
Begin install
*************************************

Enter the install location press enter for default (/opt/oscsa_gateway/) :

Installing to destination /opt/oscsa_gateway/

Copied install scripts
Copied OSCSA image
Starting configuration script
Enter the path for OSCSA data storage
/oscsa/data
WARNING: OSCSA MAY NOT RUN PROPERLY, LOW DISK SPACE, PROVISION ADDITIONAL STORAGE SPACE FOR VOLUME /oscsa/data, FREESPACE 62 GiB, RECOMMENDED MINIMUM SPACE FOR CACHE: 300 GiB,
TOTAL RECOMMENDED MINIMUM SPACE FOR VOLUME /oscsa/data: 300 GiB.
PROVISION A VOLUME DEDICATED TO OSCSA WITH ADDITIONAL DISK SPACE.

TO PROCEED, TYPE "CONFIRM" OR PRESS ENTER TO STOP THE INSTALL.
CONFIRM
Enter the path for OSCSA metadata storage
/oscsa/metadata
WARNING: OSCSA MAY NOT RUN PROPERLY, LOW DISK SPACE, PROVISION ADDITIONAL STORAGE SPACE FOR VOLUME /oscsa/metadata, FREESPACE 62 GiB, RECOMMENDED MINIMUM SPACE FOR METADATA: 80 GiB,
TOTAL RECOMMENDED MINIMUM SPACE FOR VOLUME /oscsa/metadata: 380 GiB.
PROVISION A VOLUME DEDICATED TO OSCSA WITH ADDITIONAL DISK SPACE.

TO PROCEED, TYPE "CONFIRM" OR PRESS ENTER TO STOP THE INSTALL.
CONFIRM
Enter the path for OSCSA log storage
/oscsa/log
WARNING: OSCSA MAY NOT RUN PROPERLY, LOW DISK SPACE, PROVISION ADDITIONAL STORAGE SPACE FOR VOLUME /oscsa/log, FREESPACE 62 GiB, RECOMMENDED MINIMUM SPACE FOR LOG: 20 GiB,
TOTAL RECOMMENDED MINIMUM SPACE FOR VOLUME /oscsa/log: 400 GiB.
PROVISION A VOLUME DEDICATED TO OSCSA WITH ADDITIONAL DISK SPACE.

TO PROCEED, TYPE "CONFIRM" OR PRESS ENTER TO STOP THE INSTALL.
COFIRM
Invalid input please type CONFIRM to proceed or press ENTER to stop the install.
CONFIRM
Enter the docker network mode (host or bridge), Hit <Enter> for the default bridge mode.

Enter the host port to use for the Administrative Web Interface. Hit <Enter> to use dynamic port mapping
32771
Enter the host port to use for NFS access. Hit <Enter> to use dynamic port mapping
32772
Enter the host port to use for the optional HTTP REST service. Hit <Enter> to use dynamic port mapping
32773
Writing configuration
Importing image
d0c367ad7015: Loading layer [==================================================>] 233.7MB/233.7MB
...
a891fa34560d: Loading layer [==================================================>] 2.048kB/2.048kB
Loaded image: oscsa_gw:1.3.0
The image oraclelinux:7.3 already exists, renaming the old one with ID sha256:d42df3cd808c9b697c9fdd36909c13cd8657604fe1ef9f1a145ec45e788228e5 to empty string
Loaded image: oraclelinux:7.3
Please run 'oscsa up' to start the software appliance

*************************************
For additional details, please see (/opt/oscsa_gateway/OSCSA_GATEWAY_README.txt) file
*************************************

Appliance Start

Now the Oracle Storage Cloud Software Appliance can be started. A server reboot is not problem. The docker image will be started after server startup automatically.

# oscsa up
Creating OSCSA Volume with args -v /oscsa/data:/usr/share/oracle/ -v /oscsa/metadata:/usr/share/oracle/system/ -v /oscsa/log:/var/log/gateway
Checking available space on host volumes
WARNING: OSCSA MAY NOT RUN PROPERLY, LOW DISK SPACE, PROVISION ADDITIONAL STORAGE SPACE FOR VOLUME /dev/mapper/ol-root, FREESPACE 62 GiB, RECOMMENDED MINIMUM SPACE FOR LOG: 10 GiB,
TOTAL RECOMMENDED MINIMUM SPACE FOR VOLUME /dev/mapper/ol-root: 200 GiB.
PROVISION A VOLUME DEDICATED TO OSCSA WITH ADDITIONAL DISK SPACE.

WARNING: OSCSA MAY NOT RUN PROPERLY, LOW DISK SPACE, PROVISION ADDITIONAL STORAGE SPACE FOR VOLUME /dev/mapper/ol-root, FREESPACE 62 GiB, RECOMMENDED MINIMUM SPACE FOR CACHE: 150 GiB,
TOTAL RECOMMENDED MINIMUM SPACE FOR VOLUME /dev/mapper/ol-root: 200 GiB.
PROVISION A VOLUME DEDICATED TO OSCSA WITH ADDITIONAL DISK SPACE.

WARNING: OSCSA MAY NOT RUN PROPERLY, LOW DISK SPACE, PROVISION ADDITIONAL STORAGE SPACE FOR VOLUME /dev/mapper/ol-root, FREESPACE 62 GiB, RECOMMENDED MINIMUM SPACE FOR METADATA: 40 GiB,
TOTAL RECOMMENDED MINIMUM SPACE FOR VOLUME /dev/mapper/ol-root: 200 GiB.
PROVISION A VOLUME DEDICATED TO OSCSA WITH ADDITIONAL DISK SPACE.

Applying configuration file to container
Starting OSCSA [oscsa_gw:1.3.0]
Management Console: https://breitenbach.martinberger.local:32771
If you have already configured an OSCSA FileSystem via the Management Console,
you can access the NFS share using the following port.

NFS Port: 32772

Example: mount -t nfs -o vers=4,port=32772 breitenbach.martinberger.local:/<OSCSA FileSystem name> /local_mount_point

 

Configure a OSCSA FileSystem in the Appliance Web Interface

In this step, the OSCSA will be connected to the Oracle Cloud. At the moment, no <OSCSA FileSystem name> is configured. An OSCSA  filesystem is like a namespace containing a set of data. Now we can log in into the Appliance Web Interface to create our first Object Storage filesystem. URL for the interface is https://<servername>:<port>. The port for the interface was set during the installation process.  

For the connection to the cloud, you need to know your Identity Domain, Username, Password and REST Storage Endpoint URL. The FileSystem name will be reused later for the NFS mount.

Create a FileSystem called OCIClassicStorage01

Enter Domain, Username, Password and REST Storage Endpoint URL. Below this screenshot you can see where you find the URL in your Traditional Cloud Account.

Here you can see the REST URL.

Click on Validate

If the account informations are verified, you are able to enable compression and encryption. I have enable encryption here. Click Save.

The OSCSA storage is now ready to synchronize with the cloud. Click Connect.

Now you can see the the connection between the Oracle Storage Cloud Software Appliance and the Oracle Cloud Infrastructure Object Storage Service is ready.

In the Traditonal Cloud Account in the Storage Classic dashboard is a new object storage filesystem available.

Connect the Database Server to the Oracle Storage Cloud Software Appliance

Let’s connect the database server to the OSCSA to store data in the Object Storage Service. First we check again on the OSCSA server if the service is running.

# oscsa info
Management Console: https://breitenbach.martinberger.local:32771
If you have already configured an OSCSA FileSystem via the Management Console,
you can access the NFS share using the following port.

On the database server a new mountpoint will be created.

# mkdir /mnt/oscsa

We mount the OSCSA with NFS v4 to the local server. This entry can be added later to autofs or whatever you use to automatically mount an NFS filesystem. Permission of the mountpoint is drwxrwxrwx – so everybody can write into it at the moment.

# mount -t nfs -o vers=4,port=32772 breitenbach.martinberger.local:/OCIClassicStorage01 /mnt/oscsa

Check.

# df -m | grep oscsa
breitenbach.martinberger.local:/OCIClassicStorage01 52428800 1 52428800 1% /mnt/oscsa

Execute an Oracle RMAN Backup to the Cloud

A new subdirectory on the NFS mountpoint will be created.

# mkdir -p /mnt/oscsa/backup/JSF01

Start Oracle Recovery Manager RMAN database backup.

$ rman target=/

RMAN> BACKUP AS BACKUPSET DATABASE PLUS ARCHIVELOG FORMAT '/mnt/oscsa/backup/JSF01/backupsetJSF01%U.bkp';

The backup files are created locally in the specified mountpoint directory.

$ ll
total 0
drwxr-xr-x. 2 oracle oinstall 0 Nov 8 15:06 .
drwxr-xr-x. 2 oracle oinstall 0 Nov 8 09:46 ..
-rw-r-----. 1 oracle oinstall 87519744 Nov 8 15:05 backupsetJSF01.bkp
-rw-r-----. 1 oracle oinstall 207000576 Nov 8 10:11 backupsetJSF0178sj1s75_1_1.bkp
-rw-r-----. 1 oracle oinstall 134822912 Nov 8 10:11 backupsetJSF0179sj1s76_1_1.bkp
-rw-r-----. 1 oracle oinstall 6382592 Nov 8 10:11 backupsetJSF017asj1s77_1_1.bkp
-rw-r-----. 1 oracle oinstall 10240 Nov 8 10:11 backupsetJSF017esj1s7d_1_1.bkp
-rw-r-----. 1 oracle oinstall 87186432 Nov 8 15:06 backupsetJSF017isj2dg5_1_1.bkp
-rw-r-----. 1 oracle oinstall 84397568 Nov 8 15:06 backupsetJSF017jsj2dg6_1_1.bkp
-rw-r-----. 1 oracle oinstall 7680 Nov 8 15:06 backupsetJSF017nsj2dgd_1_1.bkp
-rw-r-----. 1 oracle oinstall 18661376 Nov 8 09:54 controlfileJSF01.ctl

At the moment where the backup sets are arrived on the mountpoint, the OSCSA begins to encrypt  (this was my selections during filesystem creation) and transfer them into the Oracle Cloud. This is visible in the Appliance Web Interface.

Now the files are uploaded into the Oracle Cloud. This can be verified in the Traditional Cloud Account in the specific filesystem. The files are encrypted and have file names like 10101-v1, 10103-v1 etc.

 

Anything else?

Sure, this was just a basic overview how to configure the on-premises Oracle Storage Cloud Software Appliance. There are many more features like retrieve data, cloud access via command line, preserve filesystem cache, create directory permissions, set user permissons, monitor the appliance, backup the appliance, encryption key handling, use the archive storage and so on which are worth to spend more time for investigation in the future.

Summary

The Oracle Storage Cloud Software Appliance is a nice piece of software which helps you to use the Oracle Cloud Infrastructure Object Storage Service. The appliance is easy to install and configure, local encryption is possible and the documentation is very good. Database Backups and Database Export a perfect candidates for this service. The price is hot, $0.0204 per GB for the first TB, and $0.0201 per GB for the next 49TB.

Thumbs up!

Install and Configure Oracle Application Express with Oracle REST Data Services and Apache Tomcat

In this article I will show you how you can install and configure Oracle Application Express (APEX) and the Oracle REST Data Service (ORDS), which is running on an Apache Tomcat application server. In previous installations I used the Oracle HTTP server and the extenstion mod_plsq. But this does not work anymore with the newest Oracle HTTP server version. In the Oracle Application Express Installation Guide is written:

mod_plsql is deprecated as of Oracle HTTP Server 12c (12.1.3). For more information, please see My Oracle Support Note 1576588.1. Oracle recommends using Oracle REST Data Services instead.

Oracle REST Data Service is the future – so let’s go to the future.

Installation Steps

  1. Installation and Configuration Oracle Application Express 5.1.1
  2. Installation and Configuration Apache Tomcat 8.5.14
  3. Installation and Configuration Oracle Rest Data Service ORDS 3.0.9

My new architecture what I want to build looks like as described on this picture.  

Source: http://www.oracle.com/technetwork/developer-tools/apex/application-express/apex-deploy-installation-1878444.html

My Environment
  • Red Hat Enterprise Linux Server Release 7.3 – server hostname is neuendorf.jurasuedfuss.coom
  • Oracle Database 12c Standard Edition Release 12.2.0.1.0 – database service name is APEXORDS.jurasuedfuss.com
  • OS Firewall is open for Port 8080
OS Users

I work with two OS users to separate RDBMS and application tasks:

  • oracle – Oracle RDBMS / Listener / Oracle Application Express
  • tomcat – Apache Tomcat / ORDS / Java Development Kit JDK 1.8
Directories
  • Oracle Software: /u01/app/oracle
  • Apache Tomcat / ORDS / JDK: /u01/app/tomcat

1. Installation and Configuration Oracle Application Express 5.1.1 – OS User: oracle

I have downloaded Oracle Application Express here: http://www.oracle.com/technetwork/developer-tools/apex/downloads/download-085147.html . The extracted software is located on the server in  the /tmp directory. For the APEX data I have created a new tablespace called APEX too.

Go to the software location:

[oracle@neuendorf ~]$ cd /tmp/apex

Login into the database as SYSDBA:

[oracle@neuendorf ~]$ . oraenv
ORACLE_SID = [oracle] ? APEXORDS
The Oracle base has been set to /u01/app/oracle

[oracle@neuendorf ~]$ sqlplus / as sysdba

Execute the installation script:

SQL> @apexins apex apex temp /i/

Set password for ADMIN user / Workspace INTERNAL:

SQL> @apxchpwd.sql

Configure database RESTful services – the passwords for the new created users APEX_LISTENER and APEX_REST_PUBLIC_USER will be used later for the ORDS setup:

SQL> @apex_rest_config.sql

Set password for the APEX_PUBLIC_USER and unlock the account:

SQL> ALTER USER apex_public_user IDENTIFIED BY  <MY_APEX_PUBLIC_USER_PASSWORD> ACCOUNT UNLOCK;

To avoid the password expiration for the APEX_PUBLIC_USER, I have created a  new profile especially for this user with unlimited password lifetime:

SQL> CREATE PROFILE upd_password_life_time_unlimited LIMIT PASSWORD_LIFE_TIME UNLIMITED;
SQL> ALTER USER apex_public_user PROFILE upd_password_life_time_unlimited;

Allow other hosts than the localhost to use the Oracle Application Express installation:

SQL> BEGIN
2     DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
3          host => '*',
4          ace => xs$ace_type(privilege_list => xs$name_list('connect'),
5          principal_name => 'apex_050100',
6          principal_type => xs_acl.ptype_db));
7 END;
8 /

2. Installation and Configuration Apache Tomcat 8.5.14 – OS User: tomcat

Create directory :

[tomcat@neuendorf ~]$ mkdir /u01/app/tomcat

Go to directory and extract software  form /tmp:

[tomcat@neuendorf ~]$ cd /u01/app/tomcat/
[tomcat@neuendorf ~]$ tar xvfz /tmp/jdk-8u131-linux-x64.tar.gz
[tomcat@neuendorf ~]$ tar xvfz /tmp/apache-tomcat-8.5.14.tar.gz

Two new directories for Apache Tomcat and JDK are created:

[tomcat@neuendorf tomcat]$ ll
total 8
drwxrwxr-x. 9 tomcat tomcat 4096 May 9 12:29 apache-tomcat-8.5.14
drwxr-xr-x. 8 tomcat tomcat 4096 Mar 15 09:35 jdk1.8.0_131

To simplify the management with the Apache Tomcat application server, I have added environment variables to the .bash_profile:

# Tomcat Environment Variables
JAVA_HOME=/u01/app/tomcat/jdk1.8.0_131
CATALINA_HOME=/u01/app/tomcat/apache-tomcat-8.5.14
CATALINA_BASE=$CATALINA_HOME

export JAVA_HOME
export CATALINA_HOME
export CATALINA_BASE

Startup Tomcat – after the re-login as OS user tomcat the application server can be started by using the environment variable $CATALINA_HOME.

[tomcat@neuendorf ~]$ $CATALINA_HOME/bin/startup.sh
Using CATALINA_BASE: /u01/app/tomcat/apache-tomcat-8.5.14
Using CATALINA_HOME: /u01/app/tomcat/apache-tomcat-8.5.14
Using CATALINA_TMPDIR: /u01/app/tomcat/apache-tomcat-8.5.14/temp
Using JRE_HOME: /u01/app/tomcat/jdk1.8.0_131
Using CLASSPATH: /u01/app/tomcat/apache-tomcat-8.5.14/bin/bootstrap.jar:/u01/app/tomcat/apache-tomcat-8.5.14/bin/tomcat-juli.jar
Tomcat started.

Verify on command line level if tomcat has started, for example with CURL – HTTP 200 means that the response is OK:

[tomcat@neuendorf tomcat]$ curl -I http://localhost:8080
HTTP/1.1 200
Content-Type: text/html;charset=UTF-8
Transfer-Encoding: chunked
Date: Tue, 09 May 2017 12:10:11 GMT

Browser Verification – http://neuendorf.jurasuedfuss.com:

 

Shutdown Tomcat:

[tomcat@neuendorf ~]$ $CATALINA_HOME/bin/shutdown.sh

Start- / Stop Runlevel Script:

To automate the start/stop – we use a runlevel script. The script has to be created as OS user root. In one of the first lines, I have set a sleep command to be sure that the database is available before the application server starts.

[root@neuendorf ~]# vi /etc/init.d/tomcat

Content:

#!/bin/bash
#
# tomcat 
#
# chkconfig: 
# description: Start up the Tomcat servlet engine.

# Source function library.
. /etc/init.d/functions

# Sleep 20 seconds until database is started sucessfully
sleep 20

RETVAL=$?
CATALINA_HOME="/u01/app/tomcat/apache-tomcat-8.5.14"

case "$1" in
start)
if [ -f $CATALINA_HOME/bin/startup.sh ];
then
echo $"Starting Tomcat"
/bin/su tomcat $CATALINA_HOME/bin/startup.sh
fi
;;
stop)
if [ -f $CATALINA_HOME/bin/shutdown.sh ];
then
echo $"Stopping Tomcat"
/bin/su tomcat $CATALINA_HOME/bin/shutdown.sh
fi
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
;;
esac

exit $RETVAL

Add the script to the runlevel environment level 3 and 5:

[root@neuendorf ~]# chmod 755 /etc/init.d/tomcat
[root@neuendorf ~]# cd /etc/rc3.d
[root@neuendorf ~]# ln -s /etc/init.d/tomcat S99tomcat

[root@neuendorf ~]# cd /etc/rc5.d
[root@neuendorf ~]# ln -s /etc/init.d/tomcat S99tomcat

3. Installation and Configuration Oracle Rest Data Service ORDS 3.0.9 – OS User: tomcat

Create ORDS installation directory:

[tomcat@neuendorf tomcat]$ cd /u01/app/tomcat/
[tomcat@neuendorf tomcat]$ mkdir ords.3.0.9
[tomcat@neuendorf tomcat]$ cd ords.3.0.9

Extract ORDS from /tmp directory:

[tomcat@neuendorf tomcat]$ unzip /tmp/ords.3.0.9.348.07.16.zip

Verify directory content:

[tomcat@neuendorf tomcat]$ cd /u01/app/tomcat/ords.3.0.9
[tomcat@neuendorf ords.3.0.9]$ ll
total 48332
drwxrwxr-x. 3 tomcat tomcat 17 May 9 12:40 conf
drwxr-xr-x. 3 tomcat tomcat 20 Dec 13 07:16 docs
drwxr-xr-x. 6 tomcat tomcat 81 Dec 13 07:21 examples
drwxr-xr-x. 2 tomcat tomcat 4096 May 9 12:42 logs
-rw-r--r--. 1 tomcat tomcat 49442163 May 9 12:40 ords.war
drwxr-xr-x. 2 tomcat tomcat 35 May 9 12:40 params
-rw-r--r--. 1 tomcat tomcat 43605 Dec 13 07:21 readme.html

Create ORDS directory and edit the database configuration template – set hostname and database service name:

[tomcat@neuendorf tomcat]$ mkdir /u01/app/tomcat/ords.3.0.9/conf
[tomcat@neuendorf tomcat]$ vi /u01/app/tomcat/ords.3.0.9/params/ords_params.properties

Content of my ords_params.properties file:

db.hostname=neuendorf
db.port=1521
db.servicename=APEXORDS.jurasuedfuss.com
db.username=APEX_PUBLIC_USER
migrate.apex.rest=false
rest.services.apex.add=
rest.services.ords.add=true
schema.tablespace.default=APEX
schema.tablespace.temp=TEMP
user.tablespace.default=USERS
user.tablespace.temp=TEMP

Set Oracle REST Database Service ORDS configuration directory:

[tomcat@neuendorf tomcat]$ cd /u01/app/tomcat/ords.3.0.9/
[tomcat@neuendorf ords.3.0.9]$ $JAVA_HOME/bin/java -jar ords.war configdir /u01/app/tomcat/ords.3.0.9/conf
May 09, 2017 12:33:54 PM
INFO: Set config.dir to /u01/app/tomcat/ords.3.0.9/conf in: /u01/app/tomcat/ords.3.0.9/ords.war

Install Oracle REST Database Service ORDS:

You will be asked for a new password for the database user ORDS_PUBLIC_USER (user will be created by this script), for the already existing users APEX_LISTENER and APEX_REST_PUBLIC_USER and for the SYS password. For ORDS metadata, I have created a new tablespace called ORDS.

The values for database server, hostname and the service name are taken from the configuration file ords_params.properties. Do not start ORDS in standalone mode at the end of the configuration.

[tomcat@neuendorf ords.3.0.9]$ $JAVA_HOME/bin/java -jar ords.war install advanced
Enter the name of the database server [neuendorf]: <ENTER>
Enter the database listen port [1521]: <ENTER>
Enter 1 to specify the database service name, or 2 to specify the database SID [1]: <ENTER>
Enter the database service name [ORDSAPEX.jurasuedfuss.com]: <ENTER>
Enter 1 if you want to verify/install Oracle REST Data Services schema or 2 to skip this step [1]: <ENTER>
Enter the database password for ORDS_PUBLIC_USER: <MY_ORDS_PUBLIC_USER_PASSWORD> <ENTER>
Confirm password:
Please login with SYSDBA privileges to verify Oracle REST Data Services schema.

Enter the username with SYSDBA privileges to verify the installation [SYS]: <ENTER>
Enter the database password for SYS: <MY_SYS_PASSWORD> <ENTER>
Confirm password:
Enter the default tablespace for ORDS_METADATA [APEX]: ORDS <ENTER>
Enter the temporary tablespace for ORDS_METADATA [TEMP]: <ENTER>
Enter the default tablespace for ORDS_PUBLIC_USER [USERS]:ORDS <ENTER>
Enter the temporary tablespace for ORDS_PUBLIC_USER [TEMP]: <ENTER>
Enter 1 if you want to use PL/SQL Gateway or 2 to skip this step.
If using Oracle Application Express or migrating from mod_plsql then you must enter 1 [1]: <ENTER>
Enter the PL/SQL Gateway database user name [APEX_PUBLIC_USER]: <ENTER>
Enter the database password for APEX_PUBLIC_USER: <MY_APEX_PUBLIC_USER_PASSWORD> <ENTER>
Confirm password: <MY_APEX_PUBLIC_USER_PASSWORD> <ENTER>
Enter 1 to specify passwords for Application Express RESTful Services database users (APEX_LISTENER, APEX_REST_PUBLIC_USER) or 2 to skip this step [1]: <ENTER>
Enter the database password for APEX_LISTENER: <MY_APEX_LISTENER_PASSWORD> <ENTER>
Confirm password: <MY_APEX_LISTENER_PASSWORD> <ENTER>
Enter the database password for APEX_REST_PUBLIC_USER: <MY_APEX_REST_PUBLIC_USER_PASSWORD> <ENTER>
Confirm password: <MY_APEX_REST_PUBLIC_USER_PASSWORD> <ENTER>
May 09, 2017 11:18:27 AM
INFO: Updated configurations: defaults, apex, apex_pu, apex_al, apex_rt
Installing Oracle REST Data Services version 3.0.9.348.07.16
... Log file written to /u01/app/tomcat/ords.3.0.9/logs/ords_install_core_2017-05-09_111827_00102.log
... Verified database prerequisites
... Created Oracle REST Data Services schema
... Created Oracle REST Data Services proxy user
... Granted privileges to Oracle REST Data Services
... Created Oracle REST Data Services database objects
... Log file written to /u01/app/tomcat/ords.3.0.9/logs/ords_install_datamodel_2017-05-09_111843_00674.log
Completed installation for Oracle REST Data Services version 3.0.9.348.07.16. Elapsed time: 00:00:18.80

Enter 1 if you wish to start in standalone mode or 2 to exit [1]: <2> <ENTER>

You can see the encrypted passwords and the selected tablespaces in the configuration file ords_params.properties:

[tomcat@neuendorf tomcat]$ cat /u01/app/tomcat/ords.3.0.9/params/ords_params.properties

#Tue May 09 12:41:57 CEST 2017
db.hostname=neuendorf
db.password=@057AF00D1B3F13CCECCD71BCF1E0AD259AA183443E64B284CE
db.port=1521
db.servicename=APEXORDS.jurasuedfuss.com
db.username=APEX_PUBLIC_USER
migrate.apex.rest=false
plsql.gateway.add=true
rest.services.apex.add=true
rest.services.ords.add=true
schema.tablespace.default=ORDS
schema.tablespace.temp=TEMP
user.apex.listener.password=@05B9EEC26803C78359021659CB0EEFE0175C898A5D0404FD44
user.apex.restpublic.password=@05F57FA4BB374FE48E6452F1AD3E36FC5BD6B178B18952C791
user.public.password=@05B3277F27BC54402B72DE458C49A4188F33EBDCA7A021DFC3
user.tablespace.default=ORDS
user.tablespace.temp=TEMP

Optimize the database connection settings – add these lines to the apex.xml configuration file:

[tomcat@neuendorf tomcat]$ vi /u01/app/tomcat/ords.3.0.9/conf/ords/conf/apex.xml

<entry key="jdbc.InitialLimit">15</entry> 
<entry key="jdbc.MaxLimit">50</entry> 
<entry key="jdbc.MinLimit">15</entry>

Prepare the application server directory for the Oracle Application Express images

[tomcat@neuendorf tomcat]$ mkdir $CATALINA_HOME/webapps/i/
[tomcat@neuendorf tomcat]$cp -R /tmp/apex/images/* $CATALINA_HOME/webapps/i/

Copy the ORDS application ords.war to the Apache Tomcat:

[tomcat@neuendorf tomcat]$ cd /u01/app/tomcat/ords.3.0.9
[tomcat@neuendorf tomcat]$ cp ords.war $CATALINA_HOME/webapps/

Startup the application server:

[tomcat@neuendorf ~]$ $CATALINA_HOME/bin/startup.sh
Using CATALINA_BASE: /u01/app/tomcat/apache-tomcat-8.5.14
Using CATALINA_HOME: /u01/app/tomcat/apache-tomcat-8.5.14
Using CATALINA_TMPDIR: /u01/app/tomcat/apache-tomcat-8.5.14/temp
Using JRE_HOME: /u01/app/tomcat/jdk1.8.0_131
Using CLASSPATH: /u01/app/tomcat/apache-tomcat-8.5.14/bin/bootstrap.jar:/u01/app/tomcat/apache-tomcat-8.5.14/bin/tomcat-juli.jar
Tomcat started.

Login into  Oracle Application Express – add /ords at the end of the application server URL like http://neuendorf.jurasuedfuss.com:8080/ords:

That’s it – have fun with the Oracle Application Express, Oracle REST Data Services and Tomcat :-). In the next post I will show you how you can secure your installation by change to https/SSL.

Manuals:

Installing Application Express and Configuring Oracle REST Data Services

Tomcat Web Application Deployment

Oracle Application Express Installation Overview