rss
SOATUBE
Oracle
Custom Search SOABYTE here

Thursday, April 24, 2014

Getting JDBC and Connection Pool Data From a WLST or Shell script

Getting JDBC and Connection Pool Data From a WLST or Shell script
 In the script above replace weblogic with your actual username, welcome1 with the actual username's password and localhost:7001 with the actual hostname and password for your WebLogic server.
# monitor.py

attr= {
    "ActiveConnectionsAverageCount": None,
    "ActiveConnectionsCurrentCount": None,
    "ActiveConnectionsHighCount": None,
    "ConnectionDelayTime": None,
    "ConnectionsTotalCount": None,
    "CurrCapacity": None,
    "DeploymentState": None,
    "Enabled": None,
    "FailuresToReconnectCount": None,
    "HighestNumAvailable": None,
    "HighestNumUnavailable": None,
    "LeakedConnectionCount": None,
    "ModuleId": None,
    "Name": None,
    "NumAvailable": None,
    "NumUnavailable": None,
    "Properties": None,
    "State": None,
    "Type": None,
    "VersionJDBCDriver": None,
    "WaitSecondsHighCount": None,
    "WaitingForConnectionCurrentCount": None,
    "WaitingForConnectionHighCount": None
}

connect("weblogic","welcome1","t3://localhost:7001")
pools= adminHome.getMBeansByType( 'JDBCConnectionPoolRuntime' )
for pool in pools:
    for a in attr:
        attr[a]= pool.getAttribute( a )
        # attr has the JDBC and Connection Pool data at this point
    print attr
disconnect()
Using weblogic.Admin Tool
 In the command below replace test_domain with your actual domain name, weblogic with your actual username, welcome1 with the actual username's password, localhost:7001 with the actual hostname and password for your WebLogic server, AdminServer with the server name that your Data Source was targeted to, and JDBCDataSource1 with the actual Data Source name.

$ java weblogic.Admin -adminurl t3://localhost:7001 -username weblogic -password welcome1 GET -pretty -mbean "test_domain:Location=AdminServer,Name=JDBCDataSource1,ServerRuntime=AdminServer,Type=JDBCConnectionPoolRuntime"
 
Blogger Profile