Friday, August 3, 2012

Creating Reports Using Oracle BI Publisher & APEX integration

I had recently explored the way to use BI publisher for creating reports and intgrating it with any APEX application regions.

(a) APEX - BI Publisher Integration Requirements
================================
1) Download & Install Oracle BI publisher(trial version of course) from OTN, It needs a license.




2) Download & Install Oracle BI publisher desktop again from OTN. (After this install you can see an additional BI pulisher plugin in MS word).



3) You need to start the BI pulisher using the start icon that is created on ur desktop after step-2.
(BI Publisher will be hosted by weblogic server..You will notice this when you start it)



Now you are ready to create reports in various formats, like PDF, Excel, HTML, RTF etc....

(b) Creating Reports and Integrating it with APEX Applications
===========================================
1) Login to your APEX workspace, and then click on the application to which reports are to be added.



2) Click on the page with your reporting regions.

3) Now select the region for which you intend to have a report download in PDF format.



4) The region source query needs to be copied to a notepad

5) Now again go back to the applications and select shared components.



6) Under shared components, click on report queries and create a report query with the query you saved in step-4

7)While creating the report query, download the XML output of the report query and save it, Further, it asks for the report layout and the source for it. Pause here the activity. (We are continuing to create a RTF template for our report using MS word)

8) Now open MS Word, Under BI Publisher tab. Click on Sample XML, and select your sample XML you saved on step-7, The XML data will be loaded into the word.





9) Now using table wizard, design your report layout as you require.


10) After creating the report table, you can preview the report(of course with actual data), in various formats.

11) Save the word report layout created as turnover.rtf.

12) Again go back to step-7, Under shared components page of the application, select the turnover.rtf file created in step-11 as the report layout and click finish for creating the report queries. (Save the report URL soemthing like below)



13) Now, goto the page definition of with the reports region and create a button and a branch as shown below.(Branch should be to the Print URL as shown above)
14) Now, you are all set to test your report, run your reports page in your application, and just click your button to view your repor tin PDF format.

HAPPY LEARNING!


Tuesday, July 17, 2012

Forms Customization Steps in Oracle Applications


Steps required to customize a form in Oracle Applications.
Lets do some Questions and Answers:-

Question: Is it a common practice to modify forms in Oracle Apps?
Answer: Yes and No.
Yes because you often will be called upon to modify the forms, but no because most often you should modify the screen without actually modifying the underlying forms executable .

Question: How can I modify screen without modifying the underlying executable ?
Answer: There are two ways, listed in the order of preferences:-
1. Forms Personalizations
2. CUSTOM.pll

Question: How does forms personalization work?
Answer: Oracle forms has triggers that we trap to write our business logic. Oracle has a standard practice of calling a generic piece of code from each trigger(at form level).  In this generic piece of code Oracle checks in personalizations tables to see if anything extra needs to be done for the events being executed.

Question: Fine then, but why is CUSTOM.pLL needed when we already have forms personalization?
Answer: Well just like any technology, forms personalization has its limitations.

Limitation example 1 of forms personalizations
---------------------------------------------------
For example you wish to prompt a message to user DO YOU WISH TO CREATE THIS PERSON AS SUPPLIER OR CUSTOMER OR EMPLOYEE. Lets say this message will prompt three options, create customer , create supplier or create vendor. Depending upon what user selects, you wish to navigate to one of relevant screens from the current TCA screen. For this, you have no choice but to use CUSTOM.pll

Limitation example 2 of forms personalizations
---------------------------------------------------
For example you wish to change the record group of a LOV, via changing its query, in a screen.  This can be done by CUSTOM.pll, but not by forms personalization.


Question: What about CUSTOM.pll, what can't be done via custom.pll ??  Hence calling for forms customization.
Answer: For example, you need to add a complete new section to the screen at a very specific location, this must be done via forms customization.

Question : Ok, what are the steps for customization of such screen.
Answer: Below steps in brief
A) Identify the form in Oracle Apps that needs to be customized.
B) Go to the specific directory on one of the mid-tiers to get that forms executable. Say from $AU_TOP/forms/US/POENTRY.fmb.
C) FTP that form and all its dependable form objects & pll files to your PC.
D) Open the form, ensuring that you do not receive any errors pertaining to missing library or missing form object.
E) Perform a save-as to rename this form on your pc, using your company's naming conventions.
F) Make the desired modifications to the form.
G) Generate the form on PC using Control-T keystrokes. This will ensure that nothing critical has been missed out. Surely you will need to connect to apps schema before generating the form.
H)  FTP the form file to $XXPO_TOP/forms/US
Surely, this XX will be replaced by the naming convention at your client/company.
I)  cd to  $XXPO_TOP/forms/US
And f60gen on XXPOENTRY.fmb
This will create a file executable as XXPOENTRY.fmx
J) Go to Application Developer responsibility
Menu /applicaton/form
Register the form
K) Register the Forms Function
This forms function must be registered against application "XX Purchasing".
L) Now add a menu item so that this forms function becomes available to specific responsibility.

Question: Well, a question about (A), how to identify the form executable?
Answer: There are two ways.
Method1
Open the form to be customized in Oracle Apps from respective Responsibility/Menu
Next select menu /Help/About Oracle Application.
Here, scroll down within the subwindow and search for fmx. This is the executable that oracle application runs when specific form is invoked.

Method2
Query the responsibility definition which has the form attached to this. Note down the Menu which is attached to Responsibility. Go to the menu definition screen and find the form function attached to this menu. From this form function find the form attached to this function.

Question: Regarding (I), what is the command for f60gen
Answer:
FORMS60_PATH=$FORMS60_PATH:$AU_TOP/forms/US
export FORMS60_PATH
cd $XXPO_TOP/forms/US
f60gen module=XXPOENTRY.fmb userid=apps/apps module_type=form batch=no compile_all=special  
HAPPY LEARNING!    

Wednesday, May 9, 2012

Using the oracle-validated RPM to install Oracle 11g on Linux

When we try to install Oracle 11g on Linux, in most cases  We find that the OUI either reports that some packages are missing (typically unixODBC or libaio) or some kernel parameters are not appropriately set. In this case however, we download and install an RPM package called oracle-validated and the oracle-validated RPM does a number of things for us.
  • It creates the user oracle
  • It creates the groups oinstall and dba
  • It modifies the kernel parameters in /etc/sysctl.conf
  • It sets the hard and soft shell resource limits in /etc/security/limits.conf
  • And most importantly, downloads and installs number of packages which are required for the Oracle 11g database software installation while resolving the dependencies between the packages as well
  • Note that the oracle-validated RPM package is accessible through the Oracle Unbreakable Linux Network (ULN) which requires a support contract or from the Oracle public yum repository.
    First we needed to configure the Linux machine to be able to connect to the internet using the corporate proxy and we did this by editing the /etc/profile.d/proxy.sh file with some environment variables like FTP_PROXY and HTTP_PROXY
    export http_proxy=http://test-apache-001-dev.corporateict.domain:8123/
    export ftp_proxy=http://test-apache-001-dev.corporateict.domain:8123/
    export no_proxy=.corporateict.domain
    export HTTP_PROXY=http://test-apache-001-dev.corporateict.domain:8123/
    export FTP_PROXY=http://test-apache-001-dev.corporateict.domain:8123/
    Login once again as root to invoke the changes made to the environment.
    We then use wget to download the file which has the repository locations
    [root@kens-orasql-001 yum.repos.d]# wget http://public-yum.oracle.com/public-yum-el5.repo
    We have to update this file and change the line enabled=0 to enabled=1 for the tag which is appropriate to our Linux version – in our case we were using OEL 5.7 so we have to update these lines:
    Change
    [ol5_u7_base]
    name=Oracle Linux $releasever – U7 – $basearch – base
    baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL5/7/base/$basearch/
    gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
    gpgcheck=1
    enabled=0
    to
    [ol5_u7_base]
    name=Oracle Linux $releasever – U7 – $basearch – base
    baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL5/7/base/$basearch/
    gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
    gpgcheck=1
    enabled=1
    We then ran a yum update followed by the yum install oracle-validated
    [root@kens-orasql-002 yum.repos.d]# yum update
    Loaded plugins: rhnplugin, security
    This system is not registered with ULN.
    ULN support will be disabled.
    ol5_u7_base                                                                                                                                    | 1.1 kB     00:00
    ol5_u7_base/primary                                                                                                                            | 1.5 MB     00:07
    ol5_u7_base                                                                                                                                                 4605/4605
    Skipping security plugin, no data
    Setting up Update Process
    No Packages marked for Update
    [root@kens-orasql-002 yum.repos.d]# yum install oracle-validated
    Loaded plugins: rhnplugin, security
    This system is not registered with ULN.
    ULN support will be disabled.
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package oracle-validated.x86_64 0:1.1.0-14.el5 set to be updated
    --> Processing Dependency: kernel-uek >= 2.6.32 for package: oracle-validated
    --> Processing Dependency: libXp.so.6 for package: oracle-validated
    --> Processing Dependency: /usr/lib/libodbccr.so for package: oracle-validated
    --> Processing Dependency: /usr/lib64/libodbccr.so for package: oracle-validated
    --> Processing Dependency: unixODBC-devel for package: oracle-validated
    --> Processing Dependency: libaio-devel for package: oracle-validated
    --> Processing Dependency: sysstat for package: oracle-validated
    --> Processing Dependency: /usr/lib64/libaio.so for package: oracle-validated
    --> Processing Dependency: /usr/lib/libodbc.so.1 for package: oracle-validated
    --> Processing Dependency: /usr/lib/libaio.so for package: oracle-validated
    --> Processing Dependency: compat-gcc-34-c++ for package: oracle-validated
    --> Processing Dependency: compat-gcc-34 for package: oracle-validated
    --> Processing Dependency: libdb-4.2.so()(64bit) for package: oracle-validated
    --> Processing Dependency: libodbc.so.1()(64bit) for package: oracle-validated
    --> Running transaction check
    ---> Package compat-db.x86_64 0:4.2.52-5.1 set to be updated
    ---> Package compat-gcc-34.x86_64 0:3.4.6-4.1 set to be updated
    ---> Package compat-gcc-34-c++.x86_64 0:3.4.6-4.1 set to be updated
    ---> Package kernel-uek.x86_64 0:2.6.32-200.13.1.el5uek set to be installed
    --> Processing Dependency: kernel-firmware >= 2.6.32-200.13.1.el5uek for package: kernel-uek
    ---> Package libXp.i386 0:1.0.0-8.1.el5 set to be updated
    ---> Package libaio-devel.i386 0:0.3.106-5 set to be updated
    ---> Package libaio-devel.x86_64 0:0.3.106-5 set to be updated
    ---> Package sysstat.x86_64 0:7.0.2-11.el5 set to be updated
    ---> Package unixODBC.i386 0:2.2.11-7.1 set to be updated
    ---> Package unixODBC.x86_64 0:2.2.11-7.1 set to be updated
    ---> Package unixODBC-devel.i386 0:2.2.11-7.1 set to be updated
    ---> Package unixODBC-devel.x86_64 0:2.2.11-7.1 set to be updated
    --> Running transaction check
    ---> Package kernel-uek-firmware.noarch 0:2.6.32-200.13.1.el5uek set to be updated
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ======================================================================================================================================================================
    Package                                     Arch                           Version                                         Repository                           Size
    ======================================================================================================================================================================
    Installing:
    oracle-validated                            x86_64                         1.1.0-14.el5                                    ol5_u7_base                          24 k
    Installing for dependencies:
    compat-db                                   x86_64                         4.2.52-5.1                                      ol5_u7_base                         1.6 M
    compat-gcc-34                               x86_64                         3.4.6-4.1                                       ol5_u7_base                         4.3 M
    compat-gcc-34-c++                           x86_64                         3.4.6-4.1                                       ol5_u7_base                          13 M
    kernel-uek                                  x86_64                         2.6.32-200.13.1.el5uek                          ol5_u7_base                          25 M
    kernel-uek-firmware                         noarch                         2.6.32-200.13.1.el5uek                          ol5_u7_base                         2.5 M
    libXp                                       i386                           1.0.0-8.1.el5                                   ol5_u7_base                          22 k
    libaio-devel                                i386                           0.3.106-5                                       ol5_u7_base                          12 k
    libaio-devel                                x86_64                         0.3.106-5                                       ol5_u7_base                          11 k
    sysstat                                     x86_64                         7.0.2-11.el5                                    ol5_u7_base                         187 k
    unixODBC                                    i386                           2.2.11-7.1                                      ol5_u7_base                         830 k
    unixODBC                                    x86_64                         2.2.11-7.1                                      ol5_u7_base                         835 k
    unixODBC-devel                              i386                           2.2.11-7.1                                      ol5_u7_base                         743 k
    unixODBC-devel                              x86_64                         2.2.11-7.1                                      ol5_u7_base                         799 k
    
    Transaction Summary
    ======================================================================================================================================================================
    Install      14 Package(s)
    Upgrade       0 Package(s)
    
    Total size: 50 M
    Is this ok [y/N]: y
    Downloading Packages:
    warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 1e5e0159
    ol5_u7_base/gpgkey                                                                                                                             | 1.4 kB     00:00
    Importing GPG key 0x1E5E0159 "Oracle OSS group (Open Source Software group) " from http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
    Is this ok [y/N]: y
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing     : unixODBC                                                                                                                                      1/14
      Installing     : compat-gcc-34                                                                                                                                 2/14
      Installing     : sysstat                                                                                                                                       3/14
      Installing     : compat-db                                                                                                                                     4/14
      Installing     : unixODBC                                                                                                                                      5/14
      Installing     : unixODBC-devel                                                                                                                                6/14
      Installing     : unixODBC-devel                                                                                                                                7/14
      Installing     : libaio-devel                                                                                                                                  8/14
      Installing     : libaio-devel                                                                                                                                  9/14
      Installing     : kernel-uek-firmware                                                                                                                          10/14
      Installing     : libXp                                                                                                                                        11/14
      Installing     : compat-gcc-34-c++                                                                                                                            12/14
    Change references of /dev/hd in /etc/fstab to disk label
      Installing     : kernel-uek                                                                                                                                   13/14
    WARNING: No module ehci-hcd found for kernel 2.6.32-200.13.1.el5uek, continuing anyway
    WARNING: No module ohci-hcd found for kernel 2.6.32-200.13.1.el5uek, continuing anyway
    WARNING: No module uhci-hcd found for kernel 2.6.32-200.13.1.el5uek, continuing anyway
      Installing     : oracle-validated                                                                                                                             14/14
    
    Installed:
      oracle-validated.x86_64 0:1.1.0-14.el5
    
    Dependency Installed:
      compat-db.x86_64 0:4.2.52-5.1                         compat-gcc-34.x86_64 0:3.4.6-4.1                               compat-gcc-34-c++.x86_64 0:3.4.6-4.1
      kernel-uek.x86_64 0:2.6.32-200.13.1.el5uek            kernel-uek-firmware.noarch 0:2.6.32-200.13.1.el5uek            libXp.i386 0:1.0.0-8.1.el5
      libaio-devel.i386 0:0.3.106-5                         libaio-devel.x86_64 0:0.3.106-5                                sysstat.x86_64 0:7.0.2-11.el5
      unixODBC.i386 0:2.2.11-7.1                            unixODBC.x86_64 0:2.2.11-7.1                                   unixODBC-devel.i386 0:2.2.11-7.1
      unixODBC-devel.x86_64 0:2.2.11-7.1
    
    Complete!
    [root@kens-orasql-002 yum.repos.d]#
    We can see that the oracle-validated RPM has been installed.
    [root@kens-orasql-001 yum.repos.d]# rpm -qa |grep oracle-valid
    oracle-validated-1.1.0-14.el5
    We can also check and see that the user and groups have been created as well.
    [root@kens-orasql-001 yum.repos.d]# cat /etc/passwd |grep oracle
    
    oracle:x:54321:54321::/home/oracle:/bin/bash
    
    [root@kens-orasql-001 yum.repos.d]# cat /etc/group |grep dba 
    dba:x:54322:oracle
    It has also updated the /etc/security/limits.conf file
    [root@kens-orasql-001 yum.repos.d]# cat /etc/security/limits.conf
    
    # Oracle-Validated setting for nofile soft limit is 131072
    oracle   soft   nofile    131072
    
    # Oracle-Validated setting for nofile hard limit is 131072
    oracle   hard   nofile    131072
    
    # Oracle-Validated setting for nproc soft limit is 131072
    oracle   soft   nproc    131072
    
    # Oracle-Validated setting for nproc hard limit is 131072
    oracle   hard   nproc    131072
    
    # Oracle-Validated setting for core soft limit is unlimited
    oracle   soft   core    unlimited
    
    # Oracle-Validated setting for core hard limit is unlimited
    oracle   hard   core    unlimited
    
    # Oracle-Validated setting for memlock soft limit is 50000000
    oracle   soft   memlock    50000000
    
    # Oracle-Validated setting for memlock hard limit is 50000000
    oracle   hard   memlock    50000000
    Finally, we can see that the /etc/sysctl.conf has been updated as well with some “Oracle-Validated” settings.
    # For 11g, Oracle-Validated setting for fs.file-max is 6815744
    # For 10g, uncomment 'fs.file-max = 327679', and comment 'fs.file-max = 6553600' entry and re-run sysctl -p
    # fs.file-max = 327679
    fs.file-max = 6815744
    
    # Oracle-Validated setting for kernel.msgmni is 2878
    kernel.msgmni = 2878
    
    # Oracle-Validated setting for kernel.msgmax is 8192
    kernel.msgmax = 8192
    
    # Oracle-Validated setting for kernel.msgmnb is 65536
    kernel.msgmnb = 65536
    
    # Oracle-Validated setting for kernel.sem is '250 32000 100 142'
    kernel.sem = 250 32000 100 142
    
    # Oracle-Validated setting for kernel.shmmni is 4096
    kernel.shmmni = 4096
    
    # Oracle-Validated setting for kernel.shmall is 1073741824
    kernel.shmall = 1073741824
    
    # Oracle-Validated setting for kernel.shmmax is 4398046511104 on x86_64 and 4294967295 on i386 architecture. Refer Note id 567506.1
    kernel.shmmax = 4398046511104
    
    # Oracle-Validated setting for kernel.sysrq is 1
    kernel.sysrq = 1
    
    # Oracle-Validated setting for net.core.rmem_default is 262144
    net.core.rmem_default = 262144
    
    # For 11g, Oracle-Validated setting for net.core.rmem_max is 4194304
    # For 10g, uncomment 'net.core.rmem_max = 2097152', comment 'net.core.rmem_max = 4194304' entry and re-run sysctl -p
    # net.core.rmem_max = 2097152
    net.core.rmem_max = 4194304
    
    # Oracle-Validated setting for net.core.wmem_default is 262144
    net.core.wmem_default = 262144
    
    # For 11g, Oracle-Validated setting for net.core.wmem_max is 1048576
    # For 10g, uncomment 'net.core.wmem_max = 262144', comment 'net.core.wmem_max = 1048576' entry for this parameter and re-run sysctl -p
    # net.core.wmem_max = 262144
    net.core.wmem_max = 1048576
    
    # Oracle-Validated setting for fs.aio-max-nr is 3145728
    fs.aio-max-nr = 3145728
    
    # For 11g, Oracle-Validated setting for net.ipv4.ip_local_port_range is 9000 65500
    # For 10g, uncomment 'net.ipv4.ip_local_port_range = 1024 65000', comment 'net.ipv4.ip_local_port_range = 9000 65500' entry and re-run sysctl -p
    # net.ipv4.ip_local_port_range = 1024 65000
    net.ipv4.ip_local_port_range = 9000 65500
    
    # Oracle-Validated setting for vm.min_free_kbytes is 51200 to avoid OOM killer
    vm.min_free_kbytes = 51200
    
    
    HAPPY LEARNING!