Tuesday, December 18, 2012

WebLogic Startup Mode: Development or Production? The (hopefully) Complete List of Differences


Differences

Startup Mode
Development                    Production
Auto deployment
(to admin server only)
YesNo
Automatically created
boot.properties for Admin server only under
$DOMAIN_HOME/servers/$SERVER_NAME/security 
YesNo
Nodemanger username and password
default admin
credentials
randomly
generated
SSL demo certificates cause warning in log files
NoYes
Log file are rotated at server startup
YesNo
On demand deployment of internal applications as default
YesNo
Availability of web service test client
YesNo
Availability of Classloader Analysis Tool
YesNo
Availability of Fast Swap
YesNo
Change Center Enabled
NoYes
Default start parameters
when using Sun JDK and the default
startWebLogic script 
java
-client
-Xms256m
-Xmx512m
-XX:CompileThreshold=
8000
-XX:PermSize=128m
-XX:MaxPermSize=256m
java
-server
-Xms256m
-Xmx512m
-XX:MaxPermSiz=256m
The following settings in the weblogic.xml deployment descriptors default to -1:
NoYes


Differences in previous WebLogic versions:
Up to WebLogic 11:
Default JDK used for new domain
SunJRockit
Up to WebLogic 8 only:
Default number of execute threads
1525
Up to WebLogic 8 only:
maximum number of JDBC connections default setting
1525

Configuration

There is different ways to configure the WebLogic startup mode:
  1. The startup mode can be configured with the admin console, as shown on the screenshot below (requires a restart). Once it’s set to production mode it cannot be reverted with the admin console.
  2. Supply the -Dweblogic.ProductionModeEnabled=true switch as startup parameter
  3. Set the PRODUCTION_MODE variable in the setDomainEnv script in the directory DOMAIN_NAME/bin.

What you should know

Some issues to be aware of:
  • The differences between the two settings depend on the WebLogic version. This can be a bit confusing when you are running different environments with different versions. See the table above: For WebLogic 8 the maximum number of connections in a JDBC connection pool defaults to 25 in production mode (but 15 in development mode); for WebLogic 12c it defaults to 15 in both cases.
  • You cannot revert to development mode from the WebLogic admin console. It’s like the child-proof lock in the back of your car. I understand that is makes sense to protect the children in the back seat your car from themselves but you are are logged with the admin role – still you cannot revert to development mode using the admin console.
  • Autodeployment is not used that much anymore since it only deploys to the admin server – so it doesn’t make sense for a production domain. What if you are a developer? Then your IDE is deploying to the admin server, that is correct – but your IDE is typically not using autodeployment.
  • Note, that there will be a randomly set user and password for nodemanager when creating your domain in production mode with config.sh (see comments from Jacco).
  • You cannot disable the change center in production mode

How to track down High CPU Thread with ps, top and the new JDK7 jcmd Tool In Weblogic



Track down High CPU Thread with ps, top and the new JDK7 jcmd Tool In Weblogic :

Step1 : Login to the weblogic server
                Find out the java process which is running for weblogic with “ps command”

   Eg : ps –ef | grep java

you will see a java process with id 6439

Here the java process id is 6439

 Step 2: To display all the threads with this java process use the “ top” command as below
 Eg: top  -H –p 6439



Here we can see the thread ID 6474 is consuming the max cpu in the thread list. Lets us convert the value to hexadecimal value
Use the following  syntax to convert the value
Printf “%x \n” 6474
Hexavaule is : 194a



Set the environment for JDK 7
/domain/testdomain/bin/> . ./setDomain.sh
Start the jmcd by typing : jcmd


Now take the thread dump of the java process 

 jcmd 6439 help 


Now open the thread dump and search for the hexadecimal value of max threaded. You will see the status of the thread and code with is causing the issue.






Monday, December 10, 2012

How to run Oracle HTTP Server on Port 80


If you are using the Oracle Web tier 11g (11.1.1.2.0 / 11.1.1.3.0 / 11.1.1.4.0) in your projects and specially the Oracle HTTP Server, you face normally the problem, that the Oracle HTTP Server is configured with a Listen Port of 7777 or something like this.

But end users don't like to remember always the Port number of the Oracle HTTP Server, so the goal is to reconfigure the Oracle HTTP Server. Under a UNIX operating system you have to consider one important point for this task, all ports <1024 belongs to root and normally the Oracle Web tier is installed under a own user (normally user oracle) which don't have root privileges. So the ownership of the .apachectl binary must be changed.

Following steps must be done:
·         Shutdown your Oracle HTTP Server
·         Reconfigure the Listen Port
·         Change the .apachectl binary
·         Restart your Oracle HTTP Server and test
The first step is to shutdown the Oracle HTTP Server, this must be done with opmnctl. The binary you can find under your WebtierHome/instances/instance1/bin.
Connect as the Oracle software user (oracle) to your server 

1
2
3
4
# assuming your MW_HOME is /u00/app/oracle/product/fmw-11.1.1
export MW_HOME=/u00/app/oracle/product/fmw-11.1.1
cd $MW_HOME/Oracle_WT1/instances/instance1/bin
./opmnctl stopall


Second step is to configure the Listen Port for the Oracle HTTP Server to port 80

1
2
3
4
5
6
7
8
# assuming you are still connected as oracle user to your sevrer
cd $MW_HOME/Oracle_WT1/instances/instance1/config/OHS/ohs1
cp httpd.conf httpd.conf.save
vi httpd.conf
# Now go to the line with Listen <portnumber> (normally 777x)
# and replace the port number to port 80
Listen 80
# save the changes


The third step is to change the ownership and permissions of the .apachectl binary, this step must be done as root user:

1
2
3
4
5
6
7
8
9
10
# assuming you are connected to the server as root user
# use the MW_HOME from step 1
cd $MW_HOME/Oracle_WT1/ohs/bin
# be aware, we have to modify the hidden file .apachectl (the dot is correct)
ls -la .apachectl
-rwxr-x--- 1 oracle oinstall 13278 Dec 17 03:54 .apachectl
chown root .apachectl
chmod 6750 .apachectl
ls -la .apachectl
-rwsr-s--- 1 root oinstall 13278 Dec 17 03:54 .apachectl

The last step is to startup your reconfigured Oracle HTTP Server, for this you must connect to your server as Oracle Software user:

1
2
3
4
5
6
cd $MW_HOME/Oracle_WT1/instances/instance1/bin
./opmnctl startall
# Then check the status with the option -l
# to see if your Oracle HTTP Server is up and
# the option -l display the used ports (see picture below)
./opmnctl status -l

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5x4YqgLpB67WHDWRiJm1QQcrMVMCp8enQ_QlUAXc93FrNZex23EEaz38ae3EGZBBgzPPEdGBuls-qg-wft1GPHY4p2_TAonpAP4rE0gUmb6PW2voyiqBDfT6zcLl07wAZ0BXHteB27zA/s320/opmnctl_status.png


The final test is, startup your browser and point to your Oracle HTTP Server

Tuesday, December 4, 2012

OBIEE 11g – Installation 11.1.1.6 on Windows 7 64bit OS

OBIEE 11.1.1.6 Installation Pre requisites on Windows 7 64bit OS

Before installation OBIEE 11.1.1.6 on Windows 7 64 bit Operating System, ensure the below requirements are taken care.

System Requirements :

Disk Space  20GB or higher
Physical Memory 4GB


Environmental Variables (TEM to C:\ directory)
Install Loopback Adapter with specific IP Address
JDK 7 (64bit)
Adobe Flash Player 11
Oracle Database 11.1.0.7.0 or higher
RCU Installation 11.1.1.6.0(no changes in RCU installation steps). 

Part1 : Install the Database
Part2 : RCU Installation Steps
Part3 : OBIEE11g Installation

Once you download all the files, extract them and keep them under one directory(Keeping RCU in the same directory is not mandatory, just for convinience).





Before starting the installation keep your have got database up and running. RCU will create two schemas in the installation process…
First step of installaton is running RCU (Repository Creation Utility), go to C:\Software\OBIEE11gR1\bishiphome\rcuHome\BIN and double click on rcu.bat file.
Welcome page of the installation wizard will open …click Next. Select Create
Click Next
Enter all the required information, be sure that the database user has got sysdba previlages…Click Next
Click OK
Enter the Prefix (or leave the default one DEV) and select the components install…
Click OK and enter the passwords for all the users (2 users) that created in the following screen…
Click Next
Click OK
Click OK
Click Create
Click Close..we are done with RCU

OBIEE11g (11.1.1.6) Installation Steps
Download all the OBIEE11g 64 bit files from Oracle site and unzip all the files and click on “setup.exe” on disk 1 to start the installation process.

 
 Click on next
 
Click on Skip software updates and click next
 
Click on simple install and click next
 
Click next
 
Create a OBIEE11g home directory and ensure there are no spaces on the folder name. Locate the folder and click next.
 
Provide the Administration user name and password.
 
Click next
 
Provide the connect string and metadata schema name (DEV_BIPLATFORM)
 
Click next
 
Uncheck the security update and click next.
 
 Click on Install
 
 Once the configuration is 100% complete, click on next.
Once the installation is complete click finish. The system will open up the analytics page.
 
Login with the weblogic user ID and Password and check the sample reports.



How to take Thread dump in Weblogic(linux/windows) using the WLST script



Action Plan

1. Save the content of the script as "ThreadDumps.py".
2. Modify the script as follows:
2.1 Specify the server name that you are going to monitor (serverName).
2.2 Specify the number of quantity of thread dumps to take (threadNumber).
2.3 Specify the parameters for the connection string: username, password, hostname and port of the Admin Server.
3. Save the file.
4. Set up the environment for WLST. Check the following documentation: http://download.oracle.com/docs/cd/E11035_01/wls100/config_scripting/using_WLST.html#wp1093943
5. Run the script as follow: java weblogic.WLST ThreadDumps.py
6. As the result of the script, you will get some dmp files that contain the thread dumps.


The following script will take 5 thread dumps on the server "ManagedServer1", 15 seconds apart form each other. 

Linux

*****************************************************************

connect('weblogic','weblogic1','localhost:7001')

from time import strftime
from java.text import SimpleDateFormat
serverName = 'ManagedServer1'
counter = 0
sleepTime = 15000
threadNumber = 5

for counter in range(threadNumber):
        currentDate = java.util.Date().toString()
        myDate = currentDate.split(' ');
        finalDate = myDate[3]
        java.lang.Thread.sleep(sleepTime)
        fileName = 'dump' + '_' + serverName + '_' + finalDate + '.dmp'
        threadDump('true', fileName, serverName)

disconnect() 

****************************************************************

Windows

This particular version of the script introduces some changes in the way how thread dump files are being saved.

****************************************************************
connect('weblogic','weblogic1','localhost:7001')

from java.lang import *
from java.util import Date

serverName = 'MS1'
counter = 0
sleepTime = 15000
threadNumber = 10

d= Date()

for counter in range(threadNumber):
        currentFile = 'Thread_Dump_%s_%s_%s.log' % (serverName, d.time,counter)
        threadDump(writeToFile='true', fileName=currentFile,serverName=serverName)
        currentFileRead = open(currentFile, 'r')
        currentFileRead.close()
        Thread.sleep(sleepTime)

disconnect()
*****************************************************************