weblogic.Admin utility to achieve administrative tasks

Hi All,

The weblogic.Admin utility provides a powerful command-line interface to achieve administrative tasks that can be done using the WebLogic Admin console. This tool comes in handy for administrators who can use it to integrate or debug on the fly, Also it helps in creating automated build processes.

Find below all tasks which we can use for administrative tasks through weblogic.Admin utility.

<<set the weblogic environment in the classpath using setWLSENV.cmd from the path <<bea/wlserverx.x/servers/bin>>

Open Command prompt and type the below command
C:\bea\wlserver_10.3\server\bin>java weblogic.Admin -help  ALL

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

Where commands and arguments are:

********** Managing the Server Life Cycle **********

UNLOCK
RESUME [<targetServer>]
FORCESHUTDOWN [<targetServer>]
SHUTDOWN [-ignoreExistingSessions] [-timeout <seconds>] [<targetServer>]
OR
(Deprecated) SHUTDOWN [<seconds> [“<stringMessage>”]] [<targetServer>]
LOCK [“<stringMessage>”]
START <targetServer>
(Deprecated) STARTINSTANDBY <targetServer>
DISCOVERMANAGEDSERVER [-serverName <targetServer> [-listenPort <listenport>] [-listenAddress <listen address>] [
-listenPortSecure]]

********** Retrieving Information about WebLogic Server **********

GETSTATE [<targetServer>]
HELP [<COMMAND>]
CONNECT [<count>]
LICENSES
LIST [<JNDIcontextName>]
PING [-timeout <seconds>] [<roundTrips>] [<messageLength>]
THREAD_DUMP
VERSION
SERVERLOG [<startTime> [<endTime>]]

********** Working with JDBC Connection Pools **********

SUSPEND_POOL -poolName <connection pool name>
(Deprecated) DISABLE_POOL <poolName> [true | false]
RESET_POOL <poolName>
CREATE_POOL <poolName> <poolString>
(Deprecated) DESTROY_POOL <poolName> [true | false]
SHUTDOWN_POOL -poolName <connection pool name>
RESUME_POOL -poolName <connection pool name>
TEST_POOL <poolName>
EXISTS_POOL <poolName>
(Deprecated) ENABLE_POOL <poolName>
DELETE_POOL -poolName <connection pool name>

********** Managing WebLogic Server MBeans **********

GET [-pretty] {-type <mbeanType>|-mbean <objectName>} [-property <property>]…
CREATE {-name <name> -type <mbeanType>} | {-mbean <objectName>}
INVOKE {-type <mbeanType>|-mbean <objectName>}
-method <methodName> [<argument>…]
BATCHUPDATE -batchFile <fileLocation> [-continueOnError] [-batchCmdVerbose]
DELETE {-type <mbeanType> | -mbean <objectName>}
QUERY [-pretty] -pattern <objectName_pattern>
SET {-type <mbeanType>|-mbean <objectName>} [-property <property> [<value>]]…

********** Working with Clusters **********

VALIDATECLUSTERCONFIG -configPath <pathname>
MIGRATEALL -server <servername> -destination <servername> [-sourcedown] [-destinationdown]
CLUSTERSTATE -clusterName <clusterName>
STOPCLUSTER -clusterName <clusterName>
MIGRATESERVER -migratableserver <servername> -destinationmachine <machinename>
MIGRATE [-jta] -migratabletarget {<migratabletargetName> | <servername>} -destination <servername> [-sourcedown]
[-destinationdown]
or
MIGRATE -singletonservice <singletonServiceName> -destination <servername>
STARTCLUSTER -clusterName <clusterName>

********** Managing the Admin Configuration **********

STOREUSERCONFIG -username <user> -password <password> [-userconfigfile <file>] [-userkeyfile <file>]

********** SSL Trust Options **********

If the domain-wide administration port is enabled, or if you are
connecting to a server through some other SSL port, you might need
to include Java options to indicate which host the weblogic.Admin
utility trusts. For example, if the server to which you are connecting
is using the demonstration SSL keys and certificates, you must include
the TrustKeyStore option as follows:
java -Dweblogic.security.TrustKeyStore=DemoTrust weblogic.Admin <…>
For more information, refer to the WebLogic Server security documentation.

For usage and examples on individual commands, use
java weblogic.Admin HELP <COMMAND>

******************Examples**************

JDBC Pool
java weblogic.Admin -url t3://localhost:6001 -username weblogic -password weblogic -pretty CREATE_POOL MYPOOL “url=jdbc:oracle:thin:@baybridge:1521:bay817,driver=oracle.jdbc.driver.OracleDriver,initialCapacity=1,maxCapacity=1, props=user=SCOTT;password=tiger;”

Thread Dumps
java weblogic.Admin -url t3://localhost:6001 -username weblogic -password weblogic THREAD_DUMP

Server Logs
java weblogic.Admin -url t3://localhost:6001 -username weblogic -password weblogic SERVERLOG <<speicify time optional>>

In Case of Cluster environment
java weblogic.Admin -url t3://ManagedServerHostName:6001 -username weblogic -password weblogic SERVERLOG <<speicify time optional>>

Test Connection Pool
java weblogic.Admin -url t3://localhost:6001 -username weblogic -password weblogic TEST_POOL myPoolName

Thanks
R Vashi.

One thought on “weblogic.Admin utility to achieve administrative tasks

  1. It was a very helpful article.

    I want to get the Application status through weblogic.Admin command. I tried lot of options with different MBeans. But not able to get it. Can anyone help me with the same.

    Below is what I tried, but it will give output whether it is deployed or not.

    java weblogic.Admin -url t3://localhost:40701 -username weblogic-password weblogicGET -pretty -mbean “soa_domain:ServerRuntime=AdminServer,Name=AdminServer_/dms_11.1.1.1.0,ApplicationRuntime=DMS Application_11.1.1.1.0,Location=AdminServer,Type=WebAppComponentRuntime” -property Status

    I want to check whetehr it is ACTIVE/PREPARED etc.

    I was able to get the same using wlst, but need weblogic.admin command for the same.

    Regards,
    Parvathy

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s