Script to check Datasource connections -Weblogic WLST scripting
Script to check DataSource Connections using WLST scripting: The connection status can be checked using Python script. Ensure the indents are correct. Url of datasource , port number can be found out at config.xml file Export the following: export ANT_HOME=/app/oracle/Middleware/mw6/modules/org.apache.ant_1.7.1 export CLASSPATH=$ANT_HOME/lib:$ANT_HOME/bin export CLASSPATH=$ANT_CONTRIB/lib:$CLASSPATH export ANT_CONTRIB=$MW_HOME/modules/net.sf.contrib_1.1.0.0_1-0b2 export CLASSPATH=$ANT_CONTRIB/lib:$CLASSPATH . /app/oracle/Middleware/mw6/wlserver_10.3/server/bin/setWLSEnv.sh Save the below as *.PY connect('weblogic','<weblogicpassowrd>', 't3://<url of datasource>') serverRuntime() dsMBeans = cmo.getJDBCServiceRuntime().getJDBCDataSourceRuntimeMBeans() dsName="<datasource name>" for ds in dsMBeans: if (dsName == ds.getName()): ...