Monday, 4 July 2011

Oracle Export : Using QUERY parameter in expdp/impdp

Oracle Export : Using QUERY parameter in expdp/impdp

expdp test/test directory=test_dir dumpfile=test.dmp query=emp:\"where salary\>10000\ order by salary" tables=emp

Easy a would be pass the query parameter through a file.

exp test@testdb tables=test_export parfile=test_query.par

Inside of test_query.par, it contains only one parameter query: 
Query=”where salary >10000  order by salary"


http://wiki.oracle.com/page/Oracle+export+and+import+
http://www.orafaq.com/wiki/Import_Export_FAQ

To verify user privileges:
select * from dba_sys_privs;
select * from dba_role_privs;
select * from dba_tab_privs;

select * from user_sys_privs;
select * from user_role_privs;
select * from user_tab_privs;

select * from all_sys_privs;
select * from all_role_privs;
select * from all_tab_privs;

select * from role_sys_privs;
select * from role_role_privs;
select * from role_tab_privs;

Friday, 4 March 2011

Create Mule Project with Maven

Create Mule Project with Maven
        mvn org.mule.tools:mule-project-archetype:create -DartifactId=message-enricher-1 -DmuleVersion=3.1.1
or
Add "org.mule.tools" to setting.xml as pluginGroup and run following command
      mvn mule-project-archetype:create -DartifactId=CES-DataX -DmuleVersion=3.1.0

Monday, 21 February 2011

Search a string in directory

Search a string in directory

Shell Script

for i in `ls *`
do
echo $i
cat $i | grep search-string
done

Tuesday, 11 January 2011

Why HibernateSession.flush()


Reference:

http://docs.jboss.org/hibernate/core/3.3/reference/en/html/objectstate.html#objectstate-flushing

Default behavior:

Flushing the session forces Hibernate to synchronize the in-memory state of the session with the database but does not commit the changes to database.

Usage:


  • To force database validation (database constraints) and handle the error no need to wait until commit
  • To check duplicate (Force the row to be inserted)
  • To get an assigned id
  • To update the size of session