Enhance your applmgr .profile, part I

Typing is my third-most frequent cause of self-inflicted work stress. For some reason, despite decades spent at a keyboard, it feels like I spend more time hitting backspace than any other key. When working with Oracle Apps, I try to make my life easier by adding some shortcuts to the the applmgr user's .profile.

What follows is likely to be elementary for people who have used Unix for a while, but if you're new to Unix and Linux, perhaps it will save you some headaches. I assume a blank .profile for the applmgr user for purposes of these examples. If your .profile is not empty, I suggest putting these entries at the bottom of the file.

Environment setup

The first thing to do is to source the Apps environment, so I can have common Apps utilities in my PATH and a boatload of Apps-related environment variables set. I make this the first line in my .profile, so I can take advantage of all of these environment variables later. Don't forget the leading "dot" and space before the path to the Apps environment file:

. /u01/app/oracle/product/ebs/apps/apps_st/appl/APPSJPR12_jpr12.env

Naturally, the name of the Apps environment file and the path to it will vary greatly between installations, but the rest of the settings described below don't need to change very much, if at all.

My next step is to add the applications control scripts (adautocfg.sh, adstrtal.sh, adstpall.sh, etc.) to my path, since Oracle's environment files don't do this by default. For release 11i, add the path to the scripts this way:

export PATH=$PATH:$COMMON_TOP/admin/scripts/$CONTEXT_NAME

In Release 12, it's a little cleaner, because Oracle has provided an environment variable that points to the scripts:

export PATH=$PATH:$ADMIN_SCRIPTS_HOME

Finally, I add the path to the AD defaults file, to make working with AD utilities from the command line easier:

export DEFAULTSFILE=$APPL_TOP/admin/$TWO_TASK/adalldefaults.txt

Useful aliases

With the above setup, I can now start saving myself some more typing by creating aliases to AD commands that I run frequently. For example, enabling and disabling maintenance mode, and compiling invalid objects in the APPS schema:

alias adadmin_base='adadmin defaultsfile=$DEFAULTSFILE'
alias enable_maint='adadmin_base logfile=maint_mode.log menu_option=ENABLE_MAINT_MODE'
alias disable_maint='adadmin_base logfile=maint_mode.log menu_option=DISABLE_MAINT_MODE'
alias comp_apps='adadmin_base logfile=comp_apps.log menu_option=CMP_INVALID'

I use the adadmin_base alias when I want to run adadmin with an option I use less frequently and still use the defaults file, for example: adadmin_base menu_option=CMP_MENU.

Here's another simple time saver:

alias bounce_apache='adapcctl.sh stop; sleep 10; adapcctl.sh start'

This one became necessary after one too many requests to restart web services on a test server, only to be asked "is the test instance down?" 20 minutes later...because I'd stopped Apache and forgotten to start it again. Whoopsie. An R12-only variant on the above can be used to restart all OPMN-controlled services on the apps tier (Apache, Forms, etc):

bounce_opmn='adopmnctl.sh stopall; sleep 10; adopmnctl.sh startall'

In both of the above examples, you may want to tinker with the duration of the sleep to find what's ideal for your system.

Notes

A few things to note about this arrangement:

  • If you copy and paste directly from this page, be aware of any line wrapping that may occur in your browser. Each alias command should be on its own line, with no line breaks.
  • If you have recently run AutoConfig in your instance, you may be prompted for the SYSTEM and APPS passwords when invoking adadmin with the defaultsfile option, but otherwise you shouldn't need to answer any of adadmin's prompts.
  • In Release 11 of EBS, the password for the APPS database schema is stored in the AD defaults file in plain text (it is hashed or otherwise obfuscated in Release 12). Be sure to consider whether the security policies in place at your site would permit using the AD defaults file as I have described. I personally feel that the benefits outweigh the risks in this case, but I'm just some dude on the Internet, and you or your security auditors may not agree. :-)

One Trackback

  1. [...] UNIQUE (content_type); Skip to content Author and ContactsBlog answersUbiquity commands « Enhance your applmgr .profile, part I Recommended reading for an EBS R12 upgrade [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*