Friday, 27 April 2012

Login issues in Oracle Apps R12


Application version: 12.0.4 running on 11g RAC database.

None of the users are able to login to the Oracle Apps R12 URL. The URL just hangs without giving any information.

All the application services were up. Couldn’t find any significant load on the CPU and the number of concurrent requests running at the time was normal.

The http error_log had the below error:

oc4j_socket_recvfull timed out

The Application log has the below error:

12/04/26 03:15:13.511 html: Servlet error
java.lang.OutOfMemoryError: Java heap space
12/04/26 03:50:35.503 html: Servlet error

The opmn log had the below error:

12/04/26 03:15:00 java.lang.OutOfMemoryError: Java heap space
12/04/26 03:15:02 java.lang.OutOfMemoryError: Java heap space
12/04/26 03:15:06 java.lang.OutOfMemoryError: Java heap space
12/04/26 03:15:13 Exception in thread "Timer-1" java.lang.OutOfMemoryError: Java heap space
oracle.jbo.DMLException: JBO-26066: Error during rollback


Solution:

We would need to do changes to -Xms ( for start heap memory ) and -Xmx ( for maximum heap memory ) of the opmn.xml. Changing the Xmx to 512 MB and Xms to 128 MB will help.

>>>> Increase Java Heap Size for the OC4J instance as per the available memory (RAM) & restart the instance.
You can do it with AS Control -> OC4J Instance -> Administration Tab -> Server Properties -> Java options. Update -Xms -Xmx java options. Once updated, stop and start the OC4J instance to pick up the changes.

Tuesday, 24 April 2012

Oracle VM


In today’s article I wanted to focus a little bit about some interesting information I came across with Oracle VM 3.0 and the bundled Oracle Database Express Edition (XE).

 In previous version of Oracle VM (i.e. 2.1.x – 2.2.x), Oracle supported Oracle XE databases for it’s production environments (to my knowledge anyway, never seen any documentation to say otherwise). However, with the new instalment of Oracle VM 3.0 that has changed. Oracle’s new stance is for non-production environments you can use the bundled Oracle XE database found within the Oracle VM 3.0 Manager media, however if you want to have production support you are required to install Oracle Database Standard Edition (SE) or Enterprise Edition (EE).

 It never mentioned what version of Oracle SE or EE, but I’d assume an 11g database would be appropriate assumption. So what exactly does that mean for you?
 Well for one, prior to installing the Oracle VM 3.0 Manager media, you will need to have an Oracle Database SE or EE installed on your system. Once you have completed that step, when installing the Oracle VM 3.0 Manager, select your Installation type to be ‘Standard’ (‘Simple’ will auto install the bundled Oracle XE database), then select option two  ‘Use an existing Oracle database’ and enter the appropriate credentials.

Hope you enjoyed the article and keep an eye out for future articles to come.

Friday, 20 April 2012

How to Find version


1. How to find Apps Version (11i/R12/12i)
 >> Connect to database as user apps

SQL> select release_name from apps.fnd_product_groups;
Output would be  like 12.0.4 or 11.5.10.2

2. Web Server/Apache or Application Server in Apps 11i/R12

>> Log in as Application user, set environment variable and run below:

 $IAS_ORACLE_HOME/Apache/Apache/bin/httpd –version

Output for 11i should be like :

Server version: Oracle HTTP Server Powered by Apache/1.3.19 (Unix)
Server built:   Jan 26 2005 11:06:44 (iAS 1.0.2.2.2 rollup 5)

Output for R12 should be like :

Server version: Oracle-Application-Server-10g/10.1.3.0.0Oracle-HTTP-Server
Server built:   Dec  4 2006 14:44:38

3. Forms & Report version (aka developer 6i) in 11i

>> Log in as Application user, set environment variable and run below query:

$ORACLE_HOME/bin/f60run | grep Version | grep Forms

Output would be  like :
Forms 6.0 (Forms Runtime) Version 6.0.8.25.2 (Production)
Check fourth character in version 25 which means Forms 6i patchset 16 (25-9)

4. Forms & Report version in R12/12i

 >> Log in as Application user, set environment variable and run below query:

$ORACLE_HOME/bin/rwrun | grep Release

Output should be like:

Report Builder: Release 10.1.2.2.0
You can safely ignore warnings

5. Oracle Jinitiator in 11i/R12/12i

 >> Log in as Application user, set environment variable and run below query:

grep jinit_ver_comma $CONTEXT_FILE  

(Default is Java Plug-In for R12/12i )

6. Oracle Java Plug-in in 11i/R12/12i

>>Log in as Application user, set environment variable and run below query:

grep plugin $CONTEXT_FILE


7. File Version on file system

 >>adident Header <filename>

Or

strings <file_name> | grep Header

Here adident is AD Utility (Oracle Apps) and strings is Unix utility

8. Version of pld file

>> *.pld are source code of *.pll which are inturn source of *.plx.  *.pll is in $AU_TOP/resource and to find its version check

adident Header $AU_TOP/resource/<filename>.pll

IGSAU012.pll:
$Header IGSAU012.pld 115.1.115100.1 2004/04/01 05:40:18 appldev ship $

Or

strings $AU_TOP/resource/<filename>.pll | grep -i header

FDRCSID(’$Header: IGSAU012.pld 115.1.115100.1 2004/04/01 05:40:18 appldev ship $’);

9. OA Framework Version

 >> http:// hostname.domainName:port/OA_HTML/OAInfo.jsp (Only for 11i); Log in as Application user, set environment variable and run below query:

adident Header $FND_TOP/html/OA.jsp
adident Header $OA_HTML/OA.jsp

output for both should look like
$Header OA.jsp 115.60 2006/03/31 00:47:28 atgops1 noship $

120.21 means OA Framework Version (coming soon..)
115.60 means OA Framework Version (coming soon..)
115.56 means OA Framework Version (coming soon..)
115.36 means OA Framework Version 5.7
115.27 means OA Framework Version 5.6E
115.26 means OA Framework Version 5.5.2E

10. Discoverer Version for 11i (3i or 4i)

>> Log in as Application user, set environment variable and run below query:

$ORACLE_HOME/bin/disc4ws | grep -i Version

Discoverer Version for 11i or R12 (10g AS) >> Check under Application Server Section as 10g AS Discoverer is on standalone.

11. Workflow Version with Apps

 >> Connect to Database as apps user

SQL> select TEXT Version from   WF_RESOURCES where  NAME = ‘WF_VERSION’;

Output like 2.6.0 means workflow version 2.6.0

12. Oracle Single Sign On

>> Connect to database which holds SSO repository:

SQL>select version from orasso.wwc_version$;

13. Oracle Internet Directory

>> There are two components in OID (Software/binaries & Schema/database)

>>> To find software/binary version

$ORACLE_HOME/bin/oidldapd –version

output should look like

oidldapd: Release 10.1.4.0.1 - Production on thu sep 11 11:08:12 2008
Copyright (c) 1982, 2006 Oracle.  All rights reserved.

>>> To find Schema Version/ database use

ldapsearch -h <hostname> -p <port> -D “cn=orcladmin” -w “<password>” -b “” \
-s base “objectclass=*” orcldirectoryversion

and output should be like

version: 1
dn:
orcldirectoryversion: OID 10.1.4.0.1

or

 Run following query in database

SQL> select attrval from ods.ds_attrstore where entryid = 1 and attrname = ‘orcldirectoryversion’;

Output should be like OID 10.1.4.0.1

14. Application Server

>> Oracle Application Server (Prior to Oracle WebLogic Server)

If application server is registered in database (Portal, Discoverer) check from database:

SQL> select * from ias_versions;

Or

SQL>select * from INTERNET_APPSERVER_REGISTRY.SCHEMA_VERSIONS;

AOC4J (Oracle Container for J2EE)
Set ORACLE_HOME
cd $ORACLE_HOME/j2ee/home
java -jar oc4j.jar -version

15. Oracle Portal

>> SQL> select version from portal.wwc_version$;

16. Database Component

I) Oracle Database

To find database version:

SQL> select * from v$version;

Or

All component version in database:

$ORACLE_HOME/OPatch/opatch lsinventory -detail

17. Oracle Enterprise Manager

>> Metalink Note 605398.1: How to  find the version of the main EM components

18. Unix Operating System

Solaris -> cat /etc/release
Red Hat Linux -> cat /etc/redhat-release

How to resolve cloning issue: BEGIN failed--compilation aborted at adcfgclone.pl line 26.



While running adcfgclone.pl as a part of database Tier clone, the below mentioned error occurs:
  
-bash-3.00$ perl adcfgclone.pl dbTechStack

Can't locate strict.pm in @INC (@INC contains: /ade/smayer_perl58_main_linux/perl58/bin/Linux/Opt/lib/5.8.3/i686-linux-thread-multi /ade/smayer_perl58_main_linux/perl58/bin/Linux/Opt/lib/5.8.3 /ade/smayer_perl58_main_linux/perl58/bin/Linux/Opt/lib/site_perl/5.8.3/i686-linux-thread-multi /ade/smayer_perl58_main_linux/perl58/bin/Linux/Opt/lib/site_perl/5.8.3 /ade/smayer_perl58_main_linux/perl58/bin/Linux/Opt/lib/site_perl .) at adcfgclone.pl line 26.
BEGIN failed--compilation aborted at adcfgclone.pl line 26.

As indicated in the above error message, this is due to the PERL setting. We dint have the PERL5LIB set :

-bash-3.00$ echo $PERL5LIB

-bash-3.00$ which perl
/d02/oradev/devdb/10.2.0/perl/bin/perl

Resolution: $PERL5LIB was set to resolve the issue:

Contents under $ORACLE_HOME/perl :

-bash-3.00$ ls -ltr /d02/oradev/devdb/10.2.0/perl

total 16
drwxr-x---  2 oradev dba 4096 Feb  9 04:33 include
drwxr-x---  2 oradev dba 4096 Feb  9 04:33 bin
drwxr-x---  4 oradev dba 4096 Feb  9 04:33 lib
drwxr-x---  4 oradev dba 4096 Feb  9 04:33 man

Contents under $ORACLE_HOME/perl/lib:

-bash-3.00$ ls -ltr /d02/oradev/devdb/10.2.0/perl/lib
total 8
drwxr-x---   3 oradev dba 4096 Feb  9 04:33 site_perl
drwxr-x---  44 oradev dba 4096 Feb  9 04:33 5.8.3

-bash-3.00$ PERL5LIB=/d02/oradev/devdb/10.2.0/perl/lib/5.8.3
-bash-3.00$ export PERL5LIB

-bash-3.00$ id
uid=500(oradev) gid=502(dba) groups=502(dba)

-bash-3.00$ echo $PERL5LIB
/d02/oradev/devdb/10.2.0/perl/lib/5.8.3


Note: The same error might also occur while running adpreclone.pl on DB tier, if the PERL settings are not in place.

Thursday, 19 April 2012

Why do have 2 sets of sql statements to create control file in a trace file?


When there is a need to perform a database clone or create a new control file and open the database, we do:

Alter database backup controlfile to trace ; (In the source system.)

This generates a trace file in the udump. We copy the appropriate set of statements from the trace into a script file, perform edit as necessary, and execute it when there is a need to re-create the control file.


Have we noticed that there are 2 sets of sql statements in the trace file to create a new control file?

Why do we have it?

-    The First set of sql statement  is for NORESETLOGS Case:

Example:
                             STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "PROD" NORESETLOGS  ARCHIVELOG
--  SET STANDBY TO MAXIMIZE PERFORMANCE


This opens the database with the NORESETLOGS option and should be used only if the current versions of all online logs are available.


- The second set of sql statement is for RESETLOGS CASE
Example:
                                                                   STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "PROD" RESETLOGS  ARCHIVELOG
--  SET STANDBY TO MAXIMIZE PERFORMANCE


This will create a new control file and will open the database with the RESETLOGS option. The contents of online logs will be lost and all backups will be invalidated. This is used ONLY if online logs are damaged.

Change port in Oracle Apps 11i


Web listener port has a default value: 8000.
The entry in the context file for web listener port value is: s_webport
  
Example:

         <web_port oa_var="s_webport" oa_type="PORT">8021</web_port>
         <web_port_pls oa_var="s_webport_pls" oa_type="PORT">8221</web_port_pls>
  
Here the port is 21: 8021

To change the port value, change the context file with the new port number (While all application services are down) and run Autoconfig.This Process can be followed to change some ports individually.


To change port value we can follow below mentioned step as well:

-       Run adpreclone.pl:
  • Set the Applications Environment by sourcing $APPL_TOP/APPSORA.env
  • "cd" to $COMMON_TOP/admin/scripts/$CONTEXT_NAME
  • Execute "perl adpreclone.pl appsTier"
-        Run adcfgclone.pl:
  • Stop all oracle services for Applications by running "adstpall.sh".
  • "cd to "$COMMON_TOP/clone/bin
  • Execute "perl adcfgclone.pl appsTier"
  • Enter new port pool number when prompted

Semaphores and Shared memory


Semaphores are a system resource that Oracle utilizes for inter-process communication (IPC) and they occupy a relatively small memory space, while shared memory is utilized to contain the SGA and can garner a large portion of physical memory.


Operating System kernel parameters change can take effect only after system is rebooted.

Both semaphore and shared memory errors appear primarily at instance startup (The 'startup nomount' stage specifically). This is the only time that Oracle tries to acquire semaphores and shared memory for the instance. Errors related to semaphores or shared memory rarely appears during normal database operations.

The most common circumstance in which these errors occur is during the creation of a new database.

Sometimes when an Oracle instance crashes, however, its shared memory segments may not be released by the OS. This limits the overall amount of shared memory available for the instance to start up again. In this case, you will need to remove those segments manually.


This can be avoided:

The first and most simple fix is to modify the init<sid>.ora to reduce the number of semaphores or the amount of shared memory Oracle will try to grab at instance startup.

If your situation requires that you not reduce the appropriate init<sid>.ora parameters, you will have to modify the operating system kernel to allow the OS to provide more
semaphores or allow larger shared memory segments.


With Oracle8, Oracle8i, Oracle9i and Oracle10g:

The number of semaphores required by an instance is equal to 2 times the setting of the 'processes' parameter in the init<sid>.ora for the instance.
Keep in mind, however, that Oracle only momentarily grabs 2 X 'processes' then releases half at instance startup.
This measure was apparently introduced to ensure Oracle could not exhaust a system of semaphores.

Oracle may also grab a couple of additional semaphores per instance for internal use.

On most Unix systems, current semaphore allocation can be displayed with the OS command 'ipcs -s'.
     % ipcs -s


An application requests a given amount of contiguous shared memory from the OS. The OS dictates how large of a shared memory segment it will allow with the kernel parameter SHMMAX(Shared Memory Maximum). If the amount of shared memory requested by the application is greater than SHMMAX, the OS may be granted the shared memory in multiple segments. Ideally, however, you want the amount requested by the application to be less than SHMMAX so that the application's request can be fulfilled with one shared memory segment
Since the SGA is comprised of shared memory, SHMMAX can potentially limit how large your SGA can be and/or prevent your instance from starting.

Remember that SHMMAX is a high water mark, meaning that the OS will attempt to allow up to that amount for an application.

How to clear a stuck session:

  1. Identify the shared memory segment that is 'stuck' in memory.
  2. Remove the 'stuck' shared memory segment using the OS command 'ipcrm'.
           Example:

             Find the shmid

               % $ORACLE_HOME/bin/sysresv

               IPC Resources for ORACLE_SID "PROD" :
               Shared Memory:
               ID              KEY
               12189717        0x7c4602e0
               Semaphores:
               ID              KEY
               41484299        0xdfc4f220
               Oracle Instance alive for sid "PROD"

             Linux:
               % ipcrm shm 12189717

             Other Unix:
               % ipcrm -m 12189717


Note: We can also use the ipcs command to obtain a list of the system current shared memory segments and semaphore sets, along with their identification numbers and owner. The ipcrm command can be used to clear the stuck session using the shmid.

Wednesday, 18 April 2012

Oracle Web Logic Server (WLS) Overview


Domain:

          A logically related group of WebLogic Server instances that you manage from a single set of configuration artifacts.

A Domain has:

          Servers
          Clusters of servers
 Server:

          A configured instance to host applications and resources
          WebApps, Enterprise Apps, Web Services, …
          JMS, JDBC, Diagnostics, …

Server types are:

          Administration Server :

       Central configuration controller for the entire domain.
Hosts the Administration Console
Enables you to start and stop servers from a central location
Enables you to migrate servers and services within the domain
Enables you to deploy applications within the domain


          Managed Server :
                     
 A running instance that hosts applications and resources needed by those applications - The real work horses in a WebLogic domain
Each Managed Server is independent of all other Managed Servers in the domain (unless they are in a cluster, defined later)
You can have as many Managed Servers in a domain as you need
Individual Managed Servers are typically added for capacity and application isolation


Cluster:


          A cluster is a group of Managed Servers running simultaneously and working together to provide increased scalability and reliability
          Scalability: through parallelism
          Reliability/Availability: through replication and redundancy
          A cluster appears as a single instance to most clients.
          Clusters enable some advanced features, such as Whole Server Migration, Service Migration, and clustered JMS destinations.

  
Node Manager:


          Utility/process running on a physical server that enables you to start, stop, suspend, and restart WebLogic Server instances remotely
          Must run on each physical server that hosts WebLogic Server instances that you want to control with Node Manager
          Not associated with a domain. Can start any server instance that resides on the same physical server.
          Optional, but required to start/stop servers using the Administration Console
          Required for Whole Server Migration and for some configurations of Automatic Service Migration

 Machine:

          A definition that identifies a particular, physical piece of hardware.
          A machine definition is used to associate a computer with the Managed Servers it hosts.
          Used by Node Manager in restarting a failed Managed Server
          Used by a clustered Managed Server in selecting the best location for storing replicated session data

  
Configuration files:


          config.xml – central configuration file for a domain
          includes the configuration of each server instance, cluster, resource, and service in the domain.
          references additional XML files that are stored in subdirectories of the domain/config directory: JMS, JDBC, WLDF, and Security
          All files are based on schemas

 Administration Tools:


          Configuration Wizard
          GUI/scriptable tool to create and extend WebLogic domains
          Template based
          Administration Console
          Browser-based tool for configuring and monitoring domains, deploying applications, and controlling servers
          WebLogic Scripting Tool (WLST)
          Script or command line tool to do the same thing as the Administration Console and Configuration Wizard
          Note that we will cover details on WLST in a separate document
          weblogic.Admin
          Deprecated command line tool for configuring a domain
          Recommend using WLST instead
          weblogic.Deployer
          Command line tool for deploying applications
  
Note:


          WebLogic Server configuration is segmented by domain

          Each domain represents a configuration entity and uses one set of configuration artifacts
          Each domain has one Administration Server, and can have multiple managed servers and clusters

          Node Manager is a per-machine process used to start and stop WebLogic Server instances

          There are a number of administration tools available for configuring and managing a WebLogic domain:
          Config Wizard, Admin Console, WLST, weblogic.Deployer