配置logminer,对Oracle配置追加日志的时候,命令长时间挂起:
SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;
复制
alert日志:
SUPLOG: Previous supplemental logging attributes at scn = 3678763842390
SUPLOG: minimal = ON, primary key = ON
SUPLOG: unique = ON, foreign key = OFF, all column = OFF
SUPLOG: procedural replication = OFF
SUPLOG: New supplemental logging attributes at scn = 3678763842487
SUPLOG: minimal = ON, primary key = ON
SUPLOG: unique = ON, foreign key = OFF, all column = ON
SUPLOG: procedural replication = OFF
复制
MOS上说明:
当有任何未提交的事务时,ALTER DATABASE ADD追加日志数据正在共享模式中等待TM锁。
建议是:
STARTUP MOUNT
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
ALTER DATABASE OPEN;
等待所有未决事务的完成吗,还可以找到阻塞者和等待者来kill session。
查询阻塞会话是tomcat应用shutdown后未关闭连接,已无事务,但还存在锁。
检查阻塞会话SQL:
select INST_ID,
SID,
TYPE,
ID1,
ID2,
LMODE,
REQUEST,
CTIME,
BLOCK,
DECODE(BLOCK, 0, '', 'blocker') blocker,
DECODE(request, 0, '', 'waiter') waiter
from gv$lock
where (ID1, ID2, TYPE) in
(select ID1, ID2, TYPE from gv$lock where request > 0)
order by blocker;
复制
关闭错误应用程序后恢复。
--如需kill session:
alter system kill session 'sid,serial#';
复制
MOS文档:
Alter Database Add Supplemental Log Data Hangs [ID 406498.1]
--------------------------------------------------------------------------------
修改时间 19-JUL-2011 类型 PROBLEM 状态 PUBLISHED
In this Document
Symptoms
Changes
Cause
Solution
References
--------------------------------------------------------------------------------
Applies to:
Oracle Server - Enterprise Edition - Version: 10.2.0.1 and later [Release: 10.2 and later ]
Information in this document applies to any platform.
Symptoms
As part of the Streams setup you can specify supplemental logging at the database level.
It can be done manually:
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY, UNIQUE INDEX) COLUMNS;
or implicitly running procedures like DBMS_STREAMS_ADM.ADD_SCHEMA_RULES
or if you setup Streams using Grid Control it is automatically executed by SrcSchemaRule1 Stage Step 12.
In some cases, this step hangs and the statement ALTER DATABASE ADD SUPPLEMENTAL LOG DATA remains waiting for TX lock in shared mode.
Changes
Cause
The statement ALTER DATABASE ADD SUPPLEMENTAL LOG DATA is waiting for TX lock in shared mode when there is any uncommitted transaction. This is the expected behavior.
You can issue ALTER DATABASE ADD SUPPLEMENTAL LOG DATA when the database is open. However, Oracle Database will invalidate all DML cursors in the cursor cache, which will have an effect on performance until the cache is repopulated. Besides,we also need to wait for the completion of all the in-flight transaction so that any redo generated after this DDL would have the right supplemental logging attributes.
Solution
You need to wait for the completion of all the in-flight transaction.
In those databases with high activity where there are always active transactions the supplemental logging can be enabled by bouncing the database and running the statement manually:
STARTUP MOUNT
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
ALTER DATABASE OPEN;
References
ORA-32593 database supplemental logging attributes in flux
相关内容
--------------------------------------------------------------------------------
产品
--------------------------------------------------------------------------------
Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition
关键字
--------------------------------------------------------------------------------
HANGING; LOCK; STREAMS; TX LOCK
复制
文章转载自DBA小记,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
2025年4月中国数据库流行度排行榜:OB高分复登顶,崖山稳驭撼十强
墨天轮编辑部
1382次阅读
2025-04-09 15:33:27
2025年3月国产数据库大事记
墨天轮编辑部
748次阅读
2025-04-03 15:21:16
2025年3月国产数据库中标情况一览:TDSQL大单622万、GaussDB大单581万……
通讯员
545次阅读
2025-04-10 15:35:48
征文大赛 |「码」上数据库—— KWDB 2025 创作者计划启动
KaiwuDB
460次阅读
2025-04-01 20:42:12
数据库,没有关税却有壁垒
多明戈教你玩狼人杀
414次阅读
2025-04-11 09:38:42
优炫数据库成功应用于国家电投集团青海海南州新能源电厂!
优炫软件
388次阅读
2025-03-21 10:34:08
天津市政府数据库框采结果公布!
通讯员
320次阅读
2025-04-10 12:32:35
最近我为什么不写评论国产数据库的文章了
白鳝的洞穴
317次阅读
2025-04-07 09:44:54
国产数据库需要扩大场景覆盖面才能在竞争中更有优势
白鳝的洞穴
291次阅读
2025-04-14 09:40:20
从HaloDB体验到国产数据库兼容性
多明戈教你玩狼人杀
269次阅读
2025-04-07 09:36:17
热门文章
Oracle RAC中的VIP和SCAN IP
2020-10-27 11096浏览
ORA-28040: No matching authentication protocol
2021-08-07 10884浏览
Oracle表空间碎片整理
2020-10-27 9587浏览
深入解读AWR报告
2020-10-27 7035浏览
oracle表碎片的整理
2020-10-27 6450浏览
最新文章
ORA-28040: No matching authentication protocol
2021-08-09 1357浏览
WRI$_ADV_OBJECTS表过大,导致PDB的SYSAUX表空间不足
2021-08-07 1986浏览
ORA-28040: No matching authentication protocol
2021-08-07 10884浏览
WRI$_ADV_OBJECTS表过大,导致PDB的SYSAUX表空间不足
2021-08-06 1776浏览
ORA-13639: The C operation was interrupted because it timed OUT
2021-08-06 2626浏览