更改db_unique_name后,修复磁盘组依赖关系和其他crs中的相关配置

联系:QQ(5163721)

标题:更改db_unique_name后,修复磁盘组依赖关系和其他crs中的相关配置

作者:Lunar©版权所有[文章允许转载,但必须以链接方式注明源地址,否则追究法律责任.]

做ADG时,修改了数据库的db_unique_name后,alert中报错如下:

ERROR: failed to establish dependency between database mynewdb and diskgroup resource ora.DATA.dg
ERROR: failed to establish dependency between database mynewdb and diskgroup resource ora.REDODG.dg

这个错误不影响使用,但是终归是别扭的……

检查crs中数据库的配置:

[oracle@lunardb2 ~]$ srvctl config database -d lunardb
Database unique name: lunardb
Database name: lunardb
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/lunardb/spfilelunardb.ora
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: lunardb
Database instances: lunardb1,lunardb2
Disk Groups: DATA
Mount point paths: 
Services: 
Type: RAC
Database is administrator managed
[oracle@lunardb2 ~]$ 

这里可以看到,以前的spfile(主库的)位置是:+DATA/lunardb/spfilelunardb.ora

此时,即便是手动修改了参数文件位置为 SPFILE=’+DATA/mynewdb/spfilemynewdb.ora’,重启crs后,启动数据库也会有报错信息:

[oracle@lunardb1 ~]$ ss

SQL*Plus: Release 11.2.0.3.0 Production on Wed Sep 24 23:51:54 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to an idle instance.

23:51:54 SYS@ lunardb1> startup
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DATA/lunardb/spfilelunardb.ora'
ORA-17503: ksfdopn:2 Failed to open file +DATA/lunardb/spfilelunardb.ora
ORA-15056: additional error message
ORA-17503: ksfdopn:2 Failed to open file +DATA/lunardb/spfilelunardb.ora
ORA-15173: entry 'lunardb' does not exist in directory '/'
ORA-06512: at line 4
23:51:57 SYS@ lunardb1> 

因为它还是自动修改为crs的db资源中的信息,并把以前我手工修改的信息做了备份:

[oracle@lunardb1 dbs]$ cat initlunardb1.ora
SPFILE='+DATA/lunardb/spfilelunardb.ora'              # line added by Agent
[oracle@lunardb1 dbs]$ cat initlunardb1.ora.bak.lunardb1
SPFILE='+DATA/mynewdb/spfilemynewdb.ora'
[oracle@lunardb1 dbs]$ 

可以修改crs中db的spfile位置:
srvctl modify database -d lunardb -p ‘+DATA/mynewdb/spfilemynewdb.ora’

再次检查,可以发现spfile位置已经正确了:

[oracle@lunardb1 ~]$ srvctl config database -d lunardb
Database unique name: lunardb
Database name: lunardb
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/mynewdb/spfilemynewdb.ora
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: lunardb
Database instances: lunardb1,lunardb2
Disk Groups: ARCHDG,DATA,REDODG
Mount point paths: 
Services: 
Type: RAC
Database is administrator managed
[oracle@lunardb1 ~]$ 

这里很显然,除了spfile位置,Database unique name也是不对的,因为crs中保存的db信息是根据db_unique_name来判断的,只能通过remove database,然后再add database,add instance等等:

[oracle@lunardb1 ~]$ srvctl remove database -d lunardb
Remove the database lunardb? (y/[n]) y
[oracle@lunardb1 ~]$ srvctl add database -d mynewdb -o /u01/app/oracle/product/11.2.0/db_1
[oracle@lunardb1 ~]$ srvctl config database -d mynewdb
Database unique name: mynewdb
Database name: 
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: 
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: mynewdb
Database instances: lunardb1,lunardb2
Disk Groups: 
Mount point paths: 
Services: 
Type: RAC
Database is administrator managed
[oracle@lunardb1 ~]$ srvctl modify database -d mynewdb -a ARCHDG,DATA,REDODG
[oracle@lunardb1 ~]$ srvctl modify database -d mynewdb -p '+DATA/mynewdb/spfilemynewdb.ora'
[oracle@lunardb1 ~]$ srvctl config database -d mynewdb
Database unique name: mynewdb
Database name: 
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/mynewdb/spfilemynewdb.ora
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: mynewdb
Database instances: lunardb1,lunardb2
Disk Groups: ARCHDG,DATA,REDODG
Mount point paths: 
Services: 
Type: RAC
Database is administrator managed
[oracle@lunardb1 ~]$ srvctl modify database -d mynewdb -n lunardb
[oracle@lunardb1 ~]$ srvctl config database -d mynewdb
Database unique name: mynewdb
Database name: lunardb
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/mynewdb/spfilemynewdb.ora
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: mynewdb
Database instances: lunardb1,lunardb2
Disk Groups: ARCHDG,DATA,REDODG
Mount point paths: 
Services: 
Type: RAC
Database is administrator managed
[oracle@lunardb1 ~]$ 

好了,alert中信息正常了:

ALTER DATABASE   MOUNT
This instance was first to mount
NOTE: Loaded library: System 
SUCCESS: diskgroup DATA was mounted
SUCCESS: diskgroup REDODG was mounted
NOTE: dependency between database mynewdb and diskgroup resource ora.DATA.dg is established
NOTE: dependency between database mynewdb and diskgroup resource ora.REDODG.dg is established
此条目发表在 RAC 分类目录,贴了 标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注