PRCD-1120 : The resource for database racpdb could not be found.PRCR-1001 : Resource ora.racpdb.db d

129 篇文章 7 订阅

问题描述

RAC异机恢复后无法查看实例状态

[oracle@new-rac2 ~]$ srvctl status database -d racpdb
PRCD-1120 : The resource for database racpdb could not be found.
PRCR-1001 : Resource ora.racpdb.db does not exist

开始以为是因为没有注册remote_listener导致监听不可用

SQL> show parameter remote_listener                         

NAME                     TYPE		VALUE
------------------------------------ ---------------------- ------------------------------
remote_listener          string		racpdb:1521

SQL> alter system set remote_listener='testpro:1521';       

System altered.

SQL> alter system register;

System altered.

SQL> show parameter remote_listener;

NAME                     TYPE	    	VALUE
------------------------------------ ---------------------- ------------------------------
remote_listener          string		testpro:1521

但其实原因是修改了scan IP的name后,remote_listener没有注册新的name,而且grid记录的scan IP也不是这个名字,需要修改scan IP

解决办法:

  • 查看scan信息
[oracle@new-rac1 ~]$ srvctl config scan
SCAN name: rac, Network: 1/192.168.1.0/255.255.255.0/em1
SCAN VIP name: scan1, IP: /rac/192.168.1.218
SCAN VIP name: scan2, IP: /isis/192.168.1.219
  • 查看hosts文件
[oracle@new-rac1 ~]$ cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

# Public Network - (eth1)
192.168.1.214   new-rac1  testpdb1
192.168.1.216   new-rac2  testpdb2

# Private Interconnect - (eth4)
172.16.1.214    testpdb1-priv
172.16.1.216    testpdb2-priv

# Public Virtual IP (VIP) addresses
192.168.1.215    testpdb1-vip
192.168.1.217    testpdb2-vip

# Single Client Access Name (SCAN)
192.168.1.218    testpro
192.168.1.219    testpro

通过srvctl config scan看到scan name是rac,但是在hosts文件里scan name却是testpro

  • 修改scan name
[oracle@new-rac1 ~]$ su - grid
Password:
[grid@new-rac1 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node new-rac2
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node new-rac1
[grid@new-rac1 ~]$ srvctl stop scan
PRCR-1065 : Failed to stop resource ora.scan1.vip
CRS-2529: Unable to act on 'ora.scan1.vip' because that would require stopping or relocating 'ora.LISTENER_SCAN1.lsnr', but the force option was not specified
PRCR-1065 : Failed to stop resource ora.scan2.vip
CRS-2529: Unable to act on 'ora.scan2.vip' because that would require stopping or relocating 'ora.LISTENER_SCAN2.lsnr', but the force option was not specified

关闭顺序:需要先停掉scan监听,才能停掉scan

[grid@new-rac1 ~]$ srvctl stop scan_listener
[grid@new-rac1 ~]$ srvctl stop scan
  • 修改scan
[grid@new-rac1 ~]$ srvctl modify scan -n testpro
PRCS-1034 : Failed to modify Single Client Access Name testpro.nsfc.gov.cn
PRCR-1071 : Failed to register or update resource type ora.scan_vip.type
CRS-0245:  User doesn't have enough privilege to perform the operation

没有权限,必须是root用户

[grid@new-rac1 ~]$ exit
logout
[root@new-rac1 rman_bak]# /u01/app/11.2.0/grid/bin/srvctl modify scan -n testpro
[root@new-rac1 rman_bak]# /u01/app/11.2.0/grid/bin/srvctl config scan
SCAN name: testpro, Network: 1/192.168.1.0/255.255.255.0/em1
SCAN VIP name: scan1, IP: /testpro/192.168.1.218
SCAN VIP name: scan2, IP: /testpro/192.168.1.219
  • 修改后重启scan
    打开顺序:先开启scan,再开启scan监听
[root@new-rac1 rman_bak]# /u01/app/11.2.0/grid/bin/srvctl start scan
[root@new-rac1 rman_bak]# /u01/app/11.2.0/grid/bin/srvctl start scan_listener
[root@new-rac1 rman_bak]# /u01/app/11.2.0/grid/bin/srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node new-rac2
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node new-rac1
  • 重新注册remote_listener
SQL> alter system set remote_listener='testpro:1521';

System altered.

SQL> alter system register;

System altered.

SQL> show parameter remote_listener

NAME                     TYPE     VALUE
------------------------------------ ----------- ------------------------------
remote_listener              string     testpro:1521

因为是异机恢复,sid不同,因此需要重新添加实例名称

  • 添加实例racpdb
[oracle@new-rac2 ~]$ srvctl add database -d racpdb -o /u01/app/oracle/product/11.2.0/dbhome_1 -p /u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileracpdb2.ora
[oracle@new-rac2 ~]$ srvctl add instance -d racpdb -i racpdb1 -n new-rac1
[oracle@new-rac2 ~]$ srvctl add instance -d racpdb -i racpdb2 -n new-rac2
[oracle@new-rac2 ~]$ srvctl config database -d racpdb
Database unique name: racpdb
Database name:
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: /u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileracpdb2.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: racpdb
Database instances: racpdb1,racpdb2
Disk Groups:
Mount point paths:
Services:
Type: RAC
Database is administrator managed
  • 查看实例状态
[oracle@new-rac2 ~]$ srvctl status database -d racpdb
Instance racpdb1 is not running on node new-rac1
Instance racpdb2 is not running on node new-rac2
[oracle@new-rac2 ~]$ srvctl start database -d racpdb
[oracle@new-rac2 ~]$ srvctl status database -d racpdb
Instance racpdb1 is running on node new-rac1
Instance racpdb2 is running on node new-rac2
  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值