Oracle Tools

Easy Database Migration to Oracle Cloud Infrastructure OCI by Creating a Backup in the Cloud

Oracle has provided an updated OCI command line toolset with a new and easy method to migrate an on-premises database into the Oracle Cloud Infrastructure as DBaaS. According the document here, I have tried it out – and it works:

https://docs.cloud.oracle.com/iaas/Content/Database/Tasks/mig-onprembackup.htm

My Test Setup

  • Oracle 18c Enterprise Edition with SID=ORA18
  • Single Tenant Architecture
  • Oracle Linux 7.4
  • non TDE – Attention: non TDE on-premises data stays unencrypted in the cloud !!!

Database and Server Prerequisites

The OCI CLI Directory 

OCI CLI and opc_install.jar plus the .pem file have to be in the same directory.

Set Environment Variables

Execute the Database Migration Job

In the background:

  1. The script installs and configures temporarily the OPC Backup Module
  2. A RMAN backup job will be started with encrypted backups into the cloud on ObjectStorage
  3. After the successful backup, the temporarily created files are removed

Created  Files for Backup and Transfer and the RMAN Logfile

Excerpt from the rman.log

Well known from the Oracle Cloud Backup module .

 

 

RMAN List Backup – Excerpt and Verification

The RMAN backup is encrypted by default.

OCI Cloud Console the Backup called testimport is available to create a new DaBaaS Database

Listed as Standalone Backup.

Now we create a new database based on the Standalon Backup.

Enter the RMAN backup password from the CLI job.

The database will be re-created now.

CLI Error Messages

Summary

The new CLI script makes OCI migrations much easier. than before. Depending on the database size and your network bandwith, it works smart and fast. Take time to read the manual carefully to fullfill the prerequisites,

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:

Login into the database as SYSDBA:

Execute the installation script:

Set password for ADMIN user / Workspace INTERNAL:

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:

Set password for the APEX_PUBLIC_USER and unlock the account:

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

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

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

Create directory :

Go to directory and extract software  form /tmp:

Two new directories for Apache Tomcat and JDK are created:

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

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

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

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

 

Shutdown Tomcat:

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.

Content:

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

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

Create ORDS installation directory:

Extract ORDS from /tmp directory:

Verify directory content:

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

Content of my ords_params.properties file:

Set Oracle REST Database Service ORDS configuration directory:

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.

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

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

Prepare the application server directory for the Oracle Application Express images

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

Startup the application server:

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

DATABASE PATCH SET UPDATE 12.1.0.2.170117 apply fails – catconInit failed, exiting

Last weekend was patchday. The goal was to apply the patch 24732082 (DATABASE PATCH SET UPDATE 12.1.0.2.170117) to a 12.1.0.2 database on AIX. The OPatch precheck returned no error and OPatch apply was ok. The problem was the post step, the datapatch command failed with the message catconInit failed, exiting.

The solution was described in this My Oracle Support Note: Datapatch fails with „catconInit: database is not open on the default instance“ (Doc ID 2003488.1)

In the glogin.sql file  located in ORACLE_HOME/sqlplus/admin were two lines:

After I have commented out these lines, everything runs ok.

Summary: Two small lines, a big impact.