rollback_dist_lock.sh 回滾分散式鎖

perfychi發表於2013-02-23
#!/bin/bash
#Author:chipengfei
#Date: 2013-02-23
#Mail:
#Desc: rollback force the abnormal distribute locks
#Usage: bash rollback_dist_lock.sh
 
. /home/oracle/.profile
sqlplus -S  / as sysdba <  roll.sql
set heading off pagesize 0 echo off linesize 200 feedback off trimspool on
select 'rollback force  ''' || LOCAL_TRAN_ID || ''';' || chr(10) ||
'execute DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY(''' || LOCAL_TRAN_ID
 || ''');' || chr(10) || 'commit;' from DBA_2PC_PENDING;
select 'exit;' from dual;
exit;
EOF
 
sqlplus -S / as sysdba @roll.sql

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27042095/viewspace-754626/,如需轉載,請註明出處,否則將追究法律責任。

相關文章