Monday, 9 July 2012

Separating username and password using cut command in UNIX.


I was writing a script in UNIX where I got to come across a scenario, to separate user name and Password. The string was apps/apps where first part precede the / was the user name and the apps succeeds the / was the Password. I googled it and came to know about this CUT command.
ID=apps/apps
LOGIN=`echo $ID | cut -d"/" -f1`
PWD=`echo $ID | cut -d"/" -f2`

The echo $ID will have the string, CUT is the Key work for this command, -d for delimiter / and –f1 will store the first part of the string. Similarly –f2 will store the second part of the string.

Thursday, 5 July 2012

How to write a file to the concurrent program output?


I got a requirement to write some useful information to the user in the Concurrent program output. It was a UNIX host program .I got held up with this requirement. At last I got the solution with the help of a colleague.

Create a temp file to write the information. Write the necessary info in the file using >> operator.

touch  $path output.tmp

A temp file with name output got created.

echo "Application SID Name :" $APPS_SID >>output.tmp

After writing all the necessary information in to the temp file, use the below command to write the output file in the concurrent program output.

cat output.tmp  > $APPLCSF/$APPLOUT/o${4}.out

Command is simple as that, concatenating the output file with the concurrent program out file. The name of the concurrent program out file will be o(RequestID).out. $4 will have the value of the Request ID.
Read “Registering an UNIX host concurrent program (Oracle E-Business suite)” post to know about the reserved 5 parameters(e.g. $4 for Request ID) of a UNIX host Program.

Searching for OA Components in JDeveloper Tree Structure?


When I heard about OAF, I tried learning it and came out with some useful information. I am penning the information which I learned and discuss about the doubts I faced during the face of my learning.
OAF, Oracle Application Framework is used to create web-based Oracle Application extensions. It is closely integrated with Oracle Apps hence it is meaningless outside apps context. It is tailor made for use in the development, customization of Oracle Apps pages and any custom application development to be hosted, integrated in Oracle Apps. OAF is a model-view-controller (MVC) technology stack which comprised of OA framework View (regions and pages) and BC4j respectively as view and model layers. This is the outline of OAF.
I downloaded the Jdeveloper 10.3.3.1 from oracle site and installed in my PC. I tried to create OA workspace which will have the OAF specific components. I couldn’t find it in the tree structure of the software. The OA Components should present in the Web tire components. The problem was I dint extend the OA Components. Jdeveloper with OA Extensions can only used to create OAF pages. The Jdeveloper can be used to create java based web pages without OA Extensions.
The patches for different versions are given in this link.






Compressing and zipping a directory in UNIX.

I got a requirement of compressing and zipping a directory. Searched for it and found it at last. Let me discuss what I learned. When I started learning I got a clue that it can be compressed by Gzip. It dint satisfy my requirement.
                gzip {filename}   eg: gzip mydata.doc
Gzip compress the size of the given files using Lempel-Ziv coding (LZ77). Whenever possible, each file is replaced by one with the extension .gz.
To Zip and compress my directory I used tar utility at the end. Let me give the description of this utility,   The GNU tar is archiving utility but it can be use to compressing large file(s). GNU tar supports archive compressing through gzip. If you have more than 2 files then it is recommended to use tar instead of gzip.
-z: use gzip compress
Syntax and example for tar along with gzip utility
tar -zcvf {.tgz-file} {files}      eg :tar –zcvf myfile.tar.gz –c /tmp/myfile

Registering an UNIX host concurrent program (Oracle E-Business suite).


I wrote a UNIX shell script and executed it fine. I was asked to register the UNIX script as a concurrent program. I registered it and executed it. I couldn’t make it, Coz I dint create the symbolic link. The script was also not saved in .prog extension.
Then I learnt about registering the concurrent host program. One important to remember while registering a host concurrent program is that the first five parameters are reserved by Oracle E-Business Suite for its own use. From the sixth parameter the user –defined parameter can be defined.
The first 5 parameters are,
$0: The shell script to be executed
$1: Oracle user/password
$2: Applications user_id
$3: Application user_name
$4: Concurrent program request_id
The steps involved in registering a Unix concurrent program are,
1.       Create the shell script in the $APPLBIN directory of the specific application top. In this example, I have created the script under $XX_CUSTOM_TOP/bin and named it MY_CUSTOM.prog (the extension should be .prog).
2.       Define the concurrent executable with Execution Method ‘Host’. In the Execution File Name field, specify the name of the shell script without extension (‘MY_CUSTOM’ for this example).
3.       Define the concurrent program with parameters as required.
4.       Add the concurrent program to a request group.
5.       Make a symbolic link using the execution file name to fndcpesr, which is located in the $FND_TOP/$APPLBIN directory.  The symbolic link is created in the same directory as the shell script.
[oracle@apps bin]$ ln -s $FND_TOP/bin/fndcpesr  MY_CUSTOM
After all these steps run the concurrent program. The output of the given out file will be displayed in the log file.