Wednesday Jan 27, 2016

Install Oracle Fusion Middleware using Python

I am obsessed with Python! For the last few weeks, I have spent countless hours porting a lot of my scripts into Python. I have even re-written UNIX scripts in Python. I just can't get enough of it. I have come to love the way it manages my data structures: from sets, lists, dictionaries to even JSON. I would like to share a few scripts that can be used to install Fusion Middleware products and create and drop product schemas.You can also access my GitHub project here.

/usr/bin/python install_fmw.py [-?] -l installers_location -o oracle_home [-j jdk_home] [-f fmw_home] [--rsp_file install_response_file] [--tmp_loc tmp_location] [--os_install_group install_os_group] [wls] [bpm|soa] [wcc] [wcp] [wcs] [ohs]

/usr/bin/python create_schemas.py [-?] -f fmw_home -c db_connect_string -m db_prefix [-w password_file] [--dba_user db_admin_user] [--dba_password db_admin_password] [--dbs_password db_schema_password] [--soa_profile SMALL|MED|LARGE] [--analytics_with_partitioning N|Y] [em] [bpm|soa] [ucm] [capture] [wccadf] [portal] [pagelet portlet] [discussions] [analytics] [sites] [vs] [insights] [sc] [ss]

/usr/bin/python drop_schemas.py [-?] [--all] -f fmw_home -c db_connect_string -m db_prefix [-w password_file] [--dba_user db_admin_user] [--dba_password db_admin_password] [em] [bpm|soa] [ucm] [capture] [wccadf] [portal] [pagelet portlet] [discussions] [analytics] [sites] [vs] [insights] [sc] [ss]

NOTE: Please note that these code snippets should be used for development and testing purposes only, as such it is unsupported and should not be used on production environments.

Monday Dec 28, 2015

Docker Image for Oracle Fusion Middleware 12.2.1

This post shows you how to create a Docker Image with one or more components of Oracle Fusion Middleware 12.2.1 installed. Download the project directory from GitHub here.

I have written a Dockerfile to build an image with Oracle Fusion Middleware components. To use this Dockerfile, you will need to create the following directory structure.

mkdir ~/fmw
cd ~/fmw
mkdir installers

After the directories are setup, all the necessary installers should be downloaded. You may choose to skip the installer files for the products that you do not wish to install in your image; the Dockerfile will simply ignore the install instruction for that product.

./fmw
 - installers
  - silent.rsp (required)
  - jdk-8u66-linux-x64.gz (required)
  - fmw_12.2.1.0.0_infrastructure_Disk1_1of1.zip (required)
  - fmw_12.2.1.0.0_bpmqs_Disk1_1of2.zip (optional)
  - fmw_12.2.1.0.0_bpmqs_Disk1_2of2.zip (optional)
  - fmw_12.2.1.0.0_soaqs_Disk1_1of2.zip (optional)
  - fmw_12.2.1.0.0_soaqs_Disk1_2of2.zip (optional)
  - fmw_12.2.1.0.0_wccontent_Disk1_1of1.zip (optional)
  - fmw_12.2.1.0.0_wcportal_Disk1_1of1.zip (optional)
  - fmw_12.2.1.0.0_wcsites_Disk1_1of1.zip (optional)
  - fmw_12.2.1.0.0_ohs_linux64_Disk1_1of1.zip (optional)
 - Dockerfile.12.2.1.0.0

Create or edit the Dockerfile in your context directory. For this post, the Dockerfile is named as Dockerfile.12.2.1.0.0.

FROM oraclelinux:7
MAINTAINER Justin Paul 

ENV _SCRATCH /tmp/scratch
ENV ORA_HOME /u01/app/oracle
ENV JDK_HOME ${ORA_HOME}/jdk
ENV FMW_HOME ${ORA_HOME}/middleware

COPY installers ${_SCRATCH}/

RUN yum update -y -q && \
 yum install -y -q binutils compat-libcap1 compat-libstdc++-33 \
 compat-libstdc++-33.i686 gcc gcc-c++ glibc glibc-devel glibc-devel.i686 \
 libaio libaio-devel libgcc libgcc.i686 libstdc++ libstdc++.i686 \
 libstdc++-devel libXext libXtst libXi openmotif openmotif22 redhat-lsb \
 sysstat zlib zlib.i686 libX11 libX11.i686 unzip xorg-x11-utils xorg-x11-xauth \
 unzip ksh make ocfs2-tools numactl numactl-devel motif motif-devel && \
 groupadd -g 1000 oinstall && \
 useradd -u 1000 -g 1000 -m oracle && \
 mkdir -p ${ORA_HOME} && \
 chown -R oracle:oinstall ${_SCRATCH} && \
 chown -R oracle:oinstall ${ORA_HOME}

USER oracle

RUN mkdir -p ${JDK_HOME} ${FMW_HOME} && \
 echo "inventory_loc=${FMW_HOME}/oraInventory" > ${_SCRATCH}/oraInst.loc && \
 echo "inst_group=oinstall" >> ${_SCRATCH}/oraInst.loc && \
 tar xzf ${_SCRATCH}/jdk-8u66-linux-x64.gz -C ${JDK_HOME} --strip-components=1 && \
 rm -rf ${_SCRATCH}/jdk-8u66-linux-x64.gz && \
 unzip ${_SCRATCH}/fmw_12.2.1.0.0_infrastructure_Disk1_1of1.zip -d ${_SCRATCH} && \
 ${JDK_HOME}/bin/java -jar ${_SCRATCH}/fmw_12.2.1.0.0_infrastructure.jar \
 -novalidation -silent -responseFile ${_SCRATCH}/silent.rsp \
 -invPtrLoc ${_SCRATCH}/oraInst.loc ORACLE_HOME=${FMW_HOME} \
 INSTALL_TYPE="Fusion Middleware Infrastructure" && \
 rm -rf ${_SCRATCH}/fmw_12.2.1.0.0_infrastructure_Disk1_1of1.zip \
 ${_SCRATCH}/fmw_12.2.1.0.0_infrastructure.jar

RUN [[ -f ${_SCRATCH}/fmw_12.2.1.0.0_bpmqs_Disk1_1of2.zip ]] && \
 [[ -f ${_SCRATCH}/fmw_12.2.1.0.0_bpmqs_Disk1_2of2.zip ]] && \
 unzip ${_SCRATCH}/fmw_12.2.1.0.0_bpmqs_Disk1_1of2.zip -d ${_SCRATCH} && \
 unzip ${_SCRATCH}/fmw_12.2.1.0.0_bpmqs_Disk1_2of2.zip -d ${_SCRATCH} && \
 ${JDK_HOME}/bin/java -jar ${_SCRATCH}/fmw_12.2.1.0.0_bpm_quickstart.jar \
 -novalidation -silent -responseFile ${_SCRATCH}/silent.rsp \
 -invPtrLoc ${_SCRATCH}/oraInst.loc ORACLE_HOME=${FMW_HOME} && \
 rm -rf ${_SCRATCH}/fmw_12.2.1.0.0_bpmqs_Disk1_1of2.zip \
 ${_SCRATCH}/fmw_12.2.1.0.0_bpmqs_Disk1_2of2.zip \
 ${_SCRATCH}/fmw_12.2.1.0.0_bpm_quickstart.jar \
 ${_SCRATCH}/fmw_12.2.1.0.0_bpm_quickstart2.jar && \
 export BPM_INSTALLED=1

RUN [[ -z ${BPM_INSTALLED} ]] && \
 [[ -f ${_SCRATCH}/fmw_12.2.1.0.0_soaqs_Disk1_1of2.zip ]] && \
 [[ -f ${_SCRATCH}/fmw_12.2.1.0.0_soaqs_Disk1_2of2.zip ]] && \
 unzip ${_SCRATCH}/fmw_12.2.1.0.0_soaqs_Disk1_1of2.zip -d ${_SCRATCH} && \
 unzip ${_SCRATCH}/fmw_12.2.1.0.0_soaqs_Disk1_2of2.zip -d ${_SCRATCH} && \
 ${JDK_HOME}/bin/java -jar ${_SCRATCH}/fmw_12.2.1.0.0_soa_quickstart.jar \
 -novalidation -silent -responseFile ${_SCRATCH}/silent.rsp \
 -invPtrLoc ${_SCRATCH}/oraInst.loc ORACLE_HOME=${FMW_HOME} && \
 rm -rf ${_SCRATCH}/fmw_12.2.1.0.0_soaqs_Disk1_1of2.zip \
 ${_SCRATCH}/fmw_12.2.1.0.0_soaqs_Disk1_2of2.zip \
 ${_SCRATCH}/fmw_12.2.1.0.0_soa_quickstart.jar \
 ${_SCRATCH}/fmw_12.2.1.0.0_soa_quickstart2.jar

RUN [[ -f ${_SCRATCH}/fmw_12.2.1.0.0_wccontent_Disk1_1of1.zip ]] && \
 unzip ${_SCRATCH}/fmw_12.2.1.0.0_wccontent_Disk1_1of1.zip -d ${_SCRATCH} && \
 ${JDK_HOME}/bin/java -jar ${_SCRATCH}/fmw_12.2.1.0.0_wccontent_generic.jar \
 -novalidation -silent -responseFile ${_SCRATCH}/silent.rsp \
 -invPtrLoc ${_SCRATCH}/oraInst.loc ORACLE_HOME=${FMW_HOME} \
 INSTALL_TYPE="WebCenter Content" && \
 rm -rf ${_SCRATCH}/fmw_12.2.1.0.0_wccontent_Disk1_1of1.zip \
 ${_SCRATCH}/fmw_12.2.1.0.0_wccontent_generic.jar

RUN [[ -f ${_SCRATCH}/fmw_12.2.1.0.0_wcportal_Disk1_1of1.zip ]] && \
 unzip ${_SCRATCH}/fmw_12.2.1.0.0_wcportal_Disk1_1of1.zip -d ${_SCRATCH} && \
 ${JDK_HOME}/bin/java -jar ${_SCRATCH}/fmw_12.2.1.0.0_wcportal_generic.jar \
 -novalidation -silent -responseFile ${_SCRATCH}/silent.rsp \
 -invPtrLoc ${_SCRATCH}/oraInst.loc ORACLE_HOME=${FMW_HOME} \
 INSTALL_TYPE="WebCenter Portal" && \
 rm -rf ${_SCRATCH}/fmw_12.2.1.0.0_wcportal_Disk1_1of1.zip \
 ${_SCRATCH}/fmw_12.2.1.0.0_wcportal_generic.jar

RUN [[ -f ${_SCRATCH}/fmw_12.2.1.0.0_wcsites_Disk1_1of1.zip ]] && \
 unzip ${_SCRATCH}/fmw_12.2.1.0.0_wcsites_Disk1_1of1.zip -d ${_SCRATCH} && \
 ${JDK_HOME}/bin/java -jar ${_SCRATCH}/fmw_12.2.1.0.0_wcsites_generic.jar \
 -novalidation -silent -responseFile ${_SCRATCH}/silent.rsp \
 -invPtrLoc ${_SCRATCH}/oraInst.loc ORACLE_HOME=${FMW_HOME} \
 INSTALL_TYPE="WebCenter Sites" && \
 rm -rf ${_SCRATCH}/fmw_12.2.1.0.0_wcsites_Disk1_1of1.zip \
 ${_SCRATCH}/fmw_12.2.1.0.0_wcsites_generic.jar

RUN [[ -f ${_SCRATCH}/fmw_12.2.1.0.0_ohs_linux64_Disk1_1of1.zip ]] && \
 unzip ${_SCRATCH}/fmw_12.2.1.0.0_ohs_linux64_Disk1_1of1.zip -d ${_SCRATCH} && \
 ${_SCRATCH}/fmw_12.2.1.0.0_ohs_linux64.bin -jreLoc ${JDK_HOME} \
 -novalidation -silent -responseFile ${_SCRATCH}/silent.rsp \
 -invPtrLoc ${_SCRATCH}/oraInst.loc ORACLE_HOME=${FMW_HOME} \
 INSTALL_TYPE="Colocated HTTP Server (Managed through WebLogic server)" && \
 rm -rf ${_SCRATCH}/fmw_12.2.1.0.0_ohs_linux64_Disk1_1of1.zip \
 ${_SCRATCH}/fmw_12.2.1.0.0_ohs_linux64.bin

RUN rm -rf ${_SCRATCH}

CMD /bin/bash

Once you have your files ready, you can build your image using the command below. You will then have to create a domain manually and then start your managed servers [and optionally, nodemanagers] as separate containers.

cd ~/fmw
docker build -t oracle/fmw:12.2.1.0.0 -f ./Dockerfile.12.2.1.0.0 .

Oracle WebLogic is now certified to run on Docker Containers starting with version 12c (12.1.3.0.0) and you will like the way these Oracle products work with Docker now. There is also a white paper available which describes a WebLogic deployment. The concepts explained this is white paper can be applied to the SOA/BPM and WebCenter managed servers as well. You can read the white paper here.

Monday Dec 21, 2015

Implement Oracle Database XE as Docker Containers

This post shows you how to create Docker Images with Oracle Database Express Edition installed and configured. Download the entire project directory from GitHub here.

If you have tried to create Docker containers for Oracle Database XE, you will not be able to configure/start a database instance successfully. The installation may complete successfully but when you try to configure or start an instance, you will notice the following error in the logs. 

ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
ORA-00845: MEMORY_TARGET not supported on this system

On further investigation, you will notice that the shared memory [/dev/shm] available to a Docker container is 64MB in the current public Docker version and Oracle Database XE requires at least 1GB of shared memory. If you edit the [/u01/app/oracle/product/11.2.0/xe/config/scripts/init.ora] file to either comment or change the memory_target parameter, you may be able to complete the configuration and start the database. However, you will still see this error and you may not be able to use the database at all.

There is no way to can change the shared memory available when building a Docker image or when creating containers. Development of an option to specify the shared memory available using "--shm-size=x[b|m|g]" is in progress and you can find more information regarding this thread here: https://github.com/docker/docker/issues/16164.

This feature should be part of the Docker 1.10 release; however, this fix is available in the current experimental build. If you are open to using the beta version of the software, here is how I implemented the Oracle Database XE in Docker.

I have used a Ubuntu 15.10 virtual machine for this exercise. You can install the latest Docker experimental build from https://experimental.docker.com. Update the kernel parameters on the host machine to meet the Oracle requirements. These requirements can be found on the webpage here: http://docs.oracle-DOT-com/cd/E17781_01/install.112/e18802/toc.htm#BABJFAIA.

fs.file-max=6815744
kernel.shmall=2097152
kernel.shmmax=4294967295
kernel.shmmni=4096
kernel.sem="250 32000 100 128"
net.ipv4.ip_local_port_range="9000 65000"

Once the environment is setup and ready to go, the next step is to identify a Docker build context directory and create the necessary folder structure. 

mkdir ~/database
cd ~/database
mkdir xe

After the directories are setup, all the necessary installers should be downloaded. If you have downloaded the project files from GitHub, you can find the instructions to download the files under the respective directory. You can also click on a directory below to see the instructions. At the end you should have a directory structure shown below. 

./database
 - xe
  - Dockerfile.11.2.0.1.0
  - oracle-xe-11.2.0-1.0.x86_64.rpm.zip

Create or edit the Dockerfile in your context directory. For this post, the Dockerfile is named as Dockerfile.11.2.0.1.0. 

FROM oraclelinux:6
MAINTAINER Justin Paul

ENV _SCRATCH /tmp/scratch

COPY db/oracle-xe-11.2.0-1.0.x86_64.rpm.zip ${_SCRATCH}/db/

RUN yum update -y -q && \
  yum install -y -q binutils compat-libcap1 compat-libstdc++-33 \
  compat-libstdc++-33.i686 gcc gcc-c++ glibc glibc-devel glibc-devel.i686 \
  libaio libaio-devel libgcc libgcc.i686 libstdc++ libstdc++.i686 \
  libstdc++-devel libXext libXtst libXi openmotif openmotif22 redhat-lsb \
  sysstat zlib zlib.i686 libX11 libX11.i686 unzip xorg-x11-utils xorg-x11-xauth

RUN unzip ${_SCRATCH}/db/oracle-xe-11.2.0-1.0.x86_64.rpm.zip -d ${_SCRATCH}/db && \
  rpm -ivh ${_SCRATCH}/db/Disk1/oracle-xe-11.2.0-1.0.x86_64.rpm && \
  sed -i 's/ORACLE_PASSWORD=/ORACLE_PASSWORD=welcome1/g' \
  ${_SCRATCH}/db/Disk1/response/xe.rsp && \
  sed -i 's/ORACLE_CONFIRM_PASSWORD=/ORACLE_CONFIRM_PASSWORD=welcome1/g' \
  ${_SCRATCH}/db/Disk1/response/xe.rsp && \
  /etc/init.d/oracle-xe configure responseFile=${_SCRATCH}/db/Disk1/response/xe.rsp

RUN rm -rf ${_SCRATCH}

CMD /etc/init.d/oracle-xe start && /bin/bash

Run the following command to build your image. Use --no-cache=true if you do not want to cache intermediate images. 

cd ~/database
docker build -t oracle/db/xe:11.2.0.1.0 --shm-size=2g -f ./xe/Dockerfile.11.2.0.1.0 .

After the image(s) are built, we can create the container. Run the following command to create and start your database container. Use the -d flag instead of -i to force the container to run as a background process. 

docker run -i -P --name=oracle-db-xe-1 --shm-size=2g -t oracle/db/xe:11.2.0.1.0

NOTE: Please note that these instructions should be used for development and evaluation purposes only, as such they are unsupported and should not be used on production environments.

Saturday May 30, 2015

Slow startup on MacBook Pro running OS X

I am running the latest OS X Yosemite (10.10.3) on my MacBook Pro and have noticed that the startup duration has increased recently. When I restarted my computer today, I timed the startup delay and was surprised to see that it took more than 10 seconds to even show the Apple logo. A quick search on the Internet solved the problem for me; I reset the PRAM and my MacBook was back to its older self again.

Here is how to do it:
Source: https://support.apple.com/kb/PH18761?locale=en_US

  1. Shutdown your Mac
  2. Locate the following keys on the keyboard: Option, Command (⌘), P, and R. You will need to hold these keys down simultaneously in step 4.
  3. Turn on your Mac.
  4. Immediately press and hold the Option-Command-P-R keys. You must press this key combination before the gray screen appears.
  5. Continue holding the keys down until your Mac restarts, and you hear the startup sound for the second time.
  6. Release the keys. 

Update: If you have Trim Enabler to support a third party SSD, you must disable Trim before attempting to reset PRAM; see https://www.cindori.org/trim-enabler-and-yosemite.

Wednesday May 07, 2014

How to: Run Repository Creation Utility (RCU) on Solaris

Many of the Oracle Fusion Middleware components require the existence of schemas in a database prior to installation. These schemas are created and loaded in the database using the Repository Creation Utility (RCU). Repository Creation Utility is a graphical and CLI-based tool used to create and manage Oracle Fusion Middleware database schemas.

At this time, RCU is available for Windows and Linux platforms only.

If you want to run RCU on Solaris, edit the RCU executable, <RCU_HOME>/bin/rcu, and make the following changes:
  • Look for the “#Platform Checking” section, and comment out the "exit" statement
  • Look for the line which specifies the JRE_DIR and update it to point to a Solaris JRE or JDK
After making these changes, set the SQLPLUS_HOME variable to point to any ORACLE_HOME and export it before running RCU.

Now you will be able to run RCU on Solaris and create the database objects for Oracle Fusion Middleware.

NOTE: Please note that these instructions should be used for development and testing purposes only, as such it is unsupported and should not be used on production environments.

Tuesday May 06, 2014

Timeout error starting OHS with OAM WebGates on Oracle Solaris (SPARC)

Oracle Access Manager provides single sign-on (SSO), authentication, authorization, and other services to registered agents (in any combination) protecting WebCenter resources. A Web server, Application Server, or any third-party application must be protected by a WebGate or mod_osso instance that is registered with Oracle Access Manager as an agent to enforce policies. The agent acts as a filter for HTTP requests.

This document relates to the following versions of the products:

  • Oracle Web Tier Utilities: 11.1.1.7.0
  • OAM WebGates for OHS: 11.1.2.1.0

When you try to install and configure Oracle Web Tier Utilities with Oracle OAM WebGates for OHS on Oracle SuperCluster (or Solaris SPARC), the installation and initial configuration may go fine in the beginning. However, once you start putting in your directives for OAM protected resources, you may notice that the OHS component does not start up as it used to.

The opmnctl startall and opmnctl stopall commands take longer than usual with the following error messages. You may also notice that the OHS and OPMN log files do not contain much information.

  user1@hostname1:~$ /u01/oracle/ohs_inst/ohs_server02/bin/opmnctl startall

  opmnctl startall: starting opmn and all managed processes...

  =============================================================================

  opmn id=hostname1:6701

  Response: 0 of 1 processes started.

  ias-instance id=ohs_server02

  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  -----------------------------------------------------------------------------

  ias-component/process-type/process-set:

  ohs2/OHS/OHS/

  Error

  --> Process (index=1,uid=118965811,pid=13118)

  time out while waiting for a managed process to start

  Log:

  /u01/oracle/ohs_inst/ohs_server02/diagnostics/logs/OHS/ohs2/console~OHS~1.log

The culprit is the webgate.conf include in the httpd.conf file and removing it will resolve the issue. However, now you cannot use OAM for SSO.

You may want to try out the steps in MOS Note 1614464.1 to edit the webgate.so file; but this may not resolve the issue. I was able to start the OHS server after modifying the webgate.so file, but got a blank (empty) response when I tried to access the application URLs. I would suggest that you read through the rest of the blog and try the solution below.

The fix to this problem is to add the following entry, where IP_Address is the IP address of the local machine, in /etc/hosts on which Oracle HTTP Server is being installed:

IP_ADDRESS stafas12

Yes, you need to put in this value which may be entirely unrelated to you network configuration into the /etc/hosts file to fix the issue.

You can refer to page 57 in the Oracle Fusion Application Release Notes 11.1.7 in MOS Note 1582125.1 for more details. This document also contains the list of other known issues and their resolutions.

About

Welcome to my blog. I use this site to share my experience as well as tips and tricks on Oracle Fusion Middleware products.

Contributors

Search

Archives
« June 2016
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  
       
Today