Docker, Oracle 12c and Persistent Storage

Introduction

If you have read my previous posts on Docker you may have already installed Docker and have an Oracle 12c database running in a Docker container, if not you may want to read my first post on Docker – Running Oracle 12.2.01 on Docker

However, since I wrote the above post Oracle have published Docker images for many of their products, these can be found at the Docker Store. The Oracle images on the Docker Store are not just a great resource and help accelerate adoption, but are also certified and supported by Oracle.

Before continuing with this post you need to check-out my posts on using the new Oracle 12c Docker images and the Pure Storage Docker plugin as this post can be considered the ‘Return of the Jedi’  in the series.

Oracle 12c with Persistent Storage

In this post I will create a Docker container running an Oracle 12c database called PSTG using 4 mount points /u01, /u02, /u03 & /u04 mounted from a Pure Storage FlashArray.

Database environment Layout

/u01 – OraInventory and Oracle 12c product directories
/u02 – Oracle Datafile
/u03 – Fast Recovery Area
/u04 – RedoLog files.

The 4 mount points will all be using persistent All Flash Storage providing low latency performance, space efficient crash consistent snapshots and requiring no local storage.

First, confirm that you have installed the Oracle 12c image using the the following:

$ docker images list

docker_imagesYou should be able see the store/oracle/database-enterprise 12.1.0.2 Docker Image, if missing you need to read my previous post.

Ok, copy the db_env.dat file created in the previous post to a new environment file $ORACLE_SID_env.dat and update database name and password e.g.

####################################################################
## Copyright(c) Oracle Corporation 1998,2016. All rights reserved.##
##                                                                ##
##                   Docker OL7 db12c dat file                    ##
##                                                                ##
####################################################################
##------------------------------------------------------------------
## Specify the basic DB parameters
##------------------------------------------------------------------
## db sid (name)
## default : ORCL
## cannot be longer than 8 characters
DB_SID=PSTG
## db passwd
## default : Oracle
DB_PASSWD=Oracle
## db domain
## default : localdomain
DB_DOMAIN=localdomain
## db bundle
## default : basic
## valid : basic / high / extreme 
## (high and extreme are only available for enterprise edition)
DB_BUNDLE=basic
## end

We will now create the 4 volumes using the docker volume create command and Pure Storage Docker plug-in providing name, size and label.

 docker volume create --driver=pure --opt size=20GB --name=PSTG-u01 --label=product
 docker volume create --driver=pure --opt size=100GB --name=PSTG-u02 --label=oradata
 docker volume create --driver=pure --opt size=200GB --name=PSTG-u03 --label=fast_recovery_area
 docker volume create --driver=pure --opt size=10GB --name=PSTG-u04 --label=redo

We can use the docker volume ls command with a filter to list the 4 database volumes we are interested in using the following syntax

$ docker volume ls -f name=environment

docker_vols

The Pure Storage Docker Plugin also supports docker volume inspect, from here we can see the labels which we defined earlier, great way to see where and what the mount is being used for.

$ docker volume inspect volume name

docker_inspect.png

Now that we have installed the Oracle 12c Docker image and created the 4 volumes we are ready to create our Oracle 12c container using the docker run command with -v to present our newly volumes to our container.

docker run -d –env-file ./PSTG_env.dat -p 1527:1521 -p 5507:5500 -it –name PSTG -v PSTG-u01:/u01 -v PSTG-u02:/u02 -v PSTG-u03:/u03 -v PSTG-u04:/u04 –shm-size=”8g” store/oracle/database-enterprise:12.1.0.2

Progress can be monitored using the docker logs command.

docker logs -f PSTG

Once the container has started we can now connect to it and check out our Oracle 12c environment using the docker exec command and container name

docker exec -it PSTG /bin/bash

From within our Oracle 12c ‘PSTG’ container we can see our Pure Storage volumes (/u01, /u02, /u03 & /u04) and the sizes we specified.

df.png

Now we are in our Docker container we can use SQLPlus to see data file locations, instance name, docker assigned hostname etc…

sqlplus

instance

Oracle 12c Online Database Move Datafile

After watching an Oracle R12c new features presentation at a recent conference somebody asked me what was my favourite Oracle R12c database feature, for me it was easy has to be ‘ALTER DATABASE MOVE DATAFILE’

Prior to Oracle 12c moving non-ASM data files required taking data files ‘offline’ and negotiating an outage with the business, with Oracle 12c this is no longer the case.

Storage Maintenance

You can use the ALTER DATABASE MOVE DATAFILE to move a data file to different location, disk or storage system. This provides a simple Online method of migrating to a new storage platform.

Online_Data_Move

The Oracle ALTER DATABASE MOVE DATAFILE does all the hard work for you including renaming or relocating the data file at operating system level and changing pointers in the Control Files.

Oracle also provide a way of monitor progress by using the V$SESSION_LONGOPS view, the reported bytes done will increment until the move is completed.

SQL> select file_name, tablespace_name from dba_data_files;

TABLESPACE_NAME      FILE_NAME
——————– ———————————————————–

TEST                /u01/app/oracle/oradata/PSTG/datafile/test.dbf

SQL> ALTER DATABASE MOVE DATAFILE ‘/u01/app/oracle/oradata/PSTG/datafile/test.dbf’ TO ‘/u01/app/oracle/oradata/PSTG/datafile/tester.dbf’;

SQL> select to_char(start_time,’DD-MON-YY hh24:mi:ss’),  timestamp, time_remaining, elapsed_seconds, message from V$SESSION_LONGOPS;

02-JUN-17 10:51:44   0 158
Online data file move: data file 4: 10737418240 out of 10737418240 bytes done

SQL>  select tablespace_name, file_name from dba_data_files;

TABLESPACE_NAME      FILE_NAME
——————– ———————————————————–

TEST               /u01/app/oracle/oradata/PSTG/datafile/tester.dbf

Please note before you begin make sure you have enough space on the source and target storage platforms as Oracle will allocate the required storage space on the target system and will not free any space up on the source until the move is complete.

If you specify the ‘KEEP’ parameter Oracle will copy the data file to the new location and retain the old datafile in the original location, it will be no longer reference in the control files and can be removed when no longer required.

SQL>  select tablespace_name, file_name from dba_data_files;

TABLESPACE_NAME      FILE_NAME
——————– ———————————————————–

TEST     /u01/app/oracle/oradata/PSTG/datafile/tester.dbf

SQL> ALTER DATABASE MOVE DATAFILE ‘/u01/app/oracle/oradata/PSTG/datafile/tester.dbf’ TO ‘/u01/app/oracle/oradata/PSTG/datafile/test.dbf’ KEEP;

Database altered.

SQL> select tablespace_name, file_name from dba_data_files;

TABLESPACE_NAME      FILE_NAME
——————– ———————————————————–

TEST     /u01/app/oracle/oradata/PSTG/datafile/test.dbf

[oracle@ol72-oraclepub datafile]$ ls -lh

-rw-r—–. 1 oracle oinstall  11G Jun  2 11:49 test.dbf
-rw-r—–. 1 oracle oinstall  11G Jun  2 11:49 tester.dbf

Please consult the Oracle R12.2 Docs for further details.

Code examples:

Rename:

ALTER DATABASE MOVE DATAFILE ‘/u01/app/oracle/oradata/PSTG/datafile/test.dbf’ TO ‘/u01/app/oracle/oradata/PSTG/datafile/tester.dbf’;

Relocate:

ALTER DATABASE MOVE DATAFILE ‘/u01/app/oracle/oradata/PSTG/datafile/test.dbf’ TO ‘/u02/app/oracle/oradata/PSTG/datafile/test.dbf’;

Copy:

ALTER DATABASE MOVE DATAFILE ‘/u01/app/oracle/oradata/PSTG/datafile/test.dbf’ TO ‘/u01/app/oracle/oradata/PSTG/datafile/test.dbf’ KEEP;

Move into ASM:

ALTER DATABASE MOVE DATAFILE ‘/u01/app/oracle/oradata/PSTG/datafile/test.dbf’ TO ‘+DATA/data/datafile/test.dbf’;

REUSE: overwrite data file with the same name
KEEP: copies the data file to a new location and retains original data file in old location

Oracle E-Business Suite R12.2.5 Fresh Install – Part III

Oracle EBS R12.2.5 Upgrade

In Part I of my Oracle R12.2.5 Fresh Install walkthrough I described the prepatory steps for the install.

In Part II we shared details on how to install Oracle EBS using the latest R12.2.5 media including Oracle 12cR1.

In this Blog post I walk provide details of how to upgrade your EBS environment from R12.2.0 to R12.2.5.

Current Configuration

SQL> select banner from v$version;
BANNER
——————————————————————————–
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
PL/SQL Release 12.1.0.2.0 – Production
CORE 12.1.0.2.0 Production
TNS for Linux: Version 12.1.0.2.0 – Production
NLSRTL Version 12.1.0.2.0 – Production

SQL> select release_name from apps.fnd_product_groups;
RELEASE_NAME
————————————————–
12.2.0

R12.2.5 Upgrade Process

If you have access to http://support.oracle.com refer to Oracle E-Business Suite Releases 12.2.5 Readme (Doc ID 1983050.1)

Apply Consolidated Seed Table Patch

Stop all Application services other than the WebLogic AdminServer on the run file system.

$ cd $ADMIN_SCRIPTS_HOME
$ ./adstpall.sh apps/apps

$ ./adadminsrvctl.sh start

Apply the patch using the new adop tool, adpatch no longer required.

$ cd ../VIS/fs_ne/EBSapps/patch
$ unzip p17204589.zip
$ unzip p21900871
$ adop phase=apply patches=17204589,21900871 merge=yes hotpatch=yes

Start all AppsTier services

$ cd $ADMIN_SCRIPTS_HOME
$ ./adstral.sh apps/apps

Enter Weblogic password when prompted.

Apply R12.2.5 Release Update Pack

Source the run edition environment variables

$. <INSTALL_BASE>EBSapps.env. run

Stop the Weblogic AdminServer and Node Manager services

$ cd $ADMIN_SCRIPTS_HOME
$ ./adadminsrvctl.sh stop
$ ./adnodemgrctl.sh stop

Set the 12c database parameter optimizer_adaptive_features to false

optimizer_adaptive_features=false

Apply previously downloaded patch 19676458

$ cd ../VIS/fs_ne/EBSapps/patch
$ unzip p19676458.zip
$ adop phase=apply apply_mode=downtime patches=19676458

Reset the 12c database parameter optimizer_adaptive_features back to true

optimizer_adaptive_features=true

Re-Start all AppsTier services

$ cd $ADMIN_SCRIPTS_HOME
$ ./adstral.sh apps/apps

Perform adop clean-up
$ adop phase=cleanup

Synchronise the file systems using atop as below, this will copy the new run edition code and configuration to the other file system.
$ adop phase=fs_clone

Updated Configuration

As you can see from below we have now a running Oracle EBS R12.2.5 environment on a 12c database.

R12.2.5 OAM

EBS_Release_Name

Oracle E-Business Suite R12.2.5 Fresh Install – Part II

Oracle EBS R12.2.5 Installation

Navigate to ../startCD/Disk1/rapidwiz an launch rapidwiz

As you can see from below the installation is going to include Oracle 12cR1 RDBMS.

Welcome

Review and click ‘Next’

Wizard1

Select ‘Install Oracle E-Business Suite Release R12.2.0’, click ‘Next’

config_choice

Select ‘Create a new configuration’, click ‘Next’

global_settings

Update Port Pool if required, click ‘Next’

database_node

Update Database Node Configuration, click ‘Next’

primary_app_node

Update Application Node Configuration, click ‘Next’

App_user_info

Update Application User Information, click ‘Next’

node_info

Review node information, click ‘Next’

validation

Review ‘Validate System Configuration’, click ‘Next’

review

Review summary, click ‘Next’

Installing

Click ‘Next’ to start install

Missing Java library

rw-50004

The above failure is due to a missing java library file, this can be fixed with the below.

$ORACLE_HOME/javavm/jdk/jdk7/lib/libjavavm12.a lib to $ORACLE_HOME/lib/

If your quick you can copy it whilst rapidwiz is installing the Oracle Home, otherwise you will have to clean-up the oraInventory and star rapidwiz again.

RMAN failure

The installer will try to restore the data files using RMAN, previous releases just unzipped the files, the installer will continue for a while until.

RMAN-04014: startup failed: ORA-01127: database name ‘OLDDBNAME’ exceeds size limit of 8 characters

This can be fixed by updating the RMANinit.ora file and restarting rapidwiz e.g.

/u01/oracle/VIS/12.1.0/dbs/RMANinit.ora
db_name=OLDDBNAME
to
db_name=VIS

Perl Segmentation fault

Another, problem you may encounter with your Oracle EBS R12.2.5 install is a perl ‘Segmentation fault’

$ pwd
/u01/oracle/VIS/12.1.0/perl/bin
$ ./perl -v
Segmentation fault

$ cd $ORACLE_HOME
$ mv perl/ perl.old/
$ mkdir perl

Change directory back to your downloaded version and re-compile.

$ cd
$ cd perl/perl-5.14.1
$./Configure -des -Dprefix=$ORACLE_HOME/perl -Doptimize=-O3 -Dusethreads -Duseithreads -Duserelocatableinc ; make clean ; make ; make install

$ cd $ORACLE_HOME/perl
$ rm -rf lib/ man/
$ cp -r ../perl.old/lib/ .
$ cp -r ../perl.old/man/ .
$ cp ../perl.old/bin/dbilogstrip bin/
$ cp ../perl.old/bin/dbiprof bin/
$ cp ../perl.old/bin/dbiproxy bin/
$ cp ../perl.old/bin/ora_explain bin/

Rapidwiz Completion

Once the installed is complete you can now confirm your EBS and database versions using the following:

SQL> select release_name from apps.fnd_product_groups;
SQL> select * from v$version;

In part III of this BLOG series I will share the steps to upgrade from R12.2.0 to R12.2.5