Tuesday, May 31, 2016

weblogic.Admin utility

The weblogic.Admin utility is a command-line interface that we can use to administer, configure, and monitor WebLogic Server.
 Like the Administration Console, for most commands this utility assumes the role of client that invokes administrative operations on the Administration Server, which is the central management point for all servers in a domain. (All Managed Servers retrieve configuration data from the Administration Server, and the Administration Server can access runtime data from all Managed Servers.)

While the Administration Console interacts only with the Administration Server, the weblogic.Admin utility can access the Administration Server as well as all active server instances directly.

If the Administration Server is down, you can still use the weblogic.Admin utility to retrieve runtime information from Managed Servers and invoke some administrative commands.

However, you can save configuration changes to the domain's config.xml file only when you access the Administration Server.

To use the weblogic.Admin utility, firstly set the environments,

[sami@ed-olfmwlin1 ~]$ . /u01/fmwtrainingapp/mw/wlserver_10.3/server/bin/setWLSEnv.sh

CLASSPATH=/u01/fmwtrainingapp/mw/patch_wls1036/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/u01/fmwtrainingapp/mw/patch_ocp371/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/u01/fmwtrainingapp/jdk1.6.0_45/lib/tools.jar:/u01/fmwtrainingapp/mw/wlserver_10.3/server/lib/weblogic_sp.jar:/u01/fmwtrainingapp/mw/wlserver_10.3/server/lib/weblogic.jar:/u01/fmwtrainingapp/mw/modules/features/weblogic.server.modules_10.3.6.0.jar:/u01/fmwtrainingapp/mw/wlserver_10.3/server/lib/webservices.jar:/u01/fmwtrainingapp/mw/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/u01/fmwtrainingapp/mw/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:
PATH=/u01/fmwtrainingapp/mw/wlserver_10.3/server/bin:/u01/fmwtrainingapp/mw/modules/org.apache.ant_1.7.1/bin:/u01/fmwtrainingapp/jdk1.6.0_45/jre/bin:/u01/fmwtrainingapp/jdk1.6.0_45/bin:/u01/fmwtrainingapp/jdk1.6.0_45/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/obaid/bin:/u01/fmwtrainingapp/jdk1.6.0_45/bin

Your environment has been set.
To get the help on weblogic.Admin use the below command,

[sami@ed-olfmwlin1 ~]$  java weblogic.Admin HELP

OUTPUT: weblogic.Admin is a command-line utility for managing WebLogic Server.
        weblogic.Admin help LIFECYCLE   Starting, stopping, discovering servers
        weblogic.Admin help INFO                    Retrieving info about WebLogic Server
        weblogic.Admin help JDBC                   Working with JDBC connection pools
        weblogic.Admin help MBEAN              Working with WebLogic Server MBeans
        weblogic.Admin help CLUSTER           Working with clusters
        weblogic.Admin help ADMINCONFIG Managing Admin configuration
        weblogic.Admin help ALL                      Help for all commands

Usage: java [<SSL trust options>] weblogic.Admin
        [ [-url | -adminurl] [<protocol>://]<listen-address>:<port>]
        -username <username> [-password <password>]
        <COMMAND> <ARGUMENTS>


Examples:
1. Check AdminServer Status

[sami@ed-olfmwlin1~]$ java weblogic.Admin -url t3://ed-olfmwlin1:7001 -username weblogic -password welcome1 GETSTATE
 Current state of "AdminServer" : RUNNING


2. Check the Managed Server Status
[sami@ed-olfmwlin1~]$ java weblogic.Admin -url t3://ed-olfmwlin1:7001 -username weblogic -password welcome1 GETSTATE ebs_server1
Current state of "ebs_server1" : RUNNING

3. Check the Cluster Status
[sami@ed-olfmwlin1~]$ java weblogic.Admin -url t3://ed-olfmwlin1:7001 -username weblogic -password welcome1 CLUSTERSTATE -clustername myProdCluster
There are 2 server(s) in cluster: myProdCluster
The alive servers and their respective states are listed below:

iam_server1---RUNNING
ebs_server1---RUNNING


To get full help on weblogic.Admin use the below command, and the output has all details,
[sami@ed-olfmwlin1 ~]$  java weblogic.Admin HELP ALL
For any further help, contact me on samiappsdba@gmail.com