찾다
데이터 베이스MySQL 튜토리얼【bdump】bdump目录下产生大量cdmp_2014xxx和死锁信息

一、环境: AIX 6100-07+10.2.0.4.3 RAC 二、问题描述: bdump目录下产生大量cdmp_2014xxx目录,目录的数量到达上万个直至将bdump目录所在的根目录撑满,进而数据库异常。每个cdmp_2014xxx目录大概在4M左右。 alert.log日志记录如下: Fri Mar 21 17:38:25 2

一、环境: AIX 6100-07+10.2.0.4.3 RAC
二、问题描述: bdump目录下产生大量cdmp_2014xxx目录,目录的数量到达上万个直至将bdump目录所在的根目录撑满,进而数据库异常。每个cdmp_2014xxx目录大概在4M左右。
alert.log日志记录如下:
Fri Mar 21 17:38:25 2014
Thread 1 advanced to log sequence 17162 (LGWR switch)
  Current log# 2 seq# 17162 mem# 0: /dev/rredo1_2a_256m
  Current log# 2 seq# 17162 mem# 1: /dev/rredo1_2b_256m
Fri Mar 21 17:41:00 2014
Trace dumping is performing id=[cdmp_20140321173953]
Fri Mar 21 17:41:18 2014
Trace dumping is performing id=[cdmp_20140321174010]
Fri Mar 21 17:41:34 2014
Trace dumping is performing id=[cdmp_20140321174027]
Fri Mar 21 17:41:52 2014
Trace dumping is performing id=[cdmp_20140321174044]
Fri Mar 21 17:42:08 2014
Trace dumping is performing id=[cdmp_20140321174101]
Fri Mar 21 17:43:00 2014
Trace dumping is performing id=[cdmp_20140321174153]
Fri Mar 21 17:43:17 2014
Trace dumping is performing id=[cdmp_20140321174209]
Fri Mar 21 17:43:33 2014
Trace dumping is performing id=[cdmp_20140321174226]
Fri Mar 21 17:43:49 2014
Trace dumping is performing id=[cdmp_20140321174243]
Fri Mar 21 17:44:06 2014
Trace dumping is performing id=[cdmp_20140321174258]
Fri Mar 21 17:44:26 2014
Thread 1 advanced to log sequence 17163 (LGWR switch)
  Current log# 3 seq# 17163 mem# 0: /dev/rredo1_3a_256m
  Current log# 3 seq# 17163 mem# 1: /dev/rredo1_3b_256m
Fri Mar 21 17:45:00 2014
Trace dumping is performing id=[cdmp_20140321174353]
Fri Mar 21 17:45:17 2014
Trace dumping is performing id=[cdmp_20140321174410]
Fri Mar 21 17:45:35 2014
Trace dumping is performing id=[cdmp_20140321174427]
Fri Mar 21 17:45:52 2014
Trace dumping is performing id=[cdmp_20140321174444]
同时在alert.log中不定期的产生死锁的信息: Global Enqueue Service Deadlock detected. More info in file /oracle/admin/ballontt/udump/ballontt1_ora_6095180.trc

三、问题解决 1. 参数设置 1)在bdump目录下产生大量日志时,首先应考虑是否开启了event。可以查看参数event show parameter event 2)如果开启了event,可以利用如下脚本查询event level set serveroutput on
declare
event_level number;
begin
for i in 10000..10999 loop
dbms_system.read_ev(i,event_level);
if (event_level > 0) then
dbms_output.put_line('Event '||to_char(i)||' set at level '||
to_char(event_level));
end if;
end loop;
end;
/ 在我的环境中,并没有开启任何event。所以排除这个原因。
2. BUG造成 The issue matching to the following bug which is closed base bug 5470095. This is resolved in 10.2.0.4. Looks like your version is also 10.2.0.4.
++Bug 5388252 : TRACE DUMPING IS PERFORMING ID=[CDMP_ ... MESSAGES IN ALERT LOG 该BUG已经在10.2.0.4中被修复,我的数据库版本为10.2.0.4.3所以排除这个原因。
3. 外键上没有索引在二、中描述了alert.log中存在大量Global Enqueue Service Deadlock detected.,这也是可能产生cdmp的一个原因。而频繁的出现死锁,很可能的一个原因就是因为大量外键上没有创建索引,导致主表更新时外键更新的表需要被锁。可以通过如下脚本查询没有索引的外键信息。 外键上索引和锁的关系:http://blog.csdn.net/ballontt/article/details/22157759
1)创建存放相关信息的表 CREATE TABLE foreign_key_exceptions (owner VARCHAR2(30), constraint_name VARCHAR2(30), status VARCHAR2(8), table_name VARCHAR2(30), foreign_key VARCHAR2(2000));
2)执行如下脚本 set heading off select 'Write output to table FOREIGN_KEY_EXCEPTIONS created in this schema Y/N:' from dual; select upper(nvl('&&WRITE_TO_TABLE_Y_N','N')) from dual; select 'Schema Name:',upper('&&SCHEMA') from dual; set echo off SET SERVEROUTPUT ON FORMAT WRAPPED declare WRITE_TO_TABLE_Y_N VARCHAR2(100); from_schema VARCHAR2(30); to_schema VARCHAR2(30); pl_cons_column VARCHAR2(30); pl_foreign_key VARCHAR2(2000); pl_ind_column VARCHAR2(30); pl_ind_name VARCHAR2(30); pl_ind_owner VARCHAR2(30); pl_index VARCHAR2(2000); f_owner VARCHAR2(30); f_table_name VARCHAR2(30); /* Cursor c1 simply selects each Foreign Key constraint from the DBA View DBA_CONSTRAINTS. No need at this stage to limit the query to 'ENABLED' constraints, we'll simply report the status in the log file. For each constraint, we'll construct the column list, using cursor c2, which combine to form the foreign key constraint returned in cursor c1 */ CURSOR c1 IS SELECT constraint_name,owner,table_name,status,r_owner,r_constraint_name FROM dba_constraints WHERE constraint_type='R' AND owner between upper(from_schema) and upper(to_schema) ORDER BY owner; CURSOR c2(cons_name VARCHAR2,cons_owner VARCHAR2) IS SELECT column_name FROM dba_cons_columns WHERE constraint_name=cons_name AND owner=cons_owner ORDER BY dba_cons_columns.position; /* For each returned constraint, we need to fins a matching index, firstly we fetch each index name with c3, and then construct the index columns with cursor c4 in their correct order until we find a match with the foreign key constraint */ CURSOR c3(ind_table varchar2,tab_owner varchar2) IS SELECT index_name, owner FROM dba_indexes WHERE table_name=ind_table AND table_owner=tab_owner; CURSOR c4(ind_name varchar2,ind_owner varchar2) IS SELECT column_name FROM dba_ind_columns WHERE INDEX_NAME=ind_name AND INDEX_OWNER=ind_owner ORDER BY dba_ind_columns.column_position; CURSOR c5(for_owner varchar2,for_constraint varchar2) IS SELECT owner,table_name FROM dba_constraints WHERE OWNER=for_owner AND CONSTRAINT_NAME=for_constraint; BEGIN WRITE_TO_TABLE_Y_N:='&&WRITE_TO_TABLE_Y_N'; from_schema:= '&&SCHEMA'; IF from_schema = 'ALL' THEN begin from_schema := 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'; to_schema := 'ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ'; end; ELSE to_schema := from_schema; END IF; DBMS_OUTPUT.PUT_LINE(' Missing Indexes for Foreign Keys'); DBMS_OUTPUT.PUT_LINE(' --------------------------------'); FOR c1_rec in c1 LOOP /* looping for each foreign key constraint */ pl_cons_column := NULL; pl_foreign_key := NULL; pl_ind_column := NULL; pl_ind_name := NULL; pl_ind_owner := NULL; pl_index := NULL; f_owner:=NULL; F_table_name:=NULL; OPEN c5(c1_rec.r_owner,c1_rec.r_constraint_name); FETCH c5 INTO f_owner,f_table_name; CLOSE c5; OPEN c2(c1_rec.constraint_name,c1_rec.owner); FETCH c2 INTO pl_cons_column; pl_foreign_key := pl_cons_column; -- the first col in the foreign key > LOOP /* constructing the foreign key columns, delimiting each column with a ',' */ FETCH c2 into pl_cons_column; EXIT WHEN c2%NOTFOUND; pl_foreign_key := pl_foreign_key||','||pl_cons_column; END LOOP constraint_names; /* we now have a table and foreign key definition for which we need an index */ CLOSE c2; OPEN c3(c1_rec.table_name,c1_rec.owner); > LOOP /* for each index found for this table */ FETCH c3 INTO pl_ind_name,pl_ind_owner; EXIT WHEN c3%NOTFOUND; OPEN c4(pl_ind_name,pl_ind_owner); FETCH c4 INTO pl_ind_column; pl_index := pl_ind_column; -- the first column in the index IF pl_index=pl_foreign_key THEN -- check this doesn't already match CLOSE c4; -- the foreign key EXIT index_name; END IF; IF pl_index = SUBSTR(pl_foreign_key,1,LENGTH(pl_index)) THEN /* we only need construct the whole index while it's leading edge still matches the constrained foreign key columns */ > LOOP /* construct the whole index in the same way as the foreign key */ FETCH c4 INTO pl_ind_column; EXIT WHEN c4%NOTFOUND; pl_index:= pl_index||','||pl_ind_column; /* we do not need to continue with the index name loop if we already have a match on the foreign key */ IF pl_index=pl_foreign_key THEN CLOSE c4; EXIT index_name; END IF; /* if the leading edge differs - go back around the loop to see if there is a subsequent index that matches */ IF pl_index != SUBSTR(pl_foreign_key,1,LENGTH(pl_index)) THEN EXIT index_columns; END IF; END LOOP index_columns; END IF; CLOSE c4; END LOOP index_name; CLOSE c3; IF pl_index != pl_foreign_key OR pl_index IS NULL THEN /* Alternative means of output having first set serveroutput using: SET SERVEROUTPUT ON SIZE n where n is between 2000 and 1000000 to set the output limit. DBMS_OUTPUT.PUT_LINE(c1_rec.owner||'.'||c1_rec.constraint_name); */ IF WRITE_TO_TABLE_Y_N ='Y' or WRITE_TO_TABLE_Y_N ='y' THEN EXECUTE IMMEDIATE 'INSERT INTO foreign_key_exceptions VALUES (c1_rec.owner,c1_rec.constraint_name,c1_rec.status, c1_rec.table_name,pl_foreign_key)'; END IF; dbms_output.put_line('Constraint '||c1_rec.constraint_name||'('||c1_rec.status||') : Changing data in table '||f_owner||'.'||f_table_name||' will lock table '||c1_rec.owner||'.'||c1_rec.table_name); dbms_output.put_line('Create index for table '||c1_rec.owner||'.'||c1_rec.table_name||' on columns '||pl_foreign_key); dbms_output.put_line('************************'); COMMIT; END IF; END LOOP; END; / undefine WRITE_TO_TABLE_Y_N undefine SCHEMA 在执行脚本时,需要交互地输入1)中新建的表名,以及你想查看哪个schema下的信息如果输入ALL表示查看所有用户信息。根据得到的信息,在相应的外键上创建索引,只需要在application's schema下的对象上创建索引,系统默认用户(sys,syste,sysman)下的对象不需要创建索引。
성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
如何处理C++开发中的死锁问题如何处理C++开发中的死锁问题Aug 22, 2023 pm 02:24 PM

如何处理C++开发中的死锁问题死锁是多线程编程中常见的问题之一,尤其是在使用C++进行开发时更容易遇到。当多个线程互相等待对方持有的资源时,就可能发生死锁问题。如果不及时处理,死锁不仅会导致程序卡死,还会影响系统的性能和稳定性。因此,学习如何处理C++开发中的死锁问题是非常重要的。一、理解死锁的原因要解决死锁问题,首先需要了解死锁产生的原因。死锁通常发生在以

golang函数并发控制中死锁与饥饿的预防与解决golang函数并发控制中死锁与饥饿的预防与解决Apr 24, 2024 pm 01:42 PM

Go中死锁和饥饿:预防与解决死锁:协程相互等待而无法进行的操作,使用runtime.SetBlockProfileRate函数检测。预防死锁:使用细粒度加锁、超时、无锁数据结构,防止死锁。饥饿:协程持续无法获得资源,使用公平锁防止饥饿。公平锁实践:创建公平锁并等待协程尝试获取锁的时间最长的优先获取锁。

C++ 多线程编程中死锁预防和检测机制C++ 多线程编程中死锁预防和检测机制Jun 01, 2024 pm 08:32 PM

多线程死锁预防机制包括:1.锁顺序;2.测试并设置。检测机制包括:1.超时;2.死锁检测器。文章举例共享银行账户,通过锁顺序避免死锁,为转账函数先请求转出账户再请求转入账户的锁。

Go开发中解决死锁的方法Go开发中解决死锁的方法Jun 30, 2023 pm 04:58 PM

解决Go语言开发中的死锁问题的方法Go语言是一种开源的静态类型编译型语言,被广泛应用于并发编程。然而,由于Go语言的并发模型的特性,开发者在编写并发程序时常常会遇到死锁问题。本文将介绍一些解决Go语言开发中死锁问题的方法。首先,我们需要了解何为死锁。死锁是指多个并发任务因互相等待对方释放资源而无法继续执行的情况。在Go语言中,死锁问题通常由于对资源的竞争或者

如何调试 C++ 程序中的死锁?如何调试 C++ 程序中的死锁?Jun 03, 2024 pm 05:24 PM

死锁是一种并发编程中的常见错误,发生在多个线程等待彼此持有的锁时。可以通过使用调试器检测死锁,分析线程活动并识别涉及的线程和锁,从而解决死锁。解决死锁的方法包括避免循环依赖、使用死锁检测器和使用超时。在实践中,通过确保线程按相同的顺序获取锁或使用递归锁或条件变量可以避免死锁。

如何解决Go语言中的死锁问题?如何解决Go语言中的死锁问题?Oct 08, 2023 pm 05:07 PM

如何解决Go语言中的死锁问题?Go语言具有并发编程的特性,可以通过使用goroutine和channel来实现并发操作。然而,在并发编程中,死锁是一个常见的问题。当goroutine之间相互依赖于彼此的资源,并且在访问这些资源时产生了循环依赖关系,就可能导致死锁的发生。本文将介绍如何解决Go语言中的死锁问题,并提供具体的代码示例。首先,让我们来了解一下什么是

C++ 函数如何解决并发编程中的死锁问题?C++ 函数如何解决并发编程中的死锁问题?Apr 26, 2024 pm 01:18 PM

在C++中,使用互斥量函数可以解决多线程并发编程中的死锁问题。具体步骤如下:创建一个互斥量;当线程需要访问共享变量时,获得互斥量;修改共享变量;释放互斥量。这样可以确保任何时刻只有一个线程访问共享变量,有效防止死锁。

系统出现死锁有哪些原因系统出现死锁有哪些原因Sep 04, 2023 pm 02:44 PM

系统出现死锁的原因有互斥条件、请求与保持条件、不可剥夺条件和循环等待条件。详细介绍:1、互斥条件,多个线程需要同时访问某些共享资源,而这些资源一次只能被一个线程占用,如果一个线程占用了某个资源,其他线程就必须等待该资源释放;2、请求与保持条件,一个线程在持有某个资源的同时,又请求获取其他线程持有的资源,如果这些资源被其他线程占用,就会导致线程等待;3、不可剥夺条件等等。

See all articles

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

AI Hentai Generator

AI Hentai Generator

AI Hentai를 무료로 생성하십시오.

뜨거운 도구

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

ZendStudio 13.5.1 맥

ZendStudio 13.5.1 맥

강력한 PHP 통합 개발 환경

Eclipse용 SAP NetWeaver 서버 어댑터

Eclipse용 SAP NetWeaver 서버 어댑터

Eclipse를 SAP NetWeaver 애플리케이션 서버와 통합합니다.

mPDF

mPDF

mPDF는 UTF-8로 인코딩된 HTML에서 PDF 파일을 생성할 수 있는 PHP 라이브러리입니다. 원저자인 Ian Back은 자신의 웹 사이트에서 "즉시" PDF 파일을 출력하고 다양한 언어를 처리하기 위해 mPDF를 작성했습니다. HTML2FPDF와 같은 원본 스크립트보다 유니코드 글꼴을 사용할 때 속도가 느리고 더 큰 파일을 생성하지만 CSS 스타일 등을 지원하고 많은 개선 사항이 있습니다. RTL(아랍어, 히브리어), CJK(중국어, 일본어, 한국어)를 포함한 거의 모든 언어를 지원합니다. 중첩된 블록 수준 요소(예: P, DIV)를 지원합니다.

SecList

SecList

SecLists는 최고의 보안 테스터의 동반자입니다. 보안 평가 시 자주 사용되는 다양한 유형의 목록을 한 곳에 모아 놓은 것입니다. SecLists는 보안 테스터에게 필요할 수 있는 모든 목록을 편리하게 제공하여 보안 테스트를 더욱 효율적이고 생산적으로 만드는 데 도움이 됩니다. 목록 유형에는 사용자 이름, 비밀번호, URL, 퍼징 페이로드, 민감한 데이터 패턴, 웹 셸 등이 포함됩니다. 테스터는 이 저장소를 새로운 테스트 시스템으로 간단히 가져올 수 있으며 필요한 모든 유형의 목록에 액세스할 수 있습니다.