1、说明 在日常rac搭建dg或者rac修改转换路径,有时候可能会对参数进行修改,修改之后又没有同时停止和启动两个节点实例,造成后续维护人员在关闭重启某个节点时遇到ORA-01105、ORA-01677错误; 2、分析错误 1)scope=spfile;为静态参数,执行后两台rac的环境均未生效 2)假设重启了节点2,先srvctl stop instance -d xx -n xx,然后再srvctl start instance -d xx -n xx错误就出现了; 3)通过现象可用知道,节点1还没有重启过,也就是说该参数还是没生效的,现在节点2重新启动读取spfile就会使该参数生效,此时两边参数不一致oracle就会抛出ORA-01105、ORA-01677错误; 3、模拟错误 节点1 oracle rdbms下修改 sqlplus / as sysdba alter system set db_file_name_convert='+data/healdg/datafile/','+data/heal/datafile/' scope=spfile; alter system set log_file_name_convert='+data/healdg/tempfile/','+data/heal/tempfile/' scope=spfile; 节点1 模拟关闭和启动 startup force -- ORA-01105: mount is incompatible with mounts by other instances ORA-01677: standby file name conversion parameters differ from other instance 节点1创建pfile SQL> create pfile='/tmp/1.txt' from spfile; 节点1删除该参数,重新拉起数据库 vi /tmp/1.txt 删除*.db_file_name_convert='+data/healdg/datafile/','+data/heal/datafile/' SQL> shutdown abort ORACLE instance shut down. SQL> startup mount pfile='/tmp/1.txt'; 《《两个节点参数一致 SQL> show parameter spfile; --没有使用spfile 节点1查看spfile位置 [oracle@rac1 ~]$ srvctl config database -d orcl Spfile: +DATA/orcl/spfileorcl.ora --节点1备份现有spfile ASMCMD [+DATA/ORCL] > cp spfileorcl.ora /tmp/spfileorcl.ora copying +DATA/ORCL/spfileorcl.ora -> /tmp/spfileorcl.ora --节点1创建新spfile(没有修改的db_file_name_convert) SQL> create spfile='+DATA/orcl/spfileorcl.ora' from pfile='/tmp/1.txt'; File created. --备份修改后的spfile ASMCMD [+DATA/ORCL] > cp spfileorcl.ora /tmp/spfileorcl_new.ora --对比 [root@rac1 tmp]# strings spfileorcl.ora |grep db_file_name *.db_file_name_convert='+data/healdg/datafile/','+data/heal/datafile/' [root@rac1 tmp]# strings spfileorcl_new.ora |grep db_file_name --还原之前的修改,最后可以找停机时间,同时重启两节点 alter system set db_file_name_convert='+data/healdg/datafile/','+data/heal/datafile/' scope=spfile; --经过测试,发现按照节点的方式修改参数,也会报这个问题; alter system set db_file_name_convert='+data/healdg/datafile/','+data/heal/datafile/' scope=spfile sid='orcl1'; alter system set db_file_name_convert='+data/healdg/datafile/','+data/heal/datafile/' scope=spfile sid='orcl2'; SQL> startup force ORACLE instance started. Total System Global Area 2415918568 bytes Fixed Size 9137640 bytes Variable Size 1426063360 bytes Database Buffers 973078528 bytes Redo Buffers 7639040 bytes ORA-01105: mount is incompatible with mounts by other instances ORA-01677: standby file name conversion parameters differ from other instance 总结:1)在不能启动的节点创建pfile,然后删除节点2未生效的参数,nomount读取pfile启动测试; 2)查看现有spfile位置,然后备份到文件系统 3)不能启动的节点创建spfile从pfile 4)关闭不能启动的节点,然后通过spfile启动即可; 总体思路:想办法把spfile中的参数删除了,然后用相同的spfile启动就行了;因为spfile只是nomount时候使用,其它时候都是空闲的; |