Sunday 18 November 2018

WebLogic Message Unit-of-Order explanation

Example for UOE(Unit Of Order)
Somebody enter in a web application (store) for buying a book and choose a book (M1= message number 1). After that, that person immediately cancel 
that action (M2= message number 2).
In this case the following things may happen:
   1) MDB 1(Message Driven Beans 1) read the first message (M1) and start processing that message.
   2) MDB2 (Message Driven Beans 2) read the second message (M2) and start processing that message.
   3) For some reasons (MDB2 run faster than MDB1), MDB2 try to cancel that operation by sending a "DELETE" operation to the database, 
but nothing happen, because MDB1 didn't "INSERT" that operation to the database.
   4) MDB1 "INSERT" that operation to the database.
At the end the book appears in the database as "INSERTED", so that book will be sent to the person who wanted it at the beginning (but is no longer needed).
In order to avoid this problem, WebLogic introduce the concept of Unit-of-Order

With this concept, more messages are associated with an ID (UOO).

The Message Unit-of-Order enforces the order of messages with the same key so that the messages are consumed in the order they were added to the queue.
Here is the behaviour we can have for the example above, if M1 and M2 have the same Message Unit-of-Order:

  • MDB 1(Message Driven Beans 1) read the first message (M1) and start processing that message.
  • MDB2 (Message Driven Beans 2) read the second message (M2) and wait for the M1 to complete.
  • MDB1 "INSERT" that operation to the database and complete the execution and MDB2 start processing that message and send a "DELETE" 
operation to the database.
All Set now.

WebLogic Machine

A machine is a logical representation of the physical machine (computer) that hosts one or more WebLogic Server instances.

Oracle WebLogic Machine configuration:

If you want to run Node Manager on a machine that does not host an Administration Server, as is typical in production environments, you must create a machine configuration for each computer that runs a Node Manager process. The machine configuration includes information about the listen address and port number that the Administration Server uses to connect with the Node Manager process running on that machine.

Here are the steps for enrolling a WebLogic Node Manager with a domain.

For configuring the WebLogic Machine you have to go to the 
Domain Structure / Environment / Machines and now choose a machine.

Then click on Admin Server can communicate with the Node Manager on that machine. 
In this case the Node Manager Status is "Reachable":

The main configurations for the machine is to set the Node Manager settings :
Now on the "Servers" tab you can see the servers running on that machine as well :


Use of Node Manager:

  • A Node Manager process is not associated with a specific WebLogic domain but with a machine.
  • You can use the same Node Manager process to control server instances in any WebLogic  Server domain, as long as the server instances reside on the same machine as the Node  Manager process.
  • Node Manager must run on each computer that hosts WebLogic Server instances. whether Administration Server or Managed Server that you want to control with  Node Manager.
 Start & Stop the Node Manager:

  • To Start Node Manager: $WL_HOME\server\bin\startNodeManager.sh
  • To Stop Node Manager: There is no script to stop NodeManager, you need to find process ID of Node Manager and kill it.  Kill – 9 <PID>

Oracle WebLogic Subdeployment

The JMS Module resources can be deployed on a particular JMS Server.

Standalone queues or topics can only be targeted to a single JMS server. Whereas, connection factories, uniform distributed destinations (UDDs), and foreign servers can be targeted to one or more JMS servers, one or more server instances, or to a cluster. Therefore, standalone queues or topics cannot be associated with a subdeployment if other members of the subdeployment are targeted to multiple JMS servers. However, UDDs can be associated with such subdeployments since the purpose of UDDs is to distribute its members to multiple JMS servers in a domain.

For this reason, in a WebLogic JMS Module we can define a subdeployment.

Each subdeployment has a particular target !!!
To see the subdeployments we have for a JMS Module, we can open the WebLogic Administration Console, go to the Domain Structure -> Services -> Messaging -> JMS Module. Click on a JMS Module and after that click on the "Subdeplyments" tab. On this page we can see the combination of subdeployments, resources and targets:


Click a subdeployment to see the possible targets for that subdeployment:


You can see that a target could be an Admin Server, a Managed Server, a WebLogic Cluster or a WebLogic JMS Server.

WebLogic Virtual Host

Virtual hosting :

It is the ability to run multiple web sites ( for instance www.google.com and www.google2.com) on a single web server. 

Name-based virtual hosting implies that you map multiple domain names or logical hosts to the same IP address. 

WebLogic Server allows you to create a virtual host for any number of different domain names.
To configure the DNS server that the www.google.com and www.google2.com return the same IP address 

The WebLogic instance you have to create 2 virtual hosts for the 2 sites and here is the  configuration page of a Virtual host.

Monitor virtual hosts:

To check status of a monitor virtual host:
From the WebLogic Domain dropdown menu, select Environment, then select Virtual Hosts.

The Virtual Hosts table displays information about each virtual host that has been configured in the current domain, including:

  • Name
  • Virtual Host Names
  • Network Access Point
  • Frontend Host
  • Frontend HTTP Port
  • Frontend HTTPS Port

Saturday 17 November 2018

upgradation of weblogic 10.3.6 to 12.1.3

Steps for reconfiguring a WebLogic domain created with WebLogic 10.3.6 for running under WebLogic 12.1.3:

 1) Install last JRockit or JDK-7

 2) Install WebLogic 12.1.3

 3) Backup old WebLogic domain folder with its AdminServer and managed servers Move the old domain folder to weblogic 12.1.3 domains folder. The reconfiguration wizard updates the domain on selected folder, will not create a new weblogic 12.1.2 domain folder.

 4) Start reconfig.sh (on Linux) or reconfig.cmd (on Windows) under $WL_HOME/common/bin

Here are the screen you can see:
reconfigure weblogic domain : select domain
Choose an existing domain location and click on "Next".

weblogic domain reconfiguration: setup
When the setup progress is at 100%, click on "Next".
weblogic domain reconfiguration: mode and jdk
Choose the JDK Home Location and click on "Next".
weblogic domain reconfiguration: nodemanager
Set the Node Manager Type, Node Manager Configuration and Node Manager Credentials and click on "Next".
weblogic domain reconfiguration: advanced
I don't need to add/delete/ modify settings, so click on "Next".
weblogic domain reconfiguration: summary
See the Configuration Summary and click on "Reconfig".
weblogic domain reconfiguration: progress
Click on "Next".
weblogic domain reconfiguration: success
Here is the domain reconfiguration. Click on "Finish".
Using the WebLogic Administration Console, you can see the domain new version:
weblogic domain reconfiguration: verification

Configuration Steps for the WEBLOGIC DOMAIN

STEP 1: CREATE THE WEBLOGIC DOMAIN

WebLogic domain will require the following to configure
• Machine 1
• Admin Server*
• Managed Server 1
• Machine 2
• Managed Server 2

• Each WebLogic machine must be point to a unique running Node Manager instance .

• Each Managed Server must use a floating IP address for the host name. The floating IP address for Managed Server 1 & 2 must be unique.

• The Admin Server must have IP address for the host name if the manual Admin Server
Migration support is required.

STEP 2: SETUP THE NODE MANAGER
The nodemanager.properties file for each Node Manager instance must be updated to indicate the netmask and network device name (interface) to be used throughout the server migratable cluster.

Below is an example of the specific Node Manager properties that are required for server migration configuration.

Sample Node Manager properties:

Interface=eth0
NetMask=255.255.255.0
UseMACBroadcast=true

The nodemanager.properties is in the location

FMW_HOME/wlserver_10.3/server/lib

STEP 3: SETUP THE LEASING PROCESS

There are two types of leasing configurations available:
• Consensus Leasing
• High-Availability Database Leasing

STEP 4: GRANT SUPERUSER PRIVILEGES TO THE WLSIFCONFIG SCRIPT

 Ensure the PATH environment variable contains the following files:
• DOMAIN_HOME/bin/server_migration/wlsifconfig.sh
• WL_HOME/common/bin/wlscontrol.sh
• WL_HOME/common/nodemanager/nodemanager.domains


STEP 5: ENABLE SERVER MIGRATION

The following steps can be followed to enable “Server Migration” via the WebLogic Admin Server.

1. Configure the WebLogic cluster(s):
2. Under Candidate Machines For Migratable Servers select the machines you wish to be migration
3. Set the Migration Basis as required ("Consensus" or "Database"). If using "Database" for
4. Under Candidate Machines select the machines you wish to migrate to from the Available box and move them to the Chosen box

Sunday 11 November 2018

Basics- Oracle Access Manager (OAM), Oracle Identity Manager (OIM)

Oracle Access Manager (OAM)Oracle Access Manager is a J2EE application typically deployed on a dedicated managed server in a Weblogic (Application Server) clustered environment.
An enterprise typically has many applications for different purposes. Each application typically has its own authentication and authorization functionality. All resource grants in an enterprise in OAM have  multiple applications exist on different platform.OAM provides:
  • Single Sign On (SSO)
  • Authentication
  • Authorization
  • Real time session management
  • Auditing
  • Policy Administration
  • Effective Security
  • Cost
  • Inconsistence
  • Security Complainces
  • Ease for users (Single Sign On)
  • Governance, Support and Management
OIM does life cycle management of an identity (generally a user, e.g employee).OIM server is a J2EE application. User provisioning is done in OIM. The OIM integrates this with all the other applications.
All application have their *own* authentication and authorization mechanism.

Oracle WebCenter Portal 12c (12.2.1) – Installation

Steps for installation:

  • Linux 6.7 64 Bit Virtual Machine
  • Oracle Database 12.2.0.4
  • Oracle Fusion Middleware Infrastructure 12.2.1.0
  • Oracle Webcenter Portal 12.2.1
  • Java Development Kit (JDK) 1.8
  • set JAVA_HOME & JAVA executable is added to PATH environment variable.
  • Navigate to software directory and execute infrastructure installer using JAR
  • Click Next on the Welcome screen
  • Select Skip Auto Updates and click Next
  • Provide Middleware Home path and click Next
    • /u01/app/oracle/product/fmw
  • Select Fusion Middleware Infrastructure and click Next
  • Make sure prerequisites are met and click Next
  • uncheck Security Updates and click Next
  • Click Yes on the confirmation screen
  • Click Install in Installation Summary Screen
  • Make sure all installation steps are successful and click Next
  • Click Finish on the Installation Summary screen
  • Navigate to software directory and execute WebCenter Portal installer using Java
  • Click Next on the welcome screen
  • Select “Skip Auto Updates” and click Next
  • Provide Middleware home and click Next. This should be the Middleware home provided during Fusion Infrastructure installation
    • Middleware Home : /u01/app/oracle/product/fmw
  • Select “WebCenter Portal” and click Next
  • Make sure prerequisite checks are successful and click Next
  • Click Install on the “Installation Summary” screen
  • Make sure all installation steps are successful and click Next
  • Click “Finish” on the “installation Complete” screen

Oracle Identity Management (OID) 11.1.1.7 Installation & Configuration

In this post I will cover the installation & configuration of Oracle Identity Management / Oracle Internet Directory step-by-step.
The environment & software I am using:
  • Oracle Linux 6.7 64Bit Virtual Machine
  • Oracle Identity Management 11.1.1.7 Installer
  • Oracle Weblogic Server 10.3.6
  • Oracle Database 11.2.0.4 (for ODS schema)
  • Repository Creation Utility (11.1.1.7 or higher)
  • JDK 1.8
I have pre-built Oracle Linux 6.6 64Bit along with Oracle Database 11.2.0.4 installation and not covering that part here.

Database Pre-requisites

1.Connect to the database as SYS.
2. Set OPEN_CURSORS to 500. (If you are planning to use the same database for Oracle Identity & Access Management, make it 800)
alter system set open_cursors=500 scope=both;
3. Set PROCESSES to 500
alter system set processes=500 scope=spfile;
4. If you are running database 11.2.0.4, please grant execute privileges on DBMS_REPUTIL to public.
grant execute on DBMS_REPUTIL to public;

Operating System Pre-requisites

1.Open files. Add below lines in “/etc/security/limits.conf
* soft nofile 4096
* hard nofile 65536
* soft nproc 2047
* hard nproc 16384
2. Add above values in /etc/security/limits.d/90-nproc.conf for Oracle Linux or Red Hat Linux servers.
3. Make sure below required libraries are installed.
  • binutils-2.20.51.0.2-5.28.el6
  • compat-libcap1-1.10-1
  • compat-libstdc++-33-3.2.3-69.el6 for x86_64
  • compat-libstdc++-33-3.2.3-69.el6 for i686
  • gcc-4.4.4-13.el6
  • gcc-c++-4.4.4-13.el6
  • glibc-2.12-1.7.el6 for x86_64
  • glibc-2.12-1.7.el6 for i686
  • glibc-devel-2.12-1.7.el6 for i686
  • libaio-0.3.107-10.el6
  • libaio-devel-0.3.107-10.el6
  • libgcc-4.4.4-13.el6
  • libstdc++-4.4.4-13.el6 for x86_64
  • libstdc++-4.4.4-13.el6 for i686
  • libstdc++-devel-4.4.4-13.el6
  • libXext for i386
  • libXtst for i386
  • libXi for i386
  • openmotif-2.2.3 for x86_64Footref 7
  • openmotif22-2.2.3 for x86_64Footref 7
  • redhat-lsb-4.0-3.el6 for x86_64
  • sysstat-9.0.4-11.el6
4. To check if the package is installed or not, run below command
rpm -qa | grep package_name
5. Install any missing RPM using root login. Execute “yum update” before installing. (updating yum is not mandatory but recommended)
yum search package_name
yum install package_name

Repository Creation using RCU

1.Extract RCU software, navigate to rcuHome/bin and execute RCU
./rcu
2. Click “Next” on Welcome Screen


3. Select “Create” and click “Next”


4. Provide database details and click “Next”. Make sure you use ID with SYSDBA privileges.


5. Make sure all prerequisites are satisfied and click “Ok”


6. Provide prefix of your choice. Expand “Identity Management” and select “oracle Internet Directory”. In the below screenshot I have selected Access Manager & Identity Manager as I will be using the same database for OIAM setup as well. If you are not intending to setup OIAM, please select only Oracle Internet Directory.


7. Make sure component specific prerequisites are successful and click “Ok”


8. Provide password for schema. You can either use same password for all the schema or use different password for each schema.


9. Review tablespaces and click “Next”. If you wish to change the table spaces, you can do so using “Manage Tablespaces” button.


10. Click “Ok” on create tablespaces confirmation screen.


11. Make sure tablespaces are created successfully and click “Ok”


12. Review the parameters and click “Create”


13. Wait till all the schema gets created.


14. Make sure the status is success for all the schema and click “Close”

Oracle Weblogic Server 10.3.6 Installation

1.Make sure java is installed and is added in PATH.
which java
java -version
2. Navigate to the directory where wls1036_generic.jar is located and execute below command to start the Weblogic installer
java -jar wls1036_generic.jar


3. Click “Next” on the welcome screen.


4. Provide a location for new middleware home (/u01/app/oracle/product/fmw). This will be the base directory where additional Oracle Homes will be installed later.


5. Uncheck securyty updates and click “Next”. The installer will ask you 3 times for confirmation. yes three times !!


6. Select “Typical” and click “Next”. This will install Weblogic and Coherence by default.


7. Verify JDK path and click “Next”


8. Verify Weblogic & Coherence paths and click “Next”. Change the if you wish to.


9. Click “Next” on the “Installation Summary” screen.


10. Installation in progress.


11. Click “Done” on “Installation Complete” screen.

Oracle Identity Management Installation

1.Extract the software zip and navigate to Disk1.
./runInstaller


2. Click “Next” on welcome screen.


3. Skip software updates and click “Next”.


4. Select “Install and Configure” and click “Next”.


5. Make sure all prerequisite checks are successful and click “Next”.


6. Select “Create New Domain”. Provide Weblogic usename, password & domain name as below.


7. Specify below details on “Installation Location” screen
  • Oracle Middleware Home: /u01/app/oracle/product/fmw (This should be the middleware home you created during Weblogic installation)
  • Oracle Home Directory: Oracle_IDM1 (This the IDM Oracle Home created inside your middleware home)
  • Weblogic Server Directory: /u01/app/oracle/product/fmw/wlserver_10.3 (This is the Weblogic server directory provided during Weblogic Installation
  • Oracle Instance Location: /u01/app/oracle/product/fmw/instances/oid_inst1 (This is OID instance home where opmn will be installed)
  • Oracle Instance Name: oid_inst1 (This is the name of your OID instance)


8. Uncheck security updates and click “Next”


9. Click “Yes” on confirmation screen.


10. Select below components
  • Oracle Internet Directory
  • Oracle Directory Integration Platform
  • Oracle Enterprise Manager (Mandatory)
  • Oracle Directory Services Manager – ODSM (Mandatory)
I am not covering OVD. So left it unchecked.


11. Select “Auto Port Configuration” and click “Next”
  • Default OID Port: 3060
  • Default OID SSL Port: 3131
If you wish to change the ports, add below lines to staticports.ini and select “Specify ports using configuration filr”
#Oracle Internet Directory port = 389

#Oracle Internet Directory (SSL) port = 636


12. Select “Use Existing Schema” and provide ODS schema details and click “Next”
  • Connect String: localhost:1521:orcl
  • Schema Name: ODS (Cannot be changed)
  • Password: ODS schema password provided during repository creation


13. OID Configuration
  • Realm: dc=company,dc=com (This will be the root domain of your OID)
  • Administrator User Name: cn=orcladmin (Cannot be changed. If needed you can add more administrators later using LDAP or ODSM console)
  • Administrator Password: This password will be used to connect to OID.


14. Click “Install” on Summary screen.


15. Installation progress.


16. When prompted, execure below script as root and click “Ok”
/u01/app/oracle/product/fmw/Oracle_IDM1/oracleRoot.sh


17. Configuration Progress screen.


18. Make sure all configuration steps are successful and click “Next”


19. Click “Finish” on the installation complete screen.


20. Verify OPMN using opmnctl
cd /u01/app/oracle/product/fmw/instances/oid_inst1/bin

./opmnctl status -l


21. Verify below ports listen status using netstat
netstat -an | grep port_num
  • 3060 – OID Port
  • 3161 – OID SSL Port
  • 7001 – Weblogic Admin Server Port
  • 7005 – ODS Managed Server Port (ODSM runs on this port)


22. Access ODSM console
http://localhost:7005/odsm


23. Create new OID connection using the menu on top right corner and click “Connect”
  • Directory Type: OID
  • Name: Any name you prefer
  • Server: localhost
  • Port: 3060 (or 3161 if you want to connect to SSL port)
  • User Name: cn=orcladmin
  • Password: Password provided during IDM installation


24. ODSM home screen. Verify if the root domain is created successfully.


Thats It !! You now have a working installation of OID. Hope this helps.