Oracle Fusion Middleware & Application Server

Tuesday, October 24, 2017

Manually rotate WebLogic Server Logfiles

From time to time you have the requirement to rotate the WebLogic Server Logfiles manually on the fly without stopping the WebLogic Managed Servers or AdminServer, for example while you perform some load tests in order to have fresh WebLogic Server Logfiles.

Here is a small Python Script, which rotates the WebLogic Server Logfiles for a list of given Managed Servers and AdminServer.

You will need:
  • = Python Script which rotates the Logfiles
  • = Property File for the required connect data to the Admin Server of your WebLogic Domain
The Python Script will read the Property File (parameter -props) in order to get the necessary data for the connect to the Admin Server of your WebLogic Server Domain and will loop through your provided list of Servers (parameter -servers) and force a rotating of the logfiles. The list of Servers (parameter -servers) can accept multiple Servers delimited by ":".

# Align the values for your settings

# ============================================================
# Script:
# Author: Dirk Nachbar, https/
# Purpose: Rotates the WebLogic Server Logfiles for a list
#          of given Servers, either AdminServer or Managed Servers
# ============================================================

# Imports 
import sys
from import File
from import FileOutputStream
from import FileInputStream


def helpUsage():
    print 'Usage: -help'
    print '          [-servers] list of Servers, delimited by :'
    print '          [-props] properties file for connect to AdminServer'
    print 'E.g.: -servers DEMOMS1:DEMOMS2 -props /home/oracle/'

def connectAdmin():

for i in range(len(sys.argv)):
    if sys.argv[i] == "-help":
    elif sys.argv[i] == "-servers":
        if i+1 < len(sys.argv):
            servers_list = sys.argv[i+1]
    elif sys.argv[i] == "-props":
        if i+1 < len(sys.argv):
            configfile = sys.argv[i+1]

if len(servers_list)==0 or len(configfile)==0:
    print 'Missing required arguments (-servers, -props)'
    print ''

propInputStream = FileInputStream(configfile)
configProps = Properties()




for server in servers:
    print '================================================'
    print 'Current Server: ' +server
    print 'Rotating Logfile for Server: ' +server
    print '================================================'

Create the 2 above given files on your Server hosting the Oracle WebLogic Domain, align the file with your settings, connect to your Server with the Oracle Software User and execute the script as following:

oracle@server> $ORACLE_HOME/oracle_common/common/bin/ -props -servers DEMOMS1:DEMOMS2
Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

Connecting to t3://localhost:7001 with userid weblogic ...
Successfully connected to Admin Server "DemoAdminServer" that belongs to domain "demo_domain".

Warning: An insecure protocol was used to connect to the server. 
To ensure on-the-wire security, the SSL port or Admin port should be used instead.

Location changed to domainRuntime tree. This is a read-only tree 
with DomainMBean as the root MBean. 
For more help, use help('domainRuntime')

Current Server: DEMOMS1
Rotating Logfile for Server: DEMOMS1
Current Server: DEMOMS2
Rotating Logfile for Server: DEMOMS2

Happy rotating of WebLogic Server Logfiles . . .

Thursday, October 12, 2017

Changing Logfiles Permission of WebLogic and Node Manager Logfiles to 644

In some cases you will need to align the Logfile permissions of the Oracle WebLogic Server ( and and Node Manager generated Logfiles to 644 (-rw-r--r--), so that for example Monitoring Tools like Patrol can access and monitor the WebLogic Server Logfiles with another OS user as the Oracle Software Installation user.

Just take a look on the Start Script under your $DOMAIN_HOME/bin and the under $ORACLE_HOME/wlserver/server/bin. Within these 2 Start Scripts you will find each a line defining the umask with 027.

# Snippet from $ORACLE_HOME/wlserver/server/bin/

. . .
# Set user-defined variables.

umask 027

. . .

# Replace the line "umask 027" with "umask 022"

. . .
# Set user-defined variables.

umask 022

. . .

# Snippet from $DOMAIN_HOME/bin/

. . .
umask 027

. . .

# Replace the line "umask 027" with "umask 022"

. . .
umask 022

. . .

When you startup now your Node Manager and your WebLogic Server Domain, your Logfiles will still have the permissions "-rw-r-----" :-(

That's a known bug, for Oracle WebLogic Server and just apply the Patch 24794915.

After you applied the patch, you will get the required permissions with "-rw-r--r--".
Under Oracle WebLogic Server the bug is already fixed and you don't need to apply any patch for the umask problem.

Tuesday, October 10, 2017

ODC Appreciation Day: Oracle GitHub Docker Images and Oracle Container Registry

It's time again for the ODC Appreciation Day (formerly known as OTN Appreciation Day) driven by Tim Hall.

My personal favorite this year are the Oracle GitHub Docker Images and the Oracle Container Registry.

The Oracle GitHub Docker Images ( are the "Community Version" provided by Oracle. So in order to use them you will need to download upfront the required Installation Software from OTN or Oracle Software Delivery Cloud.

Under the Oracle GitHub Docker Images you can find a wide range of Ready-To-Use Docker Images for nearly all the main products of Oracle:

  • Oracle WebLogic
  • Oracle Fusion Middleware Infrastructure
  • Oracle Java
  • Oracle Database
  • Oracle SOA Suite
  • and so on

The great thing about is, that you can easily start by using simple architectures, e.g. a single Oracle WebLogic Domain and learn how to build Docker Images.
In the next step you can extend the provided Dockerfiles with your own stuff/needs or use more complex architectures like Oracle WebLogic Cluster.

The Oracle GitHub Docker Images are quite frequently updated, corrected and extended by several Oracle people, e.g. Bruno Borges and Gerald Venzl. For example under the Section OracleWebLogic you can even find Dockerfiles the latest Release of Oracle WebLogic Server

On top you can even find Workshop materials within the Oracle GitHub Docker Images, e.g. Workshop for Creating Docker Images for Oracle WebLogic.

On the other hand you have the Oracle Container Registry ( which is a kind of "Official Source". They are containing complete Docker Images, so you dont need to download any Installation Software from Oracle Technology Network or Oracle Software Delivery Cloud, just simply pull your required Docker images. 

If any body is interested to know more about Docker Images or got some specific questions or problems, a good starting point is the Oracle Community Forum "OTN Docker Space"

Happy ODC Appreciation Day to everyone :-)