Wednesday, June 17, 2015

Indexing (Cluster and non Cluster)

Indexing is similar to what we used day to day life while reading book. Our hand book has a index which help us to find the desired data in less amount of time. We use to search the string in the Index which specify us to go to page where if reside.


Same is the case with Indexing in Oracle. In Oracle data are stored in Table. When the data grows in huge quantity it becomes difficult for searching the data. For this purpose Oracle use the same Indexing concept.

There are two type of Indexing


1-      Cluster:- In cluster indexing data are arranged physically in the same fashion as it is indexed. Best example is primary key index. By doing Cluster index all the rows are sorted and arranged physically on Hard disk as per the sequence given by cluster index.


2-      Non-Cluster:- In non-cluster environment oracle maintain a list with values that store the pointer to the index values. Having said this we can have more than one non-cluster index for a single table. More over this non-cluster index is logical in nature means not stored physical on hard disk.
Now the concern is which one to us. Use this thum rule
-          If we want to perform select operation more go for Cluster index.

-          If we want to perform update, Insert etc operation go for Non-Cluster Index.

Normalization and Denormalization in terms of Oracle Database.

Normalization means storing of data in scatter manner. i.e. more than one table. This process describes to divide the table into many small table with reference to each other. This will help us to Write the data.



DeNormalization means storing of data in one manner. i.e. combining data of different table in one table. This will help us to read the data.

How to get ride of Two declarations cause a collision in the ObjectFactory class, ] A class/interface with the same name or This error is caused because on Windows you cannot have both

Generally we use wsimport to auto generated JAVA class for consuming WSDL base web service.

Many times it happens we use to see this specific type of error messages while auto generating code.

 [ERROR] Two declarations cause a collision in the ObjectFactory class.
[ERROR] A class/interface with the same name "XXXClassName" is already in use. Use a class customization to resolve this conflict.
[ERROR] This error is caused because on Windows you cannot have both "XXXClassName.java" and "xxxClassname.java" in the same directory.
[ERROR] This error is caused because on Windows you cannot have both "xxxClassName.java" and "PersistentObjectOfInt.java" in the same directory.

This are the possible ways which I tried and able to get ride of these errr:

Option 1:- This is simple option which works 90% of times. Use –B-XautoNameResolution.
Option 2:- This error is created because your XSD or WSDL is forcing to wsimport command to create java class of same name in same package. So if we not so strict in creating the auto generated source file in our specific folder neglect –p option.
Option 3:- Create binding.xml to get ride of this error. Through this we can tell wsimport to create class with the name specified by us rather than auto generating class name. But as stated in this if we had more than one schema in WSDL then for all name conflict we have to do the same.
Make sure when we create binding.xml  add it command prompt using –b option.

Example of binding.xml
        jxb:bindings node="//xs:element[@name='cxml.payment']/xs:complexType">
     name="CxmlInnerPaymentType" />