Tuesday, January 22, 2013

Select BLOB Data

select substr(utl_raw.cast_to_varchar2(at.column_name), 341, 41) as MSISDN from archive_tbl at where utl_raw.cast_to_varchar2(at.column_name) like '%01287392728%';

Wednesday, January 9, 2013

CURL Response Time

Http post message which store in request.xml. This command support for SOAP action as well.
curl -o /dev/null -w '\nLookup time:\t%{time_namelookup}\nConnect time:\t%{time_connect}\nPreXfer time:\t%{time_pretransfer}\nStartXfer time:\t%{time_starttransfer}\nRedirect time:\t%{time_redirect}\n\nTotal time:\t%{time_total}\n' -H 'SOAPAction: ""' --header "Content-type: application/soap+xml" -i -d @request.xml -X POST http://www.google.com

Friday, January 4, 2013

OracleValidConnectionChecker - Unexpected error in pingDatabase

Error
[org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker] Unexpected error in pingDatabase

Resolution
Remove the Oracle lib (ojdbc14.jar) from your Ear or War and place it at jboss server/lib directory

Tuesday, August 7, 2012

Include xml file in Maven

Update pom.xml file as below:-
<build>
...
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
...
</build>

Friday, March 2, 2012

Check Oracle DB CharacterSet

SELECT * FROM nls_database_parameters WHERE parameter = 'NLS_CHARACTERSET'

Sunday, December 4, 2011

Check Memory Usage

prstat -s cpu -a -n 8

http://developers.sun.com/solaris/articles/prstat.html

Wednesday, November 2, 2011

Clean Up Oracle DB Space

Free up oracle db space by delete below log:-
/oracle/oracle/product/10.2.0/db_1/network/log/listener.log
using this command :
cat /dev/null > /oracle/oracle/product/10.2.0/db_1/network/log/listener.log
This log was more than 4GB of size. Emptying this file is harmless as it only contains the connection log to the DB.

Monday, October 24, 2011

Check Disk Size

df -h

Saturday, June 18, 2011

Oracle DB Test Client

public class Test{
public static void main(String[] args) {
try {
Connection con=null;
Class.forName("oracle.jdbc.driver.OracleDriver");
con=DriverManager.getConnection(
"jdbc:oracle:thin:@localhost:1521:database_name",
"username",
"password");
Statement s=con.createStatement();
s.execute("
INSERT INTO EMP VALUES
('1', 'William')
");
s.close();
con.close();
} catch(Exception e){e.printStackTrace();}
}
}

Tuesday, April 12, 2011

View IP Domain Name

#cat /etc/hosts

Friday, March 25, 2011

Add Shortcut Key

1. Edit /export/home/user1/.profile
2. Add "alias m1='cd /export/home/user1/jboss-eap-4.3/jboss-as/server/product_prod'"
3. Close putty and logon again

Thursday, December 9, 2010

Oracle Select Date

select * from audit_log
where CREATED_DATE > to_date('08-12-2010','dd-mm-yyyy')

Friday, December 3, 2010

Apache In Linux

Start Apache
goto /usr/local/apache2/bin
type: ./apachectl start

Stop Apache
goto /usr/local/apache2/bin
type: ./apachectl stop

Check Apache Service Available or Not
ps -ef | grep apache

If apache up, it will show something like this:-
daemon 1599 1589 0 10:52:38 ? 0:00 /usr/local/apache2/bin/httpd -k start
daemon 1600 1589 0 10:52:38 ? 0:00 /usr/local/apache2/bin/httpd -k start
daemon 1598 1589 0 10:52:37 ? 0:00 /usr/local/apache2/bin/httpd -k start

Wednesday, October 27, 2010

Convert int to double

int myInt = 255;
System.out.println("int value=" + myInt);

BigDecimal bdInt1 = new BigDecimal(Integer.toString(myInt));
BigDecimal bdInt2 = new BigDecimal(100);

bdInt1= bdInt1.divide(bdInt2);
double d = bdInt1.doubleValue();
System.out.println("double value=" + d);

Convert double to int

double myDouble = 2.55;
System.out.println("double value=" + myDouble);

BigDecimal bd1 = new BigDecimal(Double.toString(myDouble));
BigDecimal bd2 = new BigDecimal(100);

bd1= bd1.multiply(bd2);
int i = bd1.toBigInteger().intValue();
System.out.println("Int value=" + myDouble);

Monday, September 6, 2010

Zip Command

jar -cvf server.zip server.log

Tuesday, August 10, 2010

Export DB Script

exp db_user_name/password@DBSID file=backup_20100810.dmp log=backup_20100810.log owner=db_user_name

Monday, July 26, 2010

Grant All Permission

Grant all permission to all .sh file
1) go to the correct folder directory.
2) type command>> chmod 777 *.sh

Wednesday, July 7, 2010

Unix Command

Copy
cp -r fromFolderName toFolderName

JDK vs JRE

You must have a copy of the JRE (Java Runtime Environment) on your system to run Java applications and applets. To develop Java applications and applets, you need the JDK (Java Development Kit), which includes the JRE