Tuesday, May 20, 2008

Get the queue details from the ActiveMQ

Go to $ACTIVEMQ_HOME/bin
run "./activemq-admin query -QQueue=*"

Showing the sql queries and values for hibernate queries - Log4j configurations

1. Add folowing to hibernate.properties
hibernate.show_sql=true

2. add following to loj4j.xml

<appender name="trace" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="/export/home/log_path/trace.log"/>
<param name="Threshold" value="trace"/>
<param name="DatePattern" value="'.'yyyy-MM-dd-HH'.log'"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{DATE} %-5p [%t] %c{1} - %m%n"/>
</layout>
</appender>

<category name="org.hibernate.type">
<priority value="trace"/>
</category>

<category name="org.hibernate.SQL">
<priority value="trace"/>
</category>


Usefull oracle commands

1) sqlplus login
----------------
sqlplus user_name/password@SID


2) Executing a sql scrip in the sql prompt
------------------------------------------
sql>@insertscriptssql.sql


3)Get the last executed statement from sql promt
------------------------------------------------
Execute last statement = /


4)Set the sql view for more human readable format
--------------------------------------------------
SQL> set linesize 300
SQL> set pagesize 500


5) Selecting indexes
---------------------
select index_name,UNIQUENESS,INDEX_TYPE from user_indexes where table_name='TABLE_NAME';
select index_name, column_name from user_ind_columns where table_name = 'TABLE_NAME';



6) Creating a index
--------------------
CREATE INDEX idx_accountholder_msisdn ON ACCOUNTHOLDER (MSISDN) COMPUTE STATISTICS;
CREATE INDEX IDX_SIMCOUNTER_MSISDN ON DEALER_SIM_COUNTER(MSISDN, ICCID);


7) Selecting the ACTIVE/INACTIVE sessions
------------------------------------------
log as system user-> ROOT access = system/password
SELECT USERNAME, STATUS FROM V$SESSION WHERE USERNAME LIKE '%User_name%';

8) Disabling the constraints
-----------------------------
alter table TABLE_NAME disable constraint CONSTRAINT_NAME;


9) Executing a sql script with a stored procedure
--------------------------------------------------
1. Edit the sql scrip with following at the end (carefull about the space line above the .(dot))

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

.

RUN;
-------------------
2. Execute with sql>@scrip_name.sql
3. Check the creation sql>desc STORED_PROCEDURE_NAME;


10) Get the Oracle version
--------------------------
select * from v$version where banner like '%Oracle%';

Usefull shell commands

1) Unzippin tar.gz
------------------
gzip -cd name_of_the-file.tar.gz | tar xfv -


2)Farwading to dev/null log when start up
----------------------------------------
./start_app.sh &> /dev/null &


3) Redirecting a log to dev/null
-------------------------------
ln -s /dev/null event.log


4) Splitting a file into parts
------------------------------
split -b1024*1024*50 event.log


5)Create multiple directories
-----------------------------
mkdir -p test_data/sap/in


6) Zipping a file
------------------
zip -r zip_file_name.zip dir_name/


7) Get the system usage
------------------------
Create a shaell scrip and add folowing:
uptime >> system_load.log
vmstat >> system_load.log
sar -u 10 1 >> system_load.log


8) Get the heap size in64 bit machine
--------------------------------------
Get the applicatin process id >ps -ef| grep java (say its 19543)
jmap -heap -d64 19543


9) Get the machine IP in Solaris
---------------------------------
/sbin/ifconfig -a


10) Get the capasity of the current directory
----------------------------------------------
du -sh


11) Extract and compress jar files
----------------------------------
1. jar -xvf abc.jar ->extract
2. go to the directory with all the directories, jar -cvf abc.jar * ->compress


12) Extracting a war file
-------------------------
jar -xvf customercare.war

Thursday, February 14, 2008

Thursday, November 22, 2007

Mule the leading open source ESB and integration platform

Mule is a messaging platform based on ideas from Enterprise Service Bus (ESB) architectures. An ESB works by acting as a sort of transit system for carrying data between applications within or outside your Intranet. The ESB defines a series of stops, or "endpoints", through which applications can send or receive data onto or from the system. The heart of the system, the messaging bus, is what routes messages between endpoints. The messaging backbone of the ESB is usually implemented using JMS, but any other message server implementation could be used, such as MSMQ, IBM MQ Series or Tibco Rendevouz.

Mule, in fact, goes beyond the typical definition of an ESB. We prefer to define Mule as a light-weight messaging framework that contains a distributable object broker for managing communication between applications. The point of the object broker is to manage service components. These components are called Universal Message Objects or UMOs, and are basically just plain old java objects (POJO). UMOs can exist in the same VM or can be scattered around your network and the Internet. The object broker itself follows a Staged Event Driven Architecture or SEDA design pattern. All communication between UMOs and other applications is made through message endpoints. These endpoints provide a simple and consistent interface to vastly disparate technologies such as JMS, SMTP, JDBC, TCP, HTTP, XMPP, file, etc.

Refer : http://mule.mulesource.org/display/MULE/Home

Start Using it, then you will feel the diffirence

Thursday, October 25, 2007

How to convert CHM file to HTML format

This command only used with Windows platform.

hh.exe -decompile extracted filename.chm

eg:
hh.exe -decompile ss7_html_ebook ss7_ebook.chm