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.

Sunday Jan 10, 2016

Pack/Unpack No More...

The online writeTemplate() command bug is resolved by the patch 22541322. Download the patch here: https://support.oracle.com/epmos/faces/PatchDetail?patchId=22541322.

If you have been building WebLogic domains, you know that after creating and configuring your domain on the Administration Server, you need to use the PACK command to create a managed server template. This template is then copied to all the managed server hosts and then the managed server domain is created using the UNPACK command.

If you wanted to automate your domain creation, you know that this is an additional step when you need to either place the template in a shared location between the admin server and managed servers or transfer the template using host commands like SCP. Would you want a command that would allow you to connect to the administration server from a managed server and download the domain somehow.

Starting with WebLogic 12c, you may be able to create a managed server domain on remote machines using online WLST. The instructions are provided in the Oracle WebLogic documentation here:

Here is the snippet from the Oracle Documentation:

import os

wlsHome = os.getenv('WL_HOME')
mwHome = os.path.join(wlsHome, '..')

#Substitute the administrator user name and password values below as needed
connect('adminusername','adminpassword','localhost:7001')

#The path on the local machine where the template will be created,
#it should not already exist.
templatePath = 'user_templates/myTemplate.jar'

#get the packed template from the Administration Server
writeTemplate(templatePath)

#disconnect from online WLST connection to the Administration Server
disconnect()

#select and load the template that was downloaded from the Administration
#Server.
selectCustomTemplate('templatepath')
loadTemplates()

#specify the domain directory where the domain needs to be created
domainPath = 'domains/myRemoteDomain')

#create the domain
writeDomain(domainPath)

Monday Jan 04, 2016

Changes to some WLST Commands in 12.2.1

I was working on a few scripts to create domains using WLST and I realized that some of the traditional WLST commands are deprecated starting WebLogic v12.2.1. Previously, to create a new domain, I would use a script similar to the snippet below.

readTemplate("/u01/app/oracle/middleware/wlserver_10.3/common/templates/domains/wls.jar")
addTemplate("/u01/app/oracle/middleware/oracle_common/common/templates/applications/oracle.em_11_1_1_0_0_template.jar")

# ... configure domain here ...

writeDomain("/u01/data/domains/mydomain")
closeTemplate()

Starting 12.2.1, the readTemplate() and addTemplate() commands are deprecated and have been replaced with selectTemplate() and loadTemplates(). The selectTemplate() command is used to select a feature and loadTemplates will load all the templates required for that feature. To create a new domain using the new method, the script will now look similar to the snippet below.

selectTemplate("Basic WebLogic Server Domain", "12.2.1")
loadTemplates()

# ... configure domain here ...

writeDomain("/u01/data/domains/mydomain")

You can read the Oracle Documentation about domain creation here: https://docs.oracle.com/middleware/1221/wls/WLSTG/domains.htm#WLSTG161.

The WLST Command and Variable reference can be found here: https://docs.oracle.com/middleware/1221/wls/WLSTC/reference.htm#WLSTC140.

You also do not have to manually pack and unpack to replicate the domain to your managed servers anymore. This can be accomplished by running the online WLST script provided here from the managed server: https://docs.oracle.com/middleware/1221/wls/WLSTG/domains.htm#WLSTG406.

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.

Sunday Dec 20, 2015

Implement Oracle WebCenter 11g as Docker Containers

This post shows you how to create Docker Images with Oracle WebCenter installed. Download the entire project directory from GitHub here.

Docker offers a container-based virtualization platform for applications and I have been playing with it for a few weeks now to see how I can create a base image with all the Oracle Software installed. Consequently, I wanted to port the WebLogic Admin Server and Managed Servers as Docker containers. As patches become available, I would then update my base image and distribute it. Once a new image is available, the idea is to create new containers for the WebLogic Admin Server and Managed Servers while retaining existing configuration and data. Here is how I did it.

I have used a Ubuntu 15.10 virtual machine for this exercise. You will need plenty of disk space on your virtual machine as Docker creates an intermediate image after every instruction. The instructions for setting up Docker can be found on their website here.

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 ~/webcenter
cd ~/webcenter
mkdir jdk wls rcu wcc wcp

After the directories are setup, all the necessary installers should be downloaded. The installers come as a ZIP archive and most of them will have to be extracted in those directories. If you have downloaded the project files from GitHub, you can find the instructions to download and extract 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. 

./webcenter
 - Dockerfile.11.1.1.9.0
 - domain
  - docker_domain_admin.jar
 - jdk
  - jdk-7u91-linux-x64.tar.gz
 - rcu
  - rcuHome
  - readme_fmw_ps7.htm
 - scripts
  - add_server.py
  - start_server.sh
 - wcc
  - 22060967
  - Disk1
  - Disk2
  - ECM_22249978
  - readme_fmw_ps7.htm
 - wcp
  - 21950042
  - Disk1
  - Disk2
  - Disk3
  - Disk4
  - readme_fmw_ps7.htm
 - wls
  - p20780171_1036_Generic.zip
  - silent.xml
  - wls1036_generic.jar

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

FROM oraclelinux:6
MAINTAINER Justin Paul

ENV _SCRATCH /tmp/scratch
ENV ORA_HOME /u01/app/oracle
ENV JDK_HOME ${ORA_HOME}/product/jdk
ENV FMW_HOME ${ORA_HOME}/product/fmw
ENV ADM_HOME ${ORA_HOME}/admin

COPY jdk ${_SCRATCH}/jdk/
COPY wls ${_SCRATCH}/wls/
COPY rcu ${_SCRATCH}/rcu/
COPY wcc ${_SCRATCH}/wcc/
COPY wcp ${_SCRATCH}/wcp/
COPY domain ${_SCRATCH}/domain/
COPY scripts ${_SCRATCH}/scripts/

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 && \
 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} && \
 tar xzf ${_SCRATCH}/jdk/jdk-7u91-linux-x64.tar.gz -C ${JDK_HOME} --strip-components=1 && \
 mkdir -p ${FMW_HOME} && \
 ${JDK_HOME}/bin/java -jar ${_SCRATCH}/wls/wls1036_generic.jar \
 -mode=silent -silent_xml=${_SCRATCH}/wls/silent.xml && \
 mv ${_SCRATCH}/rcu/rcuHome ${FMW_HOME}/ && \
 echo "inventory_loc=${FMW_HOME}/oraInventory" > ${_SCRATCH}/oraInst.loc && \
 echo "inst_group=oinstall" >> ${_SCRATCH}/oraInst.loc && \
 ${_SCRATCH}/wcp/Disk1/runInstaller -silent -invPtrLoc ${_SCRATCH}/oraInst.loc \
 -responseFile ${_SCRATCH}/wcp/Disk1/stage/Response/sampleResponse_wls.rsp \
 -jreLoc ${JDK_HOME} -waitforcompletion -force -novalidation \
 MIDDLEWARE_HOME=${FMW_HOME} ORACLE_HOME=${FMW_HOME}/Oracle_WC1 && \
 ${_SCRATCH}/wcc/Disk1/runInstaller -silent -invPtrLoc ${_SCRATCH}/oraInst.loc \
 -responseFile ${_SCRATCH}/wcc/Disk1/stage/Response/sampleResponse_wls.rsp \
 -jreLoc ${JDK_HOME} -waitforcompletion -force -novalidation \
 MIDDLEWARE_HOME=${FMW_HOME} ORACLE_HOME=${FMW_HOME}/Oracle_ECM1 && \
 mkdir -p ${ADM_HOME}/tools/templates && \
 mkdir -p ${ADM_HOME}/tools/scripts && \
 cp ${_SCRATCH}/domain/* ${ADM_HOME}/tools/templates && \
 cp -r ${_SCRATCH}/scripts/* ${ADM_HOME}/tools/scripts

RUN rm -rf ${_SCRATCH}

CMD /bin/bash

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

cd ~/webcenter
docker build -t webcenter:11.1.1.9.0 -f ./Dockerfile.11.1.1.9.0 .

After the image(s) are built, we can start creating the containers. For the purpose of this post, we will keep the admin domain configuration on a shared volume. This volume will be mounted with RW permissions on the admin server container and with R permissions only on the managed server containers.

Run the following commands to create and start your admin server container. Use the -d flag instead of -i to force the container to run as a background process. 

mkdir -p ~/volume/aserver
docker run -i -P --name=adminserver \
-v ~/volume/aserver:/u01/app/oracle/admin/aserver:rw \
-t webcenter:11.1.1.9.0 /bin/sh /u01/app/oracle/admin/tools/scripts/start_server.sh \
adminserver

Find the IP Address of the newly created container using the docker inspect command. 

docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' adminserver

After the Admin Server is up and running, login to the Admin Console as weblogic [the password is welcome1]. Update the JDBC data sources for all services that you intend to use. They are setup with dummy values in the domain and these data sources should be configured before you can start and managed server. For example, if you intend to create the UCM managed server container, you must configure the CSDS data source to connect to a valid database.

After the Admin Server configuration is complete, start a managed server container using the following commands. Use the -d flag instead of -i to force the container to run as a background process. Replace abc.def.ghi.jkl with the IP Address of the Admin Server. 

docker run -i -P --name=ucm_mserver1 \
-v ~/volume/aserver:/u01/app/oracle/admin/aserver:ro \
-t webcenter:11.1.1.9.0 /bin/sh /u01/app/oracle/admin/tools/scripts/start_server.sh \
ucm t3://abc.def.ghi.jkl:7001

You can create containers for any managed servers supported by the domain. Replace SERVER_ID with one of [capture, ibr, ipm, irm, ssxa, ucm, urm, collaboration, portlet, spaces, utilities] to create a managed server container for that service. Also remember to replace abc.def.ghi.jkl with the IP Address of the Admin Server. 

docker run -d -P --name=SERVER_ID_1 \
-v ~/volume/aserver:/u01/app/oracle/admin/aserver:ro \
-t webcenter:11.1.1.9.0 /bin/sh /u01/app/oracle/admin/tools/scripts/start_server.sh \
SERVER_ID t3://abc.def.ghi.jkl:7001

If you wish to update the image with the latest patches, update the Dockerfile with the instructions to apply the patches and build the image again or create a new image. After the new image is created, recreate the admin server and managed server containers using the same commands as above. Make sure you use the right image, mount the correct shared volume and change the container names.

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.

Thursday Oct 01, 2015

Oracle Documents Cloud Service Commit Driver for WebCenter Enterprise Capture

Oracle released a WebCenter Enterprise Capture (11.1.1.9.0) Patch yesterday that includes a new commit driver for Oracle Documents Cloud Service.

To get this update, download patch# 21321443 from MOS and follow the instructions in the patch READ ME to apply it.

Monday Aug 24, 2015

Oracle WebCenter Content: FullText Search Examples

Search Type I want to search for… Content Server FullText Query
WORD MATCH All documents with the word CACTUS in them <ftx>CACTUS</ftx>
PHRASE MATCH All documents with the phrase “CACTUS BUTTONS” in them <ftx>”CACTUS BUTTONS”</ftx>
AND All documents with both words CACTUS and BUTTONS in them <ftx>CACTUS BUTTONS</ftx>
<ftx>CACTUS AND BUTTONS</ftx>
AND All documents with all words CACTUS and BUTTONS and LUXURY and AMULET in them <ftx>CACTUS BUTTONS LUXURY AMULET</ftx>
<ftx>CACTUS AND BUTTONS AND LUXURY AND AMULET</ftx>
AND (PHRASE) All documents with all the phrases “CACTUS BUTTONS” and “LUXURY AMULET” in them <ftx>”CACTUS BUTTONS” “LUXURY AMULET”</ftx>
<ftx>”CACTUS BUTTONS” AND “LUXURY AMULET”</ftx>
OR All documents with either words CACTUS or BUTTONS in them <ftx>CACTUS,BUTTONS</ftx>
<ftx>CACTUS OR BUTTONS</ftx>
OR All documents with either words CACTUS or BUTTONS or LUXURY or AMULET in them <ftx>CACTUS,BUTTONS,LUXURY,AMULET</ftx>
<ftx>CACTUS OR BUTTONS OR LUXURY OR AMULET</ftx>
OR (PHRASE) All documents with either one of the phrases “CACTUS BUTTONS” or “LUXURY AMULET” in them <ftx>”CACTUS BUTTONS”,“LUXURY AMULET”</ftx>
<ftx>”CACTUS BUTTONS” OR “LUXURY AMULET”</ftx>
NOT All documents with the word CACTUS not in them <ftx>-CACTUS</ftx>
<ftx>NOT CACTUS</ftx>
NOT, AND All documents with none of the words CACTUS and BUTTONS and LUXURY and AMULET in them <ftx>-CACTUS -BUTTONS -LUXURY -AMULET</ftx>
<ftx>NOT CACTUS AND NOT BUTTONS AND NOT LUXURY AND NOT AMULET</ftx>
XOR (EOR) All documents with only one of the words CACTUS or BUTTONS and not the other in them <ftx>(CACTUS,BUTTONS) (-CACTUS,-BUTTONS)</ftx>
<ftx>(CACTUS OR BUTTONS) AND (NOT CACTUS OR NOT BUTTONS)</ftx>
<ftx>(CACTUS -BUTTONS) OR (BUTTONS -CACTUS)<ftx>
<ftx>(CACTUS AND NOT BUTTONS) OR (BUTTONS AND NOT CACTUS)<ftx>
WILDCARD All documents with the word CACTUS and all words starting with CACTUS <ftx>CACTUS*</ftx>
<ftx>CACTUS%</ftx>
WILDCARD All documents with the word CACTUS and all words ending with CACTUS <ftx>*CACTUS</ftx>
<ftx>%CACTUS</ftx>
WILDCARD All documents with the word CACTUS and all words containing the word CACTUS <ftx>*CACTUS*</ftx>
<ftx>%CACTUS%</ftx>
WILDCARD All documents with 8 letter words starting with CACTUS <ftx>CACTUS??</ftx>
WILDCARD All documents with 6 letter words ending with FORM <ftx>??FORM</ftx>
ESCAPE CHARACTERS All documents with the keyword NEAR <ftx>{NEAR}</ftx>

Monday Jul 27, 2015

Migrating huge content repositories using Archiver

I was recently asked to migrate a WebCenter Content repository to a new instance. They had the content exported locally using the Web Archiver applet and they were copying the archive folder to every destination content server file system. The archive folder was ~300 GB in size and it took around ~6 hours to tarball the archive directory and another ~2 hours to copy the tarball to the destination content server and then another ~6 hours to extract the tarball. And this process was repeated every time we wanter to replicate the repository. 

A easier solution may have been to mount a shared volume on the source content server and export the content there. Then you could just mount this shared volume to any destination server and use it for the import. However, the Archiver web applet only allows you to have the archives under the default location in the instance directory, that is [INSTANCE_DIR]/ucm/cs/archives. The key is to run the Archiver from the console as a standalone application. The standalone version of the Archiver application is required to create new collections or browse the local file system to connect to new collections.
  1. After you have identified a location for your archive collection, say /u02/share/archives/abc, create a new file, collection.hda, under the new directory and enter the following lines. Make sure that the IDC_Name parameter does NOT match the IDC_Name for the content server instance.

    @Properties LocalData
    IDC_Name=wcc-ucm
    blDateFormat=M/d{/yy}{ h:mm[:ss]{ a}}!mAM,PM!tAmerica/New_York
    @end
    @ResultSet Archives
    2
    aArchiveName
    aArchiveDescription
    @end

  2. Start the Archiver utility as a standalone application, [DOMAIN_HOME]/ucm/cs/bin/Archiver, go to Options -> Open Archive Collection… and click Browse Local… to create a new collection location. Browse to the newly created directory and select the collection.hda file we just created, /u02/share/archives/abc/collection.hda.
    Open Archive Collection

  3. In the Browse To Archiver Collection, enter the correct paths for the vault and weblayout directories on the current system and click Ok.
    Browse to Archive Collection

  4. Once the new Archive Collection is added to the list, click Open to make it current. You can now create your new archive and export content into it.
  5. After you have completed your content export/import, make sure that you return to Options -> Open Archive Collection… and make the default Archive Collection active.
To IMPORT this archive collection on another content server, make the shared volume available on the target server and follow steps 2-5 to load the collection for import.

Friday Jul 17, 2015

OracleTextSearch fails to index metadata updates and new revisions when using Oracle Database 11.2.0.4.x

If you have setup your Oracle WebCenter Content instance using Oracle Database 11.2.0.4.x or have recently upgraded your database to this version, you may notice that the indexer is not able to index documents for the following scenarios:
  • Checkin a new revision to an existing document.
  • Update the metadata for an existing document.
If you enable trace on systemdatabase, you will notice the following exception lines in the audit logs:
index update work      !csJdbcCommitError,!$ORA-00604: error occurred at recursive SQL level 1
index update work      ORA-06550: line 1\, column 7:
index update work      PLS-00306: wrong number or types of arguments in call to 'SYNCRN'
index update work      ORA-06550: line 1\, column 7:
index update work      PL/SQL: Statement ignored

This problem is explained in MOS Note 1586704.1 and the solution is to apply patch 17501296 for the unpublished bug.
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
« February 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
     
       
Today