SyntaxHighlighter JS

2013-03-04

One simple trick to make WebLogic admin easier

Setting well-known WebLogic paths as Unix environment variables can make daily administration easier. For example,

export WLHOME=/home/weblogic/Oracle/Middleware/user_projects/domains/base_domain
export WLBIN=${WLHOME}/bin
export WLLOG=${WLLOG}/servers/AdminServer/logs

This is preferable to using Unix aliases such as

alias gotolog='cd /home/weblogic/Oracle/Middleware/user_projects/domains/base_domain/servers/AdminServers/logs'

Benefits
  • Easy to navigate
    Being able to quickly and easily switch between any WebLogic log and bin directory via
    cd $WLLOG
    cd $WLBIN

    makes production debugging much less stressful than fumbling around Oracle WebLogic notoriously long and nested directory structures. This is especially important when you are debugging a real-time production issue on multiple WebLogic Unix servers with your eight bosses watching over your shoulders.

  • Flexible and reusable
    The environment variables can be used in a number of situations.
    cd $WLLOG
    tail -f $WLLOG/AdminServer.log
    ls $WLLOG
    tar cvf archiveLogs.tar $WLLOG


  • Usable by developers
    Java developers can get the Unix environment variable via
    System.getenv("WLLOG");
    They can also directly use it in their bash shell scripts. This makes the same code portable across multiple WebLogic domains and environments without having to modify their code.

  • Self-documenting
    Other admins can type
    set | grep "^WL"

    and see the real paths for WebLogic. This is helpful if you have to change WebLogic directories or are on a unfamiliar server.

No comments:

Post a Comment