Sunday, December 22, 2019

Steps for unlocking Linux user account

Connect as root and switch to <locked_user_account> and execute the below steps:
me@mordor:~> sudo /sbin/pam_tally --user frodo
User frodo    (500)   has 32
After unlocking the userID password, I was able to login with the new credentials and avoid the error message.
me@mordor:~> sudo /sbin/pam_tally --user frodo --reset
User frodo    (500)   had 32
me@mordor:~> sudo /sbin/pam_tally --user frodo
User frodo    (500)   has 0

Wednesday, April 4, 2018

Updating Jdev with customer EM security policies


Follow the below 3 step procedure :

1.      Export the custom policy from EM to local
2.      Unzip and place the policy file under Jdev owsm  path (eg:  C:\Users\hyanamal\AppData\Roaming\JDeveloper\system12.2.1.0.42.151011.0031\DefaultDomain\store\gmds\owsm\policies’)
3.      Restart Jdev.

Friday, February 23, 2018

Oracle DB Silent Installation

Install Oracle in silent mode 12C Release 1 (12.1) on OEL7

This article presents how to install Oracle 12C(12.1) Release 1 on Oracle Enterprise Linux 7 (OEL7) in silent mode.
Read following article how to install Oracle Enterprise Linux 7: Install Oracle Linux 7 (OEL7) (for comfort set 4G memory for your virtual machine before proceeding with Oracle software installation).
Software
Software for 12CR1 is available on OTN or edelivery
Database software
linuxamd64_12102_database_1of2.zip 
linuxamd64_12102_database_2of2.zip
OS configuration and preparation
OS configuration is executed as root. To login as root just execute following command in terminal.
su - root
The “/etc/hosts” file must contain a fully qualified name for the server.
<IP-address>  <fully-qualified-machine-name>  <machine-name>
For example.
127.0.0.1 oel7 oel7.dbaora.com localhost.localdomain localhost
Set hostname
hostnamectl set-hostname oel7.dbaora.com --static
Add groups
#groups for database management
groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
groupadd -g 54324 backupdba
groupadd -g 54325 dgdba
groupadd -g 54326 kmdba
groupadd -g 54327 asmdba
groupadd -g 54328 asmoper
groupadd -g 54329 asmadmin
Add user Oracle for database software
useradd -u 54321 -g oinstall -G dba,oper,backupdba,dgdba,kmdba oracle
Change password for user Oracle
passwd oracle
Packages
Check which packages are installed and which are missing
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n' binutils \
compat-libcap1 \
compat-libstdc++-33 \
gcc \
gcc-c++ \
glibc \
glibc-devel \
ksh \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
libXi \
libXtst \
make \
sysstat
In my case it returns following
binutils-2.23.52.0.1-55.el7(x86_64)
compat-libcap1-1.10-7.el7(x86_64)
compat-libstdc++-33-3.2.3-72.el7(x86_64)
gcc-4.8.5-4.el7(x86_64)
gcc-c++-4.8.5-4.el7(x86_64)
glibc-2.17-106.0.1.el7_2.8(x86_64)
glibc-devel-2.17-106.0.1.el7_2.8(x86_64)
package ksh is not installed
libaio-0.3.109-13.el7(x86_64)
libaio-devel-0.3.109-13.el7(x86_64) is not installed 
libgcc-4.8.5-4.el7(x86_64)
libstdc++-4.8.5-4.el7(x86_64)
libstdc++-devel-4.8.5-4.el7(x86_64)
libXi-1.7.4-2.el7(x86_64)
libXtst-1.2.2-2.1.el7(x86_64)
make-3.82-21.el7(x86_64)
sysstat-10.1.5-7.el7(x86_64)
You can install missing packages from dvd. Just mount it and install missing packages using rpm -Uvh command from directory <mount dvd>/Packages or by using yum install command.
NOTE – I’m using x86_64 version of packages
First option from dvd
rpm -Uvh libaio-devel*.x86_64.rpm
rpm -Uvh ksh*.x86_64.rpm
Second option using yum install command. It requires access to internet.
yum install libaio-devel*.x86_64
yum install ksh*.x86_64
Add kernel parameters to /etc/sysctl.conf
# kernel parameters for 12gR1 installation

fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
kernel.panic_on_oops=1
Apply kernel parameters
/sbin/sysctl -p
Add following lines to set shell limits for user oracle in file /etc/security/limits.conf
# shell limits for users oracle 12gR1

oracle   soft   nofile   1024
oracle   hard   nofile   65536
oracle   soft   nproc    2047
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768
If the system is running in PERMISSIVE or DISABLED mode, modify file /etc/selinux/config and set SELINUX to enforcing as shown below.
SELINUX=enforcing
The modification of the file takes effect after a reboot. To change immediately without a reboot, run the following command:
setenforce 1
Disable firewall
service iptables stop
chkconfig iptables off
Additional steps
Add following lines in .bash_profile for user oracle
# Oracle Settings
export TMP=/tmp

export ORACLE_HOSTNAME=oel7.dbaora.com
export ORACLE_UNQNAME=ORA12C
export ORACLE_BASE=/ora01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1
export ORACLE_SID=ORA12C

PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;

alias cdob='cd $ORACLE_BASE'
alias cdoh='cd $ORACLE_HOME'
alias tns='cd $ORACLE_HOME/network/admin'
alias envo='env | grep ORACLE'

umask 022

if [ $USER = "oracle" ]; then
    if [ $SHELL = "/bin/ksh" ]; then
       ulimit -u 16384 
       ulimit -n 65536
    else
       ulimit -u 16384 -n 65536
    fi
fi

envo
Directory structure
Create directory structure as user root
ORACLE_BASE – /ora01/app/oracle
ORACLE_HOME – /ora01/app/oracle/product/12.1.0/db_1
mkdir -p /ora01/app/oracle/product/12.1.0/db_1
chown oracle:oinstall -R /ora01
In Oracle Enterprise Linux 7 /tmp data is stored on tmpfs which consumes memory and is too small. To revert it back to storage just run following command and REBOOT machine to be effective.
systemctl mask tmp.mount
Prepare database software for installation
su - oracle

--unizp software it will create directory "database" 
--where you can find installation software
unzip linuxamd64_12102_database_1of2.zip
unzip linuxamd64_12102_database_2of2.zip

--I defined 4 aliases in .bash_profile of user oracle to make 
--administration easier :)

[oracle@oel7 ~]$ alias envo cdob cdoh tns
alias envo='env | grep ORACLE'
alias cdob='cd $ORACLE_BASE'
alias cdoh='cd $ORACLE_HOME'
alias tns='cd $ORACLE_HOME/network/admin'

--run alias command envo to display environment settings
envo
ORACLE_UNQNAME=ORA12C
ORACLE_SID=ORA12C
ORACLE_BASE=/ora01/app/oracle
ORACLE_HOSTNAME=oel7.dbaora.com
ORACLE_HOME=/ora01/app/oracle/product/12.1.0/db_1

--run alias command cdob and cdoh 
--to check ORACLE_BASE, ORACLE_HOME 
[oracle@oel7 ~]$ cdob
[oracle@oel7 oracle]$ pwd
/ora01/app/oracle

[oracle@oel7 db_1]$ cdoh
[oracle@oel7 db_1]$ pwd
/ora01/app/oracle/product/12.1.0/db_1
Response files
Once Oracle 12CR1 binaries are unzipped you can find in directory /home/oracle/database/response dedicated files called “response files” used for silent mode installations.
The response files store parameters necessary to install Oracle components:
  • db_install.rsp – used to install oracle binaries, install/upgrade a database in silent mode
  • dbca.rsp – used to install/configure/delete a database in silent mode
  • netca.rsp – used to configure simple network for oracle database in silent mode
cd /home/oracle/database/response

[oracle@oel7 response]$ ls
dbca.rsp  db_install.rsp  netca.rsp
Install Oracle binaries
It’s the best to preserve original response file db_install.rsp before editing it
[oracle@oel7 response]$ cp db_install.rsp db_install.rsp.bck
Edit file db_install.rsp to set parameters required to install binaries. This is just example and in next releases parameters can be different. Each of presented parameter is very well described in db_install.rsp. I just give here brief explanations.
--------------------------------------------
-- force to install only database software
--------------------------------------------
oracle.install.option=INSTALL_DB_SWONLY

--------------------------------------------
-- set your hostname
--------------------------------------------
ORACLE_HOSTNAME=oel7.dbaora.com

--------------------------------------------
-- set unix group for oracle inventory
--------------------------------------------
UNIX_GROUP_NAME=oinstall

--------------------------------------------
-- set directory for oracle inventory
--------------------------------------------
INVENTORY_LOCATION=/ora01/app/oraInventory

--------------------------------------------
-- set oracle home for binaries
--------------------------------------------
ORACLE_HOME=/ora01/app/oracle/product/12.1.0/db_1

--------------------------------------------
-- set oracle home for binaries
--------------------------------------------
ORACLE_BASE=/ora01/app/oracle

--------------------------------------------
-- set version of binaries to install
-- EE - enterprise edition
--------------------------------------------
oracle.install.db.InstallEdition=EE

--------------------------------------------
-- specify extra groups for database management
--------------------------------------------
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oper
oracle.install.db.BACKUPDBA_GROUP=backupdba
oracle.install.db.DGDBA_GROUP=dgdba
oracle.install.db.KMDBA_GROUP=kmdba
once edition is completed. Start binaries installation. Extra parameters where used to avoid problems with starting installation:
  • DECLINE_SECURITY_UPDATES=true
  • SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
cd /home/oracle/database
./runInstaller -silent \
-responseFile /home/oracle/database/response/db_install.rsp \
DECLINE_SECURITY_UPDATES=true \
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
output is following
[oracle@oel7 database]$ ./runInstaller -silent \
> -responseFile /home/oracle/database/response/db_install.rsp \
> DECLINE_SECURITY_UPDATES=true \
> SECURITY_UPDATES_VIA_MYORACLESUPPORT=false

Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB.   
Actual 47410 MB    Passed
Checking swap space: must be greater than 150 MB.   
Actual 4095 MB    Passed
Preparing to launch Oracle Universal Installer from 
/tmp/OraInstall2016-10-07_04-14-20PM. Please wait ...
[oracle@oel7 database]$ You can find the log 
of this install session at:
 /ora01/app/oraInventory/logs/installActions2016-10-07_04-14-20PM.log
The installation of Oracle Database 12c was successful.
Please check 
'/ora01/app/oraInventory/logs/silentInstall2016-10-07_04-14-20PM.log' 
for more details.

As a root user, execute the following script(s):
    1. /ora01/app/oraInventory/orainstRoot.sh
    2. /ora01/app/oracle/product/12.1.0/db_1/root.sh

Successfully Setup Software.
you are asked to run two scripts as user root. Once it’s done binaries are installed
[root@oel7 /]# 

/ora01/app/oraInventory/orainstRoot.sh
/ora01/app/oracle/product/12.1.0/db_1/root.sh
quick binary verification
[oracle@oel7 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Fri Oct 7 16:21:13 2016
Copyright (c) 1982, 2014, Oracle.  All rights reserved.
Connected to an idle instance.

SQL>
Configure Oracle Net
Again based on response file Oracle Net will be configured
cd /home/oracle/database/response
cp netca.rsp netca.rsp.bck
You can edit netca.rsp to set own parameters. I didn’t changed anything here. So just start standard configuration. It will configure LISTENER with standard settings.
netca -silent -responseFile /home/oracle/database/response/netca.rsp
example output
[oracle@oel7 response]$ netca -silent \
-responseFile /home/oracle/database/response/netca.rsp

Parsing command line arguments:
  Parameter "silent" = true
  Parameter "responsefile" = /home/oracle/database/response/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
  Running Listener Control: 
    /ora01/app/oracle/product/12.1.0/db_1/bin/lsnrctl start LISTENER
  Listener Control complete.
  Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0
Check LISTENER status
[oracle@oel7 response]$ lsnrctl status

LSNRCTL for Linux: Version 12.1.0.2.0 - 
Production on 07-OCT-2016 16:40:41

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Connecting to 
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)
(HOST=oel7.dbaora.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - 
Production
Start Date                07-OCT-2016 16:35:22
Uptime                    0 days 0 hr. 5 min. 18 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   
/ora01/app/oracle/product/12.1.0/db_1/network/admin/listener.ora
Listener Log File         
/ora01/app/oracle/diag/tnslsnr/oel7/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel7)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
Configure database
The last setup is to create new container database ORA12C.dbaora.com with one pluggable database PORA12C1 and configure and enable oracle db express
Prepare directories for database datafiles and flash recovery area
mkdir /ora01/app/oracle/oradata
mkdir /ora01/app/oracle/flash_recovery_area
backup original response file for dbca
cd /home/oracle/database/response

cp dbca.rsp dbca.rsp.bck
vi dbca.rsp
set own parameters
--------------------------------------------
-- global database name
--------------------------------------------
GDBNAME = "ORA12C.dbaora.com"

--------------------------------------------
-- instance database name
--------------------------------------------
SID = "ORA12C"

CREATEASCONTAINERDATABASE = true
NUMBEROFPDBS = 1
PDBNAME = PORA12C1
PDBADMINPASSWORD = "oracle"

--------------------------------------------
-- template name used to create database
--------------------------------------------
TEMPLATENAME = "General_Purpose.dbc"

--------------------------------------------
-- password for user sys
--------------------------------------------
SYSPASSWORD = "oracle"

--------------------------------------------
-- password for user system
--------------------------------------------
SYSTEMPASSWORD = "oracle"

--------------------------------------------
-- configure dbexpress with port 5500
--------------------------------------------
EMCONFIGURATION = "DBEXPRESS"
EMEXPRESSPORT = "5500"

--------------------------------------------
-- password for dbsnmp user
--------------------------------------------
DBSNMPPASSWORD = "oracle"

--------------------------------------------
-- default directory for oracle database datafiles
--------------------------------------------
DATAFILEDESTINATION = /ora01/app/oracle/oradata

--------------------------------------------
-- default directory for flashback data
--------------------------------------------
RECOVERYAREADESTINATION = /ora01/app/oracle/flash_recovery_area

--------------------------------------------
-- storage used for database installation
-- FS - OS filesystem
--------------------------------------------
STORAGETYPE = FS

--------------------------------------------
-- database character set
--------------------------------------------
CHARACTERSET = "AL32UTF8"

--------------------------------------------
-- national database character set
--------------------------------------------
NATIONALCHARACTERSET = "AL16UTF16"

--------------------------------------------
-- listener name to register database to
--------------------------------------------
LISTENERS = "LISTENER"

--------------------------------------------
-- force to install sample schemas on the database
--------------------------------------------
SAMPLESCHEMA=TRUE

--------------------------------------------
--specify database type
--has influence on some instance parameters
--------------------------------------------
DATABASETYPE = "OLTP"

--------------------------------------------
-- force to use autmatic mamory management
--------------------------------------------
AUTOMATICMEMORYMANAGEMENT = "TRUE"

--------------------------------------------
-- defines size of memory used by the database
--------------------------------------------
TOTALMEMORY = "1024"
run database installation.
NOTE: I had a problem to start it on standard VBox machine. DBCA was hanging even if started manually only splash screen was seen.
Solution is to:
  1. Open VirtualBox Manager
  2. Shutdown the machine in question
  3. Select the machine in question
  4. Click Machine > Settings
  5. Click System
  6. Click Acceleration Tab
  7. Change Paravirtualization Interface from Default to Legacy
  8. Click OK
dbca -silent -responseFile /home/oracle/database/response/dbca.rsp
Example output
[oracle@oel7 ~]$ dbca -silent -responseFile 
/home/oracle/install/database/response/dbca.rsp
Copying database files
1% complete
2% complete
27% complete
Creating and starting Oracle instance
29% complete
32% complete
33% complete
34% complete
38% complete
42% complete
43% complete
45% complete
Completing Database Creation
48% complete
51% complete
53% complete
62% complete
64% complete
72% complete
Creating Pluggable Databases
78% complete
100% complete
Look at the log file 
"/ora01/app/oracle/cfgtoollogs/dbca/ORA12C/ORA12C.log" 
for further details.
Verify connection
[oracle@oel7 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Fri Oct 7 17:41:35 2016
Copyright (c) 1982, 2014, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 
64bit Production
With the Partitioning, OLAP, Advanced Analytics 
and Real Application Testing options

SQL> show parameter db_name

NAME      TYPE        VALUE
--------- ----------- ----------
db_name        string     ORA12C

SQL> alter session set container=PORA12C1;
Session altered.

SQL> show con_id
CON_ID
------------------------------
3

SQL> show con_name
CON_NAME
------------------------------
PORA12C1
Check port status of db express
SQL> select DBMS_XDB_CONFIG.GETHTTPSPORT 
from dual;

GETHTTPSPORT
------------
    5500
Edit the “/etc/oratab” file to set restart flag for ORA12C to ‘Y’.
ORA12C:/ora01/app/oracle/product/12.1.0/db_1:Y
Have a fun ðŸ™‚

Monday, February 29, 2016

Steps for creating a weblogic login user

Many times we want to Alter WebLogic Admin Username and passwords on a Routine Basis…
If you want to Reset The WebLogic Username and Password then Please follow the Steps mentioned Below…(EXACTLY):
Step1). open a Command Prompt and then run “setDomainEnv.sh” or “setDomainEnv.cmd”.
Step2). Just for Safety Take a Backup of (C:bea103user_projectsdomains7001_Domainsecurity*DefaultAuthenticatorInit.ldift*) file …because in the Next Command which we are going to run is going to Create a New File “DefaultAuthenticatorInit.ldift”.
Step3). In the Command Window Move inside your Domain’s Security Directory…And then Run the Following Command:
Example: C:bea103user_projectsdomains7001_Domainsecurity>java weblogic.security.utils.AdminAccount newAdmin newPassword .
Syntax: java weblogic.security.utils.AdminAccount <NewAdminUserName> <NewAdminPassword>
NOTE:- There is a . (DOT) at the end of the Above command which represents the Current Directory. Here you can see that after this command Executes A new “DefaultAuthenticatorInit.ldift” file will be created in the Current Directory.

IMPORTANT STEP   [This Step 3-A) U Need Not to Follow If you Already Forgot your Admin Credentials]


Step3-A).  Login to Admin Console
Security Realms—> myrealm(Your realm Name)—> Migration(Tab)—> Export (Tab)
Here please provide a Directory location for “Export Directory on Server:” TextBox (Example: C:UserData)
Click on “Save” button…you will find that in the Directory which you have specified you will get :
DefaultAuthenticator.dat
DefaultCredentialMapper.dat
exportIndex.dat
XACMLAuthorizer.dat
XACMLRoleMapper.dat

Step 4). In the Same command prompt Move inside the admin Server folder inside your domain. And then Just remname the “data” folder to something else ….like “data_OLD” this is a way of taking safe backup….
Example: C:bea103user_projectsdomains7001_DomainserversAdminServer> rename data data_OLD
Step 5). Now Similarly rename the boot.properties as well to an other File….
Example: C:bea103user_projectsdomains7001_DomainserversAdminServersecurity> rename boot.properties boot.properties_OLD
Step 6). Make sure that “boot.properties” file exists….If yes then Now start The Admin Server….
While starting it will ask for the UserName and Password to be entered as ..we havenot created any “boot.properties” file at present. But it is always recommended that u create the “boot.properties” file on your own …to prevent WebLogic Prompting you for Admin Username & Passwords while starting the Server.
————> At the End Login to Admin Console with the New Useraname and Password—–> Check the Users in Security realms …you will not find any user with name “weblogic” There….
This is most important Step:  Because Sometimes we face this kind of issue if you have provided a Wrong format in your “boot.properties” file there should be NO Special Charachers (UTF or Invisible sharacters) Or NO Space in your “boot.properties” file …except below two Lines:
1
2
username=MyAdminUserName
password=MyAdminPassword
Please edit this File very carefully….better use Noteopad kind of Simple Editors.
Use “ls” (Unix command) or “dir” Windows Command to Make Sure that the File Extension is “boot.properties” only…and not “boot.properties.txt” or something else.
Note: There should be No Heading Or Trailing SPACE character in these two Lines.
Step 7).  To import other User Data back Please do the following:
Login to Admin Console
Security Realms—> myrealm(Your realm Name)—> Migration(Tab)—> Import (Tab)

Now provide the folder Name where u have all the above files:
DefaultAuthenticator.dat
DefaultCredentialMapper.dat
exportIndex.dat
XACMLAuthorizer.dat
XACMLRoleMapper.dat

Enjoy….

Monday, June 30, 2014

PnYnMnDTnHnMnS DateTime Format

Specifying a duration:
Time durations are specified in the format:
PnYnMnDTnHnMnS
where,
P - is a required character that represents period, the duration designator. All duration expressions always start with a P
Y - is the year designator. For example, to indicate 19 years, you'd use19Y
M - is the month designator. For example, to indicate 10 years, you'd use10M
D - is the days designator. For example, to indicate 28 days, you'd use 28D
T - is an optional character that indicates the start of the time duration
H - is the hour designator. For example, to indicate 10 hours, you'd use10H
M - is the minute designator. For example, to indicate 37 minutes, you'd use 37M
S - is the seconds designator. For example, to indicate 46 seconds, you'd use 46S

duration samples:
So to specify a duration of 19 years, 10 months, 28 days, 10 hours, 37 minutes, and 46 seconds, the duration expression would look like P19Y10M28DT10H37M46S. If you want to use it in a BPEL <wait> activity, it would read:
<wait for="'P19Y10M28DT10H37M46S'"/>
which means wait for a duration of 19 years, 10 months, 28 days, 10 hours, 37 minutes, and 46 seconds.

Similarly, to specify a duration of 1 year, 2 months, and 3 days, the duration expression would look like P1Y2M3D. If you want to use it in a BPEL <wait> activity, it would read:
<wait for="'P1Y2M3D'"/>
which means wait for a duration of 1 year, 2 months, and 3 days.

Similarly, to specify a duration of 1 hour, and 2 minutes, the duration expression would look like PT1H2M. If you want to use it in a BPEL <wait> activity, it would read:
<wait for="'PT1H2M'"/>
which means wait for a duration of 1 hour, and 2 minutes.

Specifying date and time:
Specific date and time references have the form:
CCYY-MM-DDThh:mm:ss
where,
CC - is the century designator, specified as 2 or more digits. Valid range from 00 to ...
YY - is the year designator, specified as 2 digits. Valid range from 00 to 99.
MM - is the month designator, specified as 2 digits. Valid range from 01 to 12.
DD - is the day designator, specified as 2 digits. Valid range from 01 to 31.
T - indicates the start of the time designator.
hh - is the hour designator, specified as 2 digits. Valid range from 00 to 23.
mm - is the minute designator, specified as 2 digits. Valid range from 00 to 59.
ss - is the seconds designator, specified as 2 digits with an optional decimal value allowed of the form ss.ssss to increase precision. Valid range from 00 to 59.
z - is the optional Coordinated Universal Time (UTC). If present, it should immediately follow the time element. To specify an offset from the UTC time, append a positive(+) or negative(-) time to the datetime value of the form hh:mm.

datetime samples:
So, to specify 10:28:19am, 28th October 2008, the datetime expression would look like 2008-10-28T10:28:19. If you want to use it in a BPEL <wait> activity, it would read:
<wait until="'2008-10-28T10:28:19'"/>
which means wait until the deadline 10:28:19am, 28th October 2008.

Similarly, to specify 07:30:00pm, the datetime expression would look like 19:30:00. If you want to use it in a BPEL<wait> activity, it would read:
<wait until="'19:30:00'"/>
which means wait until the deadline 07:30:00pm.

UTC datetime samples:
Similarly, to specify 10:28:19am in UTC, the datetime expression would look like 10:28:19z. If you want to use it in a BPEL <wait> activity, it would read:
<wait until="'10:28:19z'"/>
which means wait until the deadline 10:28:19am, in UTC.

Similarly, if the UTC time was 6:30:19pm 28th October 2008, to specify 10:30:19am, 28th October 2008 California time (Pacific Standard Time which is UTC-08:00), the datetime expression would look like 2008-10-28T18:30:19-08:00. If you want to use it in a BPEL <wait> activity, it would read:
<wait until="'2008-10-28T18:30:19-08:00'"/>
which means wait until the deadline 10:30:19am, 28th October 2008 California time(Pacific Standard Time).

Similarly, if the UTC time was 10:00:19am 28th October 2008,  to specify 03:30:19pm, 28th October 2008 Indian Standard time (which is UTC+05:30), the datetime expression would look like 2008-10-28T10:00:19+05:30. If you want to use it in a BPEL <wait> activity, it would read:
<wait until="'2008-10-28T10:00:19+05:30'"/>
which means wait until the deadline 03:30:19pm, 28th October 2008 Indian standard time.

Saturday, June 8, 2013

Timeout setting in SOA 11g for tuning BPELs

Configure Transaction Timeout or Tune Up BPEL SOA 11g for rolled back error or Timed out Exception

Problem:
During runtime you may be seeing errors in the log similar to the following:
The transaction was rolled back
 and / or
<faultstring>java.lang.IllegalStateException: Cannot call setRollbackOnly() current thread is NOT associated with a transaction</faultstring>
 and / or
Transaction Rolledback.: weblogic.transaction.internal.TimedOutException: Transaction timed out
The solution is typically to increase the transaction timeout for the process.

Solution:
 
As a general rule, you should keep the following relation between the timeout parameters: 
syncMaxWaitTime < BPEL EJB's transaction timeout < Global Transaction Timeout(JTA) 
Few recommendations are, 
900<1800<2400 - For Medium load
900<3200<3600 - For Large load
sometimes depending on your requirement/load you might need to go for higher values. 

1. Setting syncMaxWaitTime: 
This property controls the maximum time the process result receiver will wait for a result before returning for Sync processes.
 For SOA 11g R1 PS1 (11.1.1.1.0 to 11.1.1.5):
 * Login into EM
* Expand SOA and right click on "soa-infra" and select: SOA Administration -> BPEL Properties
* Click on "More BPEL Configuration Properties..." link
* Locate syncMaxWaitTime and change it. 

2. Setting the transaction timeout for BPEL EJBs: 
The timeout properties for the EJBs control the particular timeout setting for the SOA application, overriding the global setting specified by the JTA timeout.
* Log into Oracle WebLogic Administration Console.
* Click Deployments.
* Expand soa-infra -> EJBs.
* Following EJBs need to be updated: 
BPELActivityManagerBean
BPELDeliveryBean
BPELDispatcherBean
BPELEngineBean
BPELFinderBean
BPELInstanceManagerBean
BPELProcessManagerBean
BPELSensorValuesBean
BPELServerManagerBean
 
* You can change the parameter in the Configuration tab for the Transaction Timeout setting.
* Click Save.
* Save the Plan.xml to some known location - Ensure no other file is named Plan.xml.
* Update soa-infra deployment.
* Start SOA Managed Server. 

3. Setting the global transaction timeout at Weblogic Domain Level: 
This property controls the transaction timeout seconds for active transactions. If the transaction is still in the "active" state after this time, it is automatically rolled back.
* Log into Oracle WebLogic Administration Console.
* Click Services -> JTA.
* Change the value of Timeout Seconds (the default is 30).
* Click Save.
* Restart Oracle WebLogic Server.