标签:
由于我在前不久的一次项目调试的时候,将一条数据的ID与另一条数据的ID相同了,但不知为什么没有报错,当在页面发现问题时,删除这条数据时就报错了,oralce record is locked by another user
select session_id from v$locked_object; SELECT sid, serial#, username, osuser FROM v$session where sid = 131; ALTER SYSTEM KILL SESSION ‘131,498‘;
这是我当时的SQL代码
实际根据
select session_id from v$locked_object; SELECT sid, serial#, username, osuser FROM v$session where sid = session_id; ALTER SYSTEM KILL SESSION ‘sid,serial#‘;
在从另一个数据库导入表时,有时候两张表的数据字段并不一致相等,需要有其他的做法,我的做法是
insert into DM.DM_MAT_AUX_PLAN_REC(select SYS_GUID(),I_YEAR,I_MONTH,PLANTCODE,‘‘,DEPARTCODE,‘‘,MAT_NO,MAT_DESC,UNIT,F_PRICE,F_NUMBER,INSERTDATE,RECFLAG from NAMM.mm_plan_fc_rec); select distinct COM_CODE_,COM_NAME_ from DM.DM_MAT_AUX_PLAN_REC update DM.DM_MAT_AUX_PLAN_REC set COM_NAME_ = (select ORG_NAME_ from OM.om_org where ORG_CODE_ = ‘6‘) where COM_CODE_ = ‘6‘ select distinct DEPT_CODE_,DEPT_NAME_ from DM.DM_MAT_AUX_PLAN_REC update DM.DM_MAT_AUX_PLAN_REC set DEPT_NAME_ = (select ORG_NAME_ from OM.om_org where ORG_CODE_ = ‘605‘) where DEPT_CODE_ = ‘605‘
对于空缺的再去重逐个导入
oracle遇到的锁异常,oralce record is locked by another user
标签:
原文地址:http://www.cnblogs.com/sunnyroot/p/5929535.html