現場報這個錯,我想模擬一下,看是什麼問題。
在數據庫B上建表:
create table TEST ( A NUMBER, B DATE ); insert into test (A, B) values (2, to_date('16-04-2015 16:38:26', 'dd-mm-yyyy hh24:mi:ss')); insert into test (A, B) values (1, to_date('24-03-2015 16:32:36', 'dd-mm-yyyy hh24:mi:ss')); insert into test (A, B) values (2, to_date('16-04-2015 16:35:19', 'dd-mm-yyyy hh24:mi:ss')); insert into test (A, B) values (2, to_date('16-04-2015 16:35:19', 'dd-mm-yyyy hh24:mi:ss')); commit;
drop database link to_B; create database link to_B connect to B_user identified by B_password using '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.15.10)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )';
SQL> show parameter distributed_lock_timeout; NAME TYPE VALUE ------------------------------------ ----------- ------- distributed_lock_timeout integer 60 SQL> update test@to_B set b = sysdate where A =2; update test@to_B set b = sysdate where A =2 *
ORA-02063: 緊接著 line (起自 TO_B)
等待60s後就報超時,就是distributed_lock_timeout設置的值
解決方案:數據庫B上的事務盡快提交,或者數據庫B上的SQL(update or delete or merge)太慢,需要調優。