您的位置:首页 > 其它

awr 无法生成处理

2015-10-26 07:59 183 查看
客户数据库遇到AWR快照无法生成的问题,下面记录了下处理的过程。

OS:Linux

DB:Oracle 10.2.0.5 RAC

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758CURTIME Inst:Sid ID1 ID2 LMODE TYPE CTIME-------------------------- --------------------- ---------- ---------- ---------- ---- ----------20130927 16:45:19 Holder: 2:811 0 0 4 WF 243628820130927 16:45:19 Holder: 1:945 0 0 4 WF 243628720130927 16:45:19 Waiter: 2:709 0 0 0 WF 120130927 16:45:19 Holder: 1:945 9155 0 6 TM 243628720130927 16:45:19 Waiter: 2:811 9155 0 0 TM 2436287 /*WF AWR Flush MMON (Manageability Monitor) is attempting the autoflush function which means that we are trying to flush the ASH (Active Session History) data into the AWR (Active Workload Repository) for the historical repository.We take out the WF enqueue for doing this and hence in your wait sessions you may see WF enqueue contention.*/ SQL> select * from v$locked_object 2 XIDUSN XIDSLOT XIDSQN OBJECT_ID SESSION_ID ORACLE_USERNAME OS_USER_NAME PROCESS LOCKED_MODE---------- ---------- ---------- ---------- ---------- ------------------------------ ------------------------------ ------------ ----------- 10 11 5977841 9155 945 oracle 10185 6 10 11 5977841 9228 945 oracle 10185 3 SQL> SQL> select owner,object_name,object_type from dba_objects where object_id in ('9155','9228'); OWNER OBJECT_NAME OBJECT_TYPE------------------------------ -------------------------------------------------------------------------------- -------------------SYS WRH$_ACTIVE_SESSION_HISTORY TABLESYS WRM$_DATABASE_INSTANCE TABLE SQL> SQL> SQL> SELECT s.event event, 2 SUBSTR(s.program, 1, 39) program, 3 s.sid || ':' || s.SERIAL# || ':' || 4 DECODE(sql_hash_value, 0, prev_hash_value, sql_hash_value) || ':' || 5 decode(sql_id, null, prev_sql_id, sql_id) "SESS:SERIAL#:SQL_HASH:SQL_ID", 6 s.username, 7 SUBSTR(s.osuser || '@' || s.machine || '@' || s.process || '@' || 8 p.spid, 9 1, 10 60) "OSUSER@MACHINE@PROCEE@SPID", 11 BLOCKING_SESSION_STATUS, 12 blocking_session, 13 TO_CHAR(s.logon_time, 'mm-dd hh24:mi') logon_time 14 FROM v$session s, v$process p 15 where S.PADDR = P.ADDR 16 and s.wait_class <> 'Idle' 17 order by logon_time; EVENT PROGRAM SESS:SERIAL#:SQL_HASH:SQL_ID USERNAME OSUSER@MACHINE@PROCEE@SPID BLOCKING_SESSION_STATUS BLOCKING_SESSION LOGON_TIME-------------------------- ----------------------------------- -------------------------------------------------- ------------------------------ --------------------------------- ----------------------- ---------------- ---------------------------------------------------------------------------gc current request oracle@dbserver1 (m000) 945:12572:0: oracle@dbserver1@10185@10185 UNKNOWN 08-30 12:00
查看mmon文件,发现以下内容:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

***
2013-09-27
16:37:39.385

***
KEWRAFC:
Flush
slave
failed,
AWR
Enqueue
Timeout

***
2013-09-27
16:38:39.431

***
KEWRAFC:
Flush
slave
failed,
AWR
Enqueue
Timeout

***
2013-09-27
16:39:39.471

***
KEWRAFC:
Flush
slave
failed,
AWR
Enqueue
Timeout

***
2013-09-27
16:40:41.216

***
KEWRAFC:
Flush
slave
failed,
AWR
Enqueue
Timeout

-----kill
掉m000进程

[oracle@dbserver1
osw]$

[oracle@dbserver1
osw]$
ps
-ef|grep
m0

oracle
10185
1
99
Aug30
? 28-05:04:19
ora_m000_orcl1

oracle
21027
30461 0
17:10
pts/2 00:00:00
grep
m0

[oracle@dbserver1
osw]$

[oracle@dbserver1
osw]$

[oracle@dbserver1
osw]$
kill
-9
10185

[oracle@dbserver1
osw]$
ps
-ef|grep
m0

oracle
21118
30461 0
17:10
pts/2 00:00:00
grep
m0

[oracle@dbserver1
osw]$

[oracle@dbserver1
osw]$

[oracle@dbserver1
osw]$
ps-
ef|grep
pmon

-bash:
ps-:
command
not
found

[oracle@dbserver1
osw]$

[oracle@dbserver1
osw]$

[oracle@dbserver1
osw]$
ps
-ef|grep
pmon

oracle
15120
1 0
Aug25
? 00:16:00
ora_pmon_orcl1

oracle
21221
30461 0
17:10
pts/2 00:00:00
grep
pmon

[oracle@dbserver1
osw]$

[oracle@dbserver1
osw]$

[oracle@dbserver1
osw]$

---awr生成快照正常

SQL>

SQL>
select
snap_id,instance_number,

2
to_char(begin_interval_time,
'yyyy-mm-dd hh24:mi:ss')
begin_interval_time,

3
to_char(end_interval_time,
'yyyy-mm-dd hh24:mi:ss')
end_interval_time

4 from
dba_hist_snapshot

5 order
by
snap_id,instance_number;

SNAP_ID
INSTANCE_NUMBER
BEGIN_INTERVAL_TIME
END_INTERVAL_TIME

----------
---------------
---------------------------------------------------------------------------
---------------------------------------------------------------------------

6519
2
2013-08-30
11:00:28
2013-08-30
12:00:31

6520
1
2013-08-30
12:00:31
2013-09-27
17:10:41

6520
2
2013-08-30
12:00:31
2013-09-27
17:10:41

6521
1
2013-09-27
17:10:41
2013-09-27
17:13:47

6521
2
2013-09-27
17:10:41
2013-09-27
17:13:47

SQL>

SQL>

在之前尝试了MOS文档中的处理办法:

1

2

3

4

5

MOS:
WHEN
AWR
SNAPSHOTS
ARE
NOT
GENERATED
AUTOMATICALLY,
HOW
To
DIAGNOSE.
(文档
ID
787409.1)中的方法

1.
Take
backup
of
table
SYS.WRI$_OPTSTAT_HISTHEAD_HISTORY
,
Do
create
table
as
select
of
the
table.

2.
Start
the
database
in
restricted
mode

alter
table
sys.WRI$_OPTSTAT_HISTHEAD_HISTORY
move;

3.
Monitor
the
trace
files

尝试了truncate wri$_optstat_histhread_history问题依旧,不知道是不是没有把数据库启动到restricted模式下进行操作的原因

文章转载于http://www.cddba.com/2013/09/27/awr%e6%97%a0%e6%b3%95%e7%94%9f%e6%88%90%e5%bf%ab%e7%85%a7%e5%a4%84%e7%90%86/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: