Pages

Thursday, November 22, 2012

Weblogic Command Line Tools


Ping
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> PING

Connect
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> CONNECT 10

Output May look like this,
Connection: 0 - 5 ms
Connection: 1 - 2 ms
Connection: 2 - 1 ms
Connection: 3 - 1 ms
Connection: 4 - 2 ms
Connection: 5 - 1 ms
Connection: 6 - 2 ms
Connection: 7 - 4 ms
Connection: 8 - 1 ms
Connection: 9 - 1 ms

RTT =<KeyStore> ~76 milliseconds, or ~7 milliseconds/connection

If the command does not establish a connection, it returns nothing.

State
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> GETSTATE

output May Look like this,
Current state of "" : RUNNING

Help
java weblogic.Admin HELP PING

License
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> LICENSES

JNDI Content
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> LIST

The command lists the bindings immediately below the InitialContext of the specified server instance

Output May Look Like this,
Contents of InitialContext
  weblogic: weblogic.jndi.internal.ServerNamingNode
  ejb: weblogic.jndi.internal.ServerNamingNode
  javax: weblogic.jndi.internal.ServerNamingNode
  mejbmejb_jarMejb_EO: weblogic.rmi.cluster.ClusterableRemoteObject

Some More Example For JNDI Context are,
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> LIST ejb

Contents of ejb
  mgmt: weblogic.jndi.internal.ServerNamingNode

java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> LIST javax

Contents of javax
  transaction: weblogic.jndi.internal.ServerNamingNode
  jms: weblogic.jndi.internal.ServerNamingNode

    
Server Log
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> SERVERLOG | more

Logs at 8 Am
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> SERVERLOG 8:00 | more

Logs From 8AM to 8:30 AM
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> SERVERLOG "2002/10/18 08:00" "2002/10/18 08:30" | more

Thread Dump
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> THREAD_DUMP

Version
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> VERSION

JDBC Pool Test
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> TEST_POOL -poolName

JDBC  Pool Exists
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> EXISTS_POOL -poolName


Cluster
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> CLUSTERSTATE -clustername

Output May look Like this,
There are 1 server(s) in cluster:

The alive servers and their respective states are listed below:
---RUNNING

Get Server Configuration Details
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> GET -pretty -type Server

Server Status Details
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> GET -pretty -type ServerRuntime

JVM Runtime Details
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> GET -pretty -type JVMRuntime

JDBC Details
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> GET -pretty -type JDBCConnectionPoolRuntime

Application Details
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> GET -pretty -type ApplicationRuntime

Run Garbage Collection
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> GET -pretty -type ApplicationRuntime -method runGC

Cluster Details
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> GET -pretty –type   ClusterRuntime

Servlet Details
java  -Dweblogic.security.SSL.trustedCAKeyStore=<KeyStore> weblogic.Admin -adminurl t3s://<IPaddress:Port> -username <UserName> -password <Password> GET -pretty -type ServletRuntime

Some Other Runtime
ConnectorConnectionPoolRuntime
ConnectorConnectionRuntime
ConnectorServiceRuntime
DeploymentRuntime
DomainRuntime
EjbComponentRuntime
EjbEntityHomeRuntime
EjbMessageDrivenRuntime
EjbStatefulHomeRuntime
EjbStatelessHomeRuntime
ExecuteQueueRuntime
JdbcConnectionPoolRuntime
JmsConnectionRuntime
JmsConsumerRuntime
JmsDestinationRuntime
JMSDurableSubscriberRuntime
JmsProducerRuntime
JmsRuntime
JmsServerRuntime
JmsSessionPoolRuntime
JmsSessionRuntime
JoltConnectionPoolRuntime
JoltConnectionRuntime
JoltConnectionServiceRuntime
JtaRuntime
JvmRuntime
LogBroadcasterRuntime
ServerRuntime
ServerSecurityRuntime
ServletRuntime
ServletSessionRuntime
TimeServiceRuntime
TransactionNameRuntime
TransactionResourceRuntime
WebAppComponentRuntime


Additional Commands
Get Properties:  java utils.getProperty
My IP: java utils.myip
My System Information: java utils.system
Weblogic Version Information :java weblogic.utils.Versions

There are many more Commands that we can use for Deploying applications to creating Connection Pools. I will update the Doc with more commands.

Please try these and let me know.