Monday, December 3, 2007

Analyzing the data when it is large.

While i was trying to improve the performance of one of my project functionality, its not always good to drill the data from top to bottom where you may end up with so many transactions in the server.

When you got to know , in future that this data will be growing, then while implementing any of the functionality on that data , identify and consider the driving parameters to get the data and try analying it. So when dealing with large datas, its good you go retrive the data in denormalized way so that you get minimum data to be processed rather than large.

Monday, November 26, 2007

SSL in Weblogic

This blog is a bit specific to the application level. Well, but will try to make it generalized so that this entry can be useful to others. And thanks to Abhishek who hepled me in setting for my app.

For making your application SSL secured ,which is deployed in Weblogic application server here are the the following steps :

Steps to setup SSL in Weblogic -

1. Firslty you need to create the java keystore :
a) Type the command -

C:\bea\jrockit81sp4_142_05\bin> keytool -genkey -alias servercert -keyalg RSA
-keysize 1024 -dname "CN=jsvede.bea.com,OU=DRE,O=BEA,L=Denver,S=Colorado,C=US"
-keypass test -keystore server_keystore.jks -storepass test


b) To view the jks file generated -

C:\bea\jrockit81sp4_142_05\bin> keytool -list -v -keystore server_keystore.jks
-storepass test



2. Create csr file ie, .per file :

a) Type the command -

C:\bea\jrockit81sp4_142_05\bin> keytool -certreq -v -alias servercert
-file csr-for-myserver.pem -keypass test -storepass test
-keystore server_keystore.jks


b) To view the generated .pem file -

C:\bea\jrockit81sp4_142_05\bin> more csr-for-myserver.pem


3. Configure in the weblogic :

a) Goto Weblogic console -> Servers -> myserver -> KeyStores & SSL ->
KeyStore Configuration -> Change

b) Select Custom Identity and Java Standard Trust.

c) Set the following properties -
- Custom Identity KeyStore : E:\bea\jrockit81sp4_142_05\bin\server_keystore.jks
- Custom Identity Keystore Type : jks
- Custom Identity Keystore Pass Phrase : tradex
- Java Standard Trust Key Store Pass Phrase : tradex
- Click on continue
- Private Key Alias : servercert
- Pass Phrase : tradex
- Click on Continue
- Finish

d) In domains -> mydomain -> config.xml,

Set the following in the <server> tag

<SSL Enabled="true" HostnameVerificationIgnored="false"
IdentityAndTrustLocations="KeyStores" Name="admin"
ServerPrivateKeyAlias="servercert"
ServerPrivateKeyPassPhraseEncrypted="{3DES}OoO7mtolODVhXfQVNGO+8Q=="/>

(You can give the encrypted password as empty also.)

e) In web.xml, set <transport-guarantee> value as
'INTEGRAL' or 'CONFIDENTIAL'.


Note :
pem - Privacy Enhanced Mail Security Certificate.
jks - JavaKeyStores
csr - Certificate Signing Request

Thursday, November 1, 2007

"Scrum For Team System"

For those who all believes in team and teamwork. Will give you a slight review what i am taking about.

The "Scrum For Team System" is useful to improve a team in their performance, understanding and delivering quality results.

Have "Daily Scrum Meeting" and keep doing well.

You get to know more about it from following link, chk out and do implement with your team as we have implemented it successfully :)

http://www.scrumforteamsystem.com/ProcessGuidance/Scrum/Scrum.html


Friday, October 26, 2007

p6spy Software.

This software is used in the applications as of which database queries are fired on each click from UI.By this , life becomes easier to analyze the queries and optimize them.

Go to the below link for downloading and details :- (download p6spy-install.zip)

http://www.p6spy.com/download.html

The zip file has steps to setup the p6spy.
Its pretty easy.

Thursday, October 18, 2007

Oracle explain plan

When u got to know how does ur query is scanned by the Oracle, then here is the way u can get it.
Its called 'explain plan' which describes the how the query is analyzed and how it is looking the tables and also how effecient the indexes are used.

If you got to know more abt it, well there are many sites for it. Here is one for quick reference

http://www.csee.umbc.edu/help/oracle8/server.815/a67775/ch13_exp.htm


Here are the couple of things you need to create and do for getting a explain paln for a query.

Step 1 :- Create table plan_table.

CREATE TABLE PLAN_TABLE (
STATEMENT_ID VARCHAR2(30),
TIMESTAMP DATE,
REMARKS VARCHAR2(80),
OPERATION VARCHAR2(30),
OPTIONS VARCHAR2(30),
OBJECT_NODE VARCHAR2(128),
OBJECT_OWNER VARCHAR2(30),
OBJECT_NAME VARCHAR2(30),
OBJECT_INSTANCE NUMBER(38),
OBJECT_TYPE VARCHAR2(30),
OPTIMIZER VARCHAR2(255),
SEARCH_COLUMNS NUMBER,
ID NUMBER(38),
PARENT_ID NUMBER(38),
POSITION NUMBER(38),
COST NUMBER(38),
CARDINALITY NUMBER(38),
BYTES NUMBER(38),
OTHER_TAG VARCHAR2(255),
PARTITION_START VARCHAR2(255),
PARTITION_STOP VARCHAR2(255),
PARTITION_ID NUMBER(38),
OTHER LONG,
DISTRIBUTION VARCHAR2(30)
);

Step 2 :- execute the following in your sql

explain plan for
paste your query here
select
substr (lpad(' ', level-1) || operation || ' (' || options || ')',1,30 ) "Operation",
object_name "Object"
from
plan_table
start with id = 0
connect by prior id=parent_id;

truncate table plan_table;

By this you would be getting the detailed plan of a query.

-----------------------------------------------------------------------

And if you want the statistics of the query, try the below one :-

SET AUTOTRACE ON EXPLAIN STATISTICS;
ALTER SYSTEM FLUSH SHARED_POOL;
set timing on;
paste your query here

------------------------------------------------------------------------

Its always good that before using any query in your project, try do explain plan which may lead you to better query performance and optimization.

Tips:
- Bitmap indexes are very faster than the normal unique one but use appropriately.
- Create index on every foreign key you create. Its a good practice.
- If a table is used more for reading , create more indexes on it. And if a table is used for writing
then avoid creating indexes as it increases the cost of creation.


Here are list of few basic things abt sql oracle as i am still a learner. You get many sites to refer.You have to just remember them. No need to note down like i am doing ;)

- for concate : - ||
- for quote :- '' (type two times)
- for storing query output
- type :- query and enter
- type :- spool C:\sample.sql
- type :- /
- type :- spool off

- for making ur header off
- set heading off

Link for ref:
http://pages.cs.wisc.edu/~dbbook/openAccess/thirdEdition/Oracle/user_guide/oracle_guide.html

. . . .

Tuesday, September 4, 2007

Aspect Oriented Programming

Well, to have an overview on AOP, its an 'aspect oriented' extension to the java programming language.

It basically makes your busimess logic more focused and clean.
Firstly need to identify the aspects (like logging, locking, etc). And this aspects can be applied to the normal business logic.

To implement the AOP in Java , we have AspectJ which is developed by Xerox.

All valid Java programs are lso valid AspectJ programs, but AspectJ also allows programmers to define special constructs called aspects.
Aspects can contain several entities unavailable to standard classes.

Those are:
- inter-type decleratons
- pointcuts
- advice

Thursday, July 12, 2007

Liferay downloads

For setting up the liferay portal with tomcat for db oracle download the followings from Liferay Home site-

- liferay-portal-sql-oracle-10-4.2.2.dmp :- load the dmp file into ur oracle.

Note : To load the huge dmp files to oracle db u can use the following cmd.

Eg: c:\oraclexe\app\oracle\product\10.2.0\server\BIN> imp system/system
file=c:\liferay-portal-sql-oracle-10-4.2.2.dmp fromuser=LPORTAL touser=liferay

- liferay-portal-tomcat-5.5-4.3.0.