数据库在DBUA升级时,若存在分布式事务锁,升级过程无法继续进行。
处理方法:
[oracle@ydhl ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Sat Nov 27 00:30:55 2021
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> select local_tran_id,state from dba_2pc_pending;
LOCAL_TRAN_ID STATE
---------------------- ----------------
8.31.2898381 committed
40.17.120795 committed
41.5.136055 committed
SQL> alter session set container=ydhl;
Session altered.
SQL> select local_tran_id,state from dba_2pc_pending;
LOCAL_TRAN_ID STATE
---------------------- ----------------
265.23.1508662 collecting
18.13.7765760 collecting
SQL> execute DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('8.31.2898381');
PL/SQL procedure successfully completed.
SQL> execute DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('40.17.120795');
PL/SQL procedure successfully completed.
SQL> execute DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('41.5.136055');
PL/SQL procedure successfully completed.
SQL> execute DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('265.23.1508662');
PL/SQL procedure successfully completed.
SQL> execute DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('18.13.7765760');
PL/SQL procedure successfully completed.
SQL> select local_tran_id,state from dba_2pc_pending;
no rows selected
|