2010年6月14日 星期一

oracle backup

backup control file :
SQL> alter database backup controlfile to trace;
it will generate sid_ora_XXXX.trc at "C:\oracle\product\10.2.0\admin\orcl\udump"

backup tablespace and datafile file:
SQL> spool c:\work_dump/spoolback.txt
SQL> select * from dba_tablespaces;
SQL> select * from dba_data_files;
SQL> spool off;
SQL> exit

DB dump :
C:\Documents and Settings\Administrator>exp system/oracle full=y file="c:/work_d
ump/joseph_'yourDate'.dump" statistics=none inctype=complete
in Linux 'yourDate' can be "date+%Y%m%d%H%M%S"

So we have three file and backup it up to another disk !

LockMode in DAO of Hibernate

public ProfileVO getProfilebyLoginIdLockMode(final String loginId){
ProfileVO vo = null;
List list = (List)this.getHibernateTemplate().execute(new HibernateCallback(){
public Object doInHibernate(org.hibernate.Session session) throws HibernateException, SQLException {
Criteria cri=session.createCriteria(ProfileVO.class,"p");
cri.add(Restrictions.eq("p.loginId", loginId)).setLockMode(LockMode.FORCE);
return cri.list();
}
});

if(list.size()>0){
vo = (ProfileVO)list.get(0);
}
return vo;
}

do not use the following method , because it will get a new persistent context and lock will be failure !

...
Session session = this.getHibernateTemplate().getSessionFactory().openSession();
Transaction tx = session.beginTransaction();
Query query = session.createQuery("from ProfileVO p where p.loginId='"+loginId+"'").setLockMode("p", LockMode.FORCE);
List list1 = query.list();

if(list1.size()>0){
vo = (ProfileVO)list1.get(0);
}
tx.commit();
session.close();

COVID-19 確診經歷紀實

原本以為真的是天選之人,就算先前家裡兩個小孩都確診都逃過了(可能有中獎但無症狀吧),不過就在2023年六月18日破解自認為天選之人的"心態",為什麼可以確認就是這天中獎的呢?因為在前都是居家上班,到人多的室內場所都會戴口罩,就剛好這天傍晚原本只想說要去附近的國...