Saturday, March 2, 2013

WLST Script session


Hey everybody,
Today into WLS session, III show you guys how to change OVD or OID ‘searchbase’ configuration using only WLST scripts for automation and remote changes:
Hey hoo, let’s go:
#Connect to any oracle product that has wlst.sh installed. Please note: You don’t need to be at server you want to change, because I am going to connect, from one server to another using WLST scripts:
1
print 'Starting  ThiagoLeoncio metadata update script .... '
#Connecting to OIM Server
1
connect('oim_user','thiagoleonciopwd','t3://thiagoleoncioOIMServer:14000')
#Going to custom environment details related of OIM.
1
2
custom()
cd('oracle.iam')
#This directory “oracle.iam:name=OIMDiagnosticMBean,type=IAMAppRuntimeMBean,Application=oim,ApplicationVersion=11.1.1.3.0″ is the directory that stores , in my case, OVD searchbase result.
1
2
3
cd("oracle.iam:name=OIMDiagnosticMBean,type=IAMAppRuntimeMBean,Application=oim,ApplicationVersion=11.1.1.3.0")
print '======================================'
#just checking if we are into the right place doing a simple ls , wlst script case is ls()
1
2
3
4
5
6
7
8
9
10
11
12
ls()
wls:/oim_domain/custom/oracle.iam/oracle.iam:name=OIMDiagnosticMBean,type=IAMAppRuntimeMBean,Application=oim,ApplicationVersion=11.1.1.3.0> ls()
-r--   ConfigMBean                                  true
-r--   OVDSearchBase                                dc=us,dc=thiagoleoncioserver,dc=com
-r--   ReadOnly                                     false
-r--   RestartNeeded                                false
-r--   SystemMBean                                  false
-r--   eventProvider                                true
-r--   eventTypes                                   java.lang.String[jmx.attribute.change]
-r--   objectName                                   oracle.iam:name=OIMDiagnosticMBean,type=IAMAppRuntimeMBean,Application=oim,ApplicationVersion=11.1.1.3.0
print 'The old value is:'+get("OVDSearchBase")
Return value ‘get’ above: dc=us,dc=thiagoleoncioserver,dc=com
#Setting the new searchbase value
1
2
3
4
5
6
7
8
9
10
11
12
13
14
set("OVDSearchBase","cn=Users,dc=us,dc=thiagoleoncioserver,dc=com")
ls()
wls:/oim_domain/custom/oracle.iam/oracle.iam:name=OIMDiagnosticMBean,type=IAMAppRuntimeMBean,Application=oim,ApplicationVersion=11.1.1.3.0> ls()
-r--   ConfigMBean                                  true
-r--   OVDSearchBase                                cn=Users,dc=us,dc=thiagoleoncioserver,dc=com
-r--   ReadOnly                                     false
-r--   RestartNeeded                                false
-r--   SystemMBean                                  false
-r--   eventProvider                                true
-r--   eventTypes                                   java.lang.String[jmx.attribute.change]
-r--   objectName                                   oracle.iam:name=OIMDiagnosticMBean,type=IAMAppRuntimeMBean,Application=oim,ApplicationVersion=11.1.1.3.0
print '======================================'
print 'The new value is:'+get("OVDSearchBase")
print '======================================'
# disconnecting from OIM server
1
2
disconnect ()
print 'End of script to fix Thiago Leoncio WLST script help!!!! ...'
#exiting from wlst
1
exit()
I hope this helps,
Thiago Leoncio.

Wednesday, February 6, 2013

WLS - How to setup bounce after # of Stuck Threads

The purpose of this article is to show how you can setup your weblogic server to 'take a control' when you face some numbers of STUCK THREADS and then system will probably crash.

So, basically you have to options here:
1)Thru UI
2)Thru WLST command line.

1.1) Go thru UI(Home>> Environment>>Servers>>Select Server that you want to apply this change)

Here you need to set , at least , failure action to Force immediate shutdown.

1.2) Set the maximum count and the Save and activate changes.

Here I am updating the maximum of Stuck Thread counts that I will allow.


2.1) If you want to execute from WLST command:

Basically just grab that steps above using 'record mode' into WLS then...


You just need to grab this content above , include into wlst file and execute the command to change these settings into your WLS. Eg:(java weblogic.WLST filerelated).

NOTE:
1) If you are using a NodeManager. It can just restart your server when you shutdown because of Stuck-threads issue. This way your down time will be less.

2) You also can control Stuck-Threads issues from application level using:

weblogic-application.xml.
...
<application-admin-mode-trigger>
<max-stuck-thread-time>300</max-stuck-thread-time>
<stuck-thread-count>5</stuck-thread-count>
</application-admin-mode-trigger>





I hope this helps,
Thiago Leoncio.