The earlier blog at Setting
V$SESSION for a WLS Datasource described using system properties to set
driver connection properties, which in turn automatically set values on the
Oracle database session. Some comments
from readers indicated that there were some limitations to this mechanism.
- There are some values that can’t be set on the
command line because they aren’t available until the application server
starts. The most obvious value is the
- Values set on the command line imply that they are
valid for all environments in the server which is fine values like the program
name but not appropriate for datasource-specific values or the new partition
name that is available with the WLS Multi Tenancy feature.
- In a recent application that I was working with,
it was desirable to connect to the server hosting the datasource that was
connected to the session so that we could run a graceful shutdown In this case, additional information was
needed to generate the URL.
All of these cases are handled with the enhanced
system properties feature.
feature supported setting driver properties using the value of system
properties. The new feature is
overloaded on top of the old feature to avoid introducing yet another set of driver
properties in the graphical user interfaces and WLST scripts. It is enabled by specifying one or more of
the supported variables listed in the table below into the string value. If one or more of these variables is included
in the system property, it is substituted with the corresponding value. If a value for the variable is not found, no
substitution is performed. If none of these variables are found in the system
property, then the value is taken as a system property name.
First half (up to @) of ManagementFactory.getRuntimeMXBean().getName()
Second half of ManagementFactory.getRuntimeMXBean().getName()
Java system property user.name
System property os.name
Data source name from the JDBC
Partition name or DOMAIN
WebLogic Server server listen port
WebLogic Server server SSL listen
WebLogic Server server name
WebLogic Server domain name
property is shown in the following example:
example, v$session.program running on myserver is set to “WebLogic myserver
limitation of this feature is the character limit on the associated columns in
v$session. If you exceed the limit,
connection creation will fail.
enhancement combined with the Oracle v$session values can make this a powerful
feature for tracking information about the source of the connections.
See the Blog announcing Oracle WebLogic Server 12.2.1 for more details on Multenacy and other new features.