oracle 快照不自动创建,无法收集awr报告(mmon,mmnl进程)
解决办法:
1、重启实例
2、不需要重启实例,将数据库设置成restricted session模式
alter system enable restricted session;
alter system disable restricted session;
设置restricted session模式,对dba权限没有影响,普通用户是无法连接数据库,需要授予restricted session权限才能连接数据库,普通用户现有的链接不会有影响。
节点一:
[oracle@pdb1 ~]$ ps -ef |grep mm
grid 6634 1 0 2017 ? 00:33:47 asm_mman_+ASM1
grid 6648 1 0 2017 ? 01:52:06 asm_mmon_+ASM1
grid 6650 1 0 2017 ? 2-00:53:46 asm_mmnl_+ASM1
oracle 8610 1 0 2017 ? 00:33:56 ora_mman_pdb1
oracle 8650 1 0 2017 ? 3-11:28:35 ora_mmon_pdb1
oracle 8655 1 1 2017 ? 4-07:20:56 ora_mmnl_pdb1
节点二:
[oracle@pdb1 ~]$ ssh pdb2
Last login: Thu Sep 20 10:41:22 2018 from pdb1
[oracle@pdb2 ~]$ ps -ef |grep mm
oracle 54354 53982 0 11:09 pts/1 00:00:00 grep mm
grid 105256 1 0 2017 ? 00:23:52 asm_mman_+ASM2
grid 105295 1 0 2017 ? 01:15:06 asm_mmon_+ASM2
grid 105312 1 0 2017 ? 1-03:49:26 asm_mmnl_+ASM2
oracle 106889 1 0 2017 ? 00:28:00 ora_mman_pdb2
oracle 106927 1 0 2017 ? 3-04:47:42 ora_mmnl_pdb2 --发现缺失了mmon的db进程
启动这个进程:
11:10:27 SYS@pdb2(pdb2)>
11:10:27 SYS@pdb2(pdb2)> alter system enable restricted session;
System altered.
11:10:29 SYS@pdb2(pdb2)> !ps -ef |grep mm
oracle 55936 1 0 11:10 ? 00:00:00 ora_mmon_pdb2
oracle 55938 1 0 11:10 ? 00:00:00 ora_mmnl_pdb2
oracle 56456 54350 0 11:10 pts/4 00:00:00 /bin/bash -c ps -ef |grep mm
oracle 56458 56456 0 11:10 pts/4 00:00:00 grep mm
grid 105256 1 0 2017 ? 00:23:52 asm_mman_+ASM2
grid 105295 1 0 2017 ? 01:15:06 asm_mmon_+ASM2
grid 105312 1 0 2017 ? 1-03:49:26 asm_mmnl_+ASM2
oracle 106889 1 0 2017 ? 00:28:00 ora_mman_pdb2
root 120638 1 0 2016 ? 18:48:43 /root/jdk1.8.0_101/bin/java -Duser.language=en -Duser.country=US -Dlog4j.configuration=./conf/log4j.properties -cp lib/commons-codec-1.4.jar:lib/commons-dbcp-1.4.jar:lib/commons-lang-2.5.jar:lib/commons-logging-1.1.1.jar:lib/commons-pool-1.5.4.jar:lib/hsqldb.jar:lib/log4j-1.2.15.jar:lib/ojdbc6.jar:.:./orabbix-1.2.3.jar com.smartmarmot.orabbix.bootstrap start ./conf/config.props
11:10:47 SYS@pdb2(pdb2)> alter system disable restricted session;
System altered.
***2个命令必须同时操作****
alter system enable restricted session;
alter system disable restricted session;
正确重新启动mmon的方法是在业务闲时启用restricted模式,再立马禁用:
为了尽可能的减少设置restricted模式带来的影响,所以建议最好两个语句一起复制执行。
Tips:启用restricted模式后,应用新连接数据库的会话将直接报错ORA-12526无法连接,直到禁用restricted模式后才可以恢复
alert的相关日志:
Thu Sep 20 11:10:28 2018
Stopping background process MMNL
Starting background process MMON
Starting background process MMNL
Thu Sep 20 11:10:29 2018
MMON started with pid=37, OS id=55936
Thu Sep 20 11:10:29 2018
MMNL started with pid=236, OS id=55938
ALTER SYSTEM enable restricted session;
minact-scn: Inst 2 is a slave inc#:16 mmon proc-id:55936 status:0x2
minact-scn status: grec-scn:0x0026.4dcf0d36 gmin-scn:0x0026.4dcf0d36 gcalc-scn:0x0026.4dcf1208
Thu Sep 20 11:11:05 2018
ALTER SYSTEM disable restricted session;
Thu Sep 20 11:13:25 2018
LGWR: Standby redo logfile selected for thread 2 sequence 154126 for destination LOG_ARCHIVE_DEST_3
Thread 2 advanced to log sequence 154126 (LGWR switch)
Current log# 8 seq# 154126 mem# 0: +SS_DT/pdb/redo08a.log
Current log# 8 seq# 154126 mem# 1: +SS_DT/pdb/redo08b.log