Sunday, January 13, 2013

OutofMemory error

First application(program) level...


What is Heap space in Java?
When a Java program started Java Virtual Machine gets some memory from Operating System. Java Virtual Machine or JVM uses this memory for all its need and part of this memory is call java heap memory. Heap in Java generally located at bottom of address space and move upwards. whenever we create object using new operator or by any another means object is allocated memory from Heap and When object dies, memory goes back to Heap space in Java

(We can increase or change size of Java Heap space by using JVM command line option -Xms, -Xmx and –Xmn)

Java Heap and Garbage Collection
As we know objects are created inside heap memory and Garbage collection is a process which removes dead objects from Java Heap space and returns memory back to Heap in Java.

 

OutOfMemoryError in Java Heap
When JVM starts JVM heap space is equal to the initial size of Heap specified by -Xms parameter, as application progress more objects get created and heap space is expanded to accommodate new objects. JVM also run garbage collector periodically to reclaim memory back from dead objects. JVM expands Heap in Java some where near to Maximum Heap Size specified by -Xmx and if there is no more memory left for creating new object in java heap , JVM throws java.lang.OutOfMemoryError and your application dies. Before throwing the error, JVM tries to run garbage collector to free any available space but even after that not much space available on Heap in Java it results into OutOfMemoryError.

To resolve this error you need to understand your application object profile i.e. what kind of object you are creating, which objects are taking how much memory etc.

Oracle level.....

Tuesday, January 1, 2013

Oracle Licenseing...

Database License

What is a license
A license is the "right to use" (RTU) the software and not the software itself. If you have a license, you can obtain a copy of the software through whatever means - order, download, use the CDs from your last project, etc.

 Typical Database Software Environments and License
·         Production Environment
·         Test Environment
·         Development Environment

Development Environment:
Customers also may download Oracle technology products from the Oracle Technology Network (OTN) at http://otn.oracle.com/software/. In order to download an Oracle product from OTN, customers must signify their agreement to the terms of the OTN Development License. This limited license gives the user the right to develop, but not to deploy, applications using the licensed products. It also limits the use of the downloaded product to one person, and limits installation of the product to one server.

 The OTN Development License is a limited license, and is not part of the Oracle License and Services Agreement (OLSA).

Test Environment:
All programs used in a test environment must be licensed under an OLSA or other appropriate Oracle (or Oracle authorized reseller) license agreement.

Production Environment:
The environment used by end users for business or other operations is called a production environment. All programs used in the production environment must be licensed under an OLSA or other appropriate Oracle (or Oracle authorized reseller) license agreement.

Oracle Editions  Vs License


is very expensive - and it should be: It is the most powerful database management system on the planet!
 
costs about the same as Microsoft SQL Server. It can only be licensed on servers, or server clusters, that have a maximum capacity of 4 processor sockets.
is less expensive than SQL Server. It may only be licensed on servers that have a maximum capacity of 2 processor sockets.
is very inexpensive, full-featured version of Oracle DB, but is restricted to one user per database (server, not instance, most likely). The license however allows a developer to use all of the features of the EE including the options (with the exception of Real Application Clusters).
Oracle Enterprise Manager (OEM)
Database Control and Grid control is provided free of charge, however, the management packs needs to be licensed for the number of users or CPU's that you "monitor" with it.

 
Oracle DB edition
licensed using
licensed using
 
User Plus metric
Processor metric
Standard Edition One
YES
YES
Standard Edition
YES
YES
Enterprise Editions
YES
YES
Personal Edition
YES
NO

 Named User Plus: This metric can be used in all environments. Different minimums apply depending on the Database edition:

• Standard Edition One requires a minimum of 5 Named User Plus licenses or the total number of actual users, whichever is greater. Oracle Standard Edition One may only be licensed on servers that have a maximum capacity of 2 sockets.

• Standard Edition requires a minimum of 5 Named User Plus licenses or the total number of actual users, whichever is greater. Oracle Database Standard Edition can only be licensed on servers that have a maximum capacity of 4 sockets.

• The Enterprise Edition requires a minimum of 25 Named User Plus per Processor licenses or the total number of actual users, whichever is greater.

Note :
When licensing the Oracle Database by Named User Plus, all users who are using the Oracle Database, as well as all non-human operated devices that are accessing the Oracle Database must be licensed. The following licensing rules apply:

• If non-human operated devices such as sensors are connecting to the Oracle Database, then all devices need to be licensed.

• If human-operated devices such as bar code scanners are connecting to the Oracle Database, then all humans operating these devices need to be licensed.

• If non-human operated devices and human-operated devices are connecting to the Oracle Database and are mutually exclusive, then all non-human devices and all humans operating devices need to be licensed.

Processor:
Oracle has a special definition of "processor" which may or may not match that of your hardware vendor

This metric is used in environments where users cannot be identified and counted. The Internet is a typical environment where it is often difficult to count users. This metric can also be used when the Named User Plus population is very high and it is more cost effective for the customer to license the Database using the Processor metric.

The number of required licenses shall be determined by multiplying the total number of cores of the processor by a core processor licensing factor specified on the Oracle Processor Core Factor Table which can be accessed at http://oracle.com/contracts. All cores on all multicore chips for each licensed program are to be aggregated before multiplying by the appropriate core processor licensing factor and all fractions of a number are to be rounded up to the next whole number.

When licensing Oracle programs, a processor is counted equivalent to a socket; however, in the case of multi-chip modules, each chip in the multi-chip module is counted as one occupied socket.

For example, a multicore chip based server with an Oracle Processor Core Factor of 0.25 installed and/or running the program (other than Standard Edition One programs or Standard Edition programs) on 6 cores would require 2 processor licenses (6 multiplied by a core processor licensing factor of .25 equals 1.50, which is then rounded up to the next whole number, which is 2). As another example, a multicore server for a hardware platform not specified in the Oracle Processor Core Factor Table installed and/or running the program on 10 cores would require 10 processor licenses (10 multiplied by a core processor licensing factor of 1.0 for ‘All other multicore chips’ equals 10).

Note on Minimums: Product Minimums for Named User Plus licenses (where the minimums are per processor) are calculated after the number of processors to be licensed is determined, using the processor definition.

Other two famous types of Licenses as below

Application Specific Full Use Licensing

An Application Specific Full Use (ASFU) license is a restricted type of license sold by a Solution Provider in conjunction with its third-party Application Package.

For example, you can buy a ASFU license from SAP AG to use Oracle with the SAP/R3 system. This license would then be application specific and cannot be used for anything else.

Embedded Software License

An Embedded Software License (ESL) is a very restrictive license type available from Independant Software Vendors (ISVs) who embed Oracle technology into their product. An end-user may not even be aware that the software package contains Oracle technology and should not be able to access it directly as a developer or system administrator.

Some useful scripts : License

Features used/not used: (from 10g)

Set feedback off
Set linesize 122
Col name             format a45     heading "Feature"
Col version          format a10     heading "Version"
Col detected_usages  format 999,990 heading "Detected|usages"
Col currently_used   format a06     heading "Curr.|used?"
Col first_usage_date format a10     heading "First use"
Col last_usage_date  format a10     heading "Last use"
Col nop noprint

Break on nop skip 1 on name
Select decode(detected_usages,0,2,1) nop,
       name, version, detected_usages, currently_used,
       to_char(first_usage_date,'DD/MM/YYYY') first_usage_date,
       to_char(last_usage_date,'DD/MM/YYYY') last_usage_date
from dba_feature_usage_statistics
order by nop, 1, 2
/

Number of users and CPU/Processors: 
select * from v$license;

Please note that the information provided by this command is not trustworthy on multi-threaded, multi-core or virtual systems. It is the number of processors understood to be available by the database - not the number of processors which must be licensed.