修改ASM实例参数,导致GI集群无法启动

发布时间 2023-06-16 15:06:30作者: 石云华

0、有一套预生产环境,准备在上线之前先进行数据库参数修改。结果在修改ASM内存参数时,忘记reset memory_max_target参数,导致GI集群无法启动。将整个故障记录下来。

 

1、修改ASM实例参数

alter system set processes=1000 scope=spfile sid='*';

alter system set sga_max_size=2G scope=spfile sid='*';

alter system set sga_target=2G scope=spfile sid='*';

alter system set pga_aggregate_target=100M scope=spfile sid='*';

alter system set memory_max_target=0 scope=spfile sid='*';

alter system set memory_target=0 scope=spfile sid='*';

注意:

上述命令会导致故障产生,除了上述参数,还需要执行alter system reset memory_max_target scope=spfile sid='*';

 

 

2、重启GI集群。

[root@11grac1 ~]# crsctl start crs

CRS-4123: Oracle High Availability Services has been started.

[root@11grac1 ~]#

[root@11grac1 ~]# crsctl check crs

CRS-4638: Oracle High Availability Services is online

CRS-4535: Cannot communicate with Cluster Ready Services

CRS-4529: Cluster Synchronization Services is online

CRS-4534: Cannot communicate with Event Manager

可以看出,CRSD服务无法启动。

 

3、查看GI集群日志

2023-06-16 14:26:32.352:

[ohasd(8687)]CRS-2807:Resource 'ora.asm' failed to start automatically.

2023-06-16 14:26:32.352:

[ohasd(8687)]CRS-2807:Resource 'ora.crsd' failed to start automatically.

从集群日志可以看出,ora.asm服务无法启动。

 

4、手动启动ASM实例。

SQL> startup

ORA-00843: Parameter not taking MEMORY_MAX_TARGET into account

ORA-00849: SGA_TARGET 2147483648 cannot be set to more than MEMORY_MAX_TARGET 0.

SQL>

手动启动ASM实例时报错,提示MEMORY_MAX_TARGET为0,而SGA_TARGET参数值大于0,实例无法启动。

 

5、手动编辑ASM的pfile文件

*.processes = 1000

*.large_pool_size = 256M

*.instance_type = "asm"

*.sga_target = 1G

*.pga_aggregate_target=100M

*.remote_login_passwordfile = "EXCLUSIVE"

*.asm_diskstring = "/dev/oracleasm/disks/*"

*.asm_power_limit = 4

*.diagnostic_dest = "/u01/app/oracle"

+ASM2.instance_number=2

+ASM1.instance_number=1

 

6、在任意一个节点,使用pfile启动ASM实例,然后创建spfile,将spfile的位置指定到ASM磁盘组中。

SQL> startup pfile='/tmp/asm.ora';

ASM instance started

 

Total System Global Area 1068937216 bytes

Fixed Size                  2260088 bytes

Variable Size            1041511304 bytes

ASM Cache                  25165824 bytes

ASM diskgroups mounted

SQL> create spfile='+DG_GRID/spfileasm.ora'  from pfile='/tmp/asm.ora';

 

File created.

 

SQL>

 

 

7、重启GI集群。

# crsctl stop crs -f

 

[root@11grac2 ~]# crsctl start crs 

CRS-4123: Oracle High Availability Services has been started.

[root@11grac2 ~]# crsctl check crs

CRS-4638: Oracle High Availability Services is online

CRS-4537: Cluster Ready Services is online

CRS-4529: Cluster Synchronization Services is online

CRS-4533: Event Manager is online

[root@11grac2 ~]#

可以看到,GI集群已经正常启动。

 

8、检验ASM参数是否已经修改。

SQL> set linesize 200

SQL> show parameter spfile

 

NAME                                 TYPE                              VALUE

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

spfile                               string                            +DG_GRID/spfileasm.ora

SQL> show parameter sga

 

NAME                                 TYPE                              VALUE

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

lock_sga                             boolean                           FALSE

sga_max_size                         big integer                       1G

sga_target                           big integer                       1G

SQL> show parameter pga   

 

NAME                                 TYPE                              VALUE

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

pga_aggregate_target                 big integer                       100M

SQL> show parameter mem

 

NAME                                 TYPE                              VALUE

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

memory_max_target                    big integer                       1184M

memory_target                        big integer                       1184M

SQL>

 

可见,ASM实例的参数已经修改,也使用了最新的spfile文件。