修改主机名和ip地址之后需重新reconfigure GI
###参考资料:How to Reconfigure Oracle Restart (文档 ID 986740.1)
1.修改主机名:
[root@dkf bin]# hostnamectl --static set-hostname dkfdg
2.修改ip地址 将ip地址有10.0.0.19修改到10.0.0.191
[root@dkf ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens32
TYPE=Ethernet
BOOTPROTO=no
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=ens32
UUID=UUID=1dc79716-c6a9-401d-941a-7f1fbf0100cd
DEVICE=ens32
ONBOOT=yes
IPADDR=10.0.0.191
NETMASK=255.255.255.0
GATEWAY=10.0.0.1
[root@dkf ~]# reboot
- 重启主机后,无法启动数据库,控制文件不存在
SQL>startup mount
ORACLE instance started.
Total System Global Area 1241510080 bytes
Fixed Size 9134272 bytes
Variable Size 402653184 bytes
Database Buffers 822083584 bytes
Redo Buffers 7639040 bytes
ORA-00205: error in identifying control file, check alert log for more info
4.查看日志文件:
2022-12-22T15:19:44.318817-05:00
ORA-00210: cannot open the specified control file
ORA-00202: control file: '+DATA/DKF006/CONTROLFILE/current.261.1101088595'
ORA-17503: ksfdopn:2 Failed to open file +DATA/DKF006/CONTROLFILE/current.261.1101088595
ORA-15001: diskgroup "DATA" does not exist or is not mounted
ORA-29701: unable to connect to Cluster Synchronization Service
ORA-205 signalled during: ALTER DATABASE MOUNT...
- 查看主机上asm实例,并没有asm进程
[oracle@dkfdg trace]$ ps -ef|grep ASM
oracle 80093 80044 0 15:37 pts/2 00:00:00 grep --color=auto ASM
[oracle@dkfdg trace]$
- 查看has进程
[root@dkfdg bin]# ./crsctl start has
CLSU-00107: operating system function: opendir; failed with error data: 2; at location: scrsearch1
CLSU-00101: operating system error message: No such file or directory
CLSU-00104: additional error information: cant open scr home dir scls_scr_getval
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Stop failed, or completed with errors.
[root@dkfdg bin]# ps -ef|grep has
root 52593 1 0 15:23 ? 00:00:00 /bin/sh /etc/init.d/init.ohasd run >/dev/null 2>&1 </dev/null
root 52612 52593 0 15:23 ? 00:00:00 /bin/sh /etc/init.d/init.ohasd run >/dev/null 2>&1 </dev/null
root 52616 49492 0 15:23 pts/0 00:00:00 grep --color=auto has
原因:所有的asm进程和数据库进程都没有,是由于修改IP和主机名导致;进行修复:
7.执行deconfig
# $GRID_HOME/crs/install/roothas.pl -deconfig -force
在执行roothas.pl的时候报如下错误,说明环境参数不对
[root@dkfdg install]# ./roothas.pl -deconfig -force
./roothas.pl: line 8: =head1: command not found
./roothas.pl: line 10: roothas.pl: command not found
./roothas.pl: line 12: =head1: command not found
- 需要使用GI自己的perl
rootcrs.pl/roothas.pl Fails With Can not locate Env.pm (文档 ID 2019784.1)
The fix is included in 12.1.0.2, the workaround is to use the perl in GI home.
Example :
/u01/app/19.3.0/grid/perl/bin/perl /u01/app/19.3.0/grid/crs/install/roothas.pl -deconfig -force
++++++++++++++++++++++++++++++++++++++++++++++++++++++
[root@dkfdg install]# /u01/app/19.3.0/grid/perl/bin/perl /u01/app/19.3.0/grid/crs/install/roothas.pl -deconfig -force
Using configuration parameter file: /u01/app/19.3.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
/u01/app/grid/crsdata/dkfdg/crsconfig/hadeconfig.log
PRCR-1070 : Failed to check if resource ora.asm is registered
CRS-5168 : unable to communicate with ohasd
2022/12/22 15:27:37 CLSRSC-180: An error occurred while executing the command '/u01/app/19.3.0/grid/bin/srvctl remove asm -force'
PRCR-1070 : Failed to check if resource ora.ons is registered
CRS-5168 : unable to communicate with ohasd
2022/12/22 15:27:38 CLSRSC-180: An error occurred while executing the command '/u01/app/19.3.0/grid/bin/srvctl config ons'
CLSU-00107: operating system function: opendir; failed with error data: 2; at location: scrsearch1
CLSU-00101: operating system error message: No such file or directory
CLSU-00104: additional error information: cant open scr home dir scls_scr_getval
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Stop failed, or completed with errors.
2022/12/22 15:27:41 CLSRSC-337: Successfully deconfigured Oracle Restart stack
9.重新配置crs
# $GRID_HOME/crs/install/roothas.pl
[root@dkfdg install]# /u01/app/19.3.0/grid/perl/bin/perl /u01/app/19.3.0/grid/crs/install/roothas.pl
Using configuration parameter file: /u01/app/19.3.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
/u01/app/grid/crsdata/dkfdg/crsconfig/roothas_2022-12-22_03-30-00PM.log
2022/12/22 15:30:02 CLSRSC-363: User ignored prerequisites during installation
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node dkfdg successfully pinned.
2022/12/22 15:30:09 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'
dkfdg 2022/12/22 15:30:48 /u01/app/grid/crsdata/dkfdg/olr/backup_20221222_153048.olr 724960844
2022/12/22 15:30:49 CLSRSC-327: Successfully configured Oracle Restart for a standalone server
[root@dkfdg install]#
10.检查集群资源状态
[root@dkfdg install]# su - grid
[grid@dkfdg ~]$ ps -ef|grep has
root 78977 1 0 15:30 ? 00:00:00 /bin/sh /etc/init.d/init.ohasd run >/dev/null 2>&1 </dev/null
grid 79677 1 0 15:30 ? 00:00:07 /u01/app/19.3.0/grid/bin/ohasd.bin reboot
grid 80209 80169 0 16:12 pts/0 00:00:00 grep --color=auto has
[grid@dkfdg ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ons OFFLINE OFFLINE dkfdg STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1 OFFLINE OFFLINE STABLE
ora.diskmon
1 OFFLINE OFFLINE STABLE
ora.evmd
1 ONLINE ONLINE dkfdg STABLE
--------------------------------------------------------------------------------
[grid@dkfdg ~]$
10.添加asm资源 srvctl add asm
[grid@dkfdg ~]$ srvctl add asm
11.启动asm资源 srvctl start asm
[grid@dkfdg ~]$ srvctl start asm
[grid@dkfdg ~]$
12.挂载asm磁盘组
[grid@dkfdg ~]$ sqlplus / as sysasm
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Dec 22 16:26:34 2022
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> set line 200
SQL> set pagesize 0
SQL> select GROUP_NUMBER,NAME,STATE from v$asm_diskgroup;
0 OCRV DISMOUNTED
1 DATA MOUNTED
SQL> alter diskgroup ocrv mount;
Diskgroup altered.
SQL>
SQL> alter diskgroup data mount;
Diskgroup altered.
SQL>
13.添加数据库资源,并启动
[oracle@dkfdg ~]$ su - oracle
Password:
[grid@dkfdg ~]$
[oracle@dkfdg ~]$ srvctl add database -db dkf006 -oraclehome $ORACLE_HOME
[oracle@dkfdg ~]$ srvctl start database -db dkf006
14.添加listener,并启动
[oracle@dkfdg ~]$ su - grid
Password:
[grid@dkfdg ~]$
[grid@dkfdg ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE dkfdg STABLE
ora.OCRV.dg
ONLINE ONLINE dkfdg STABLE
ora.asm
ONLINE ONLINE dkfdg Started,STABLE
ora.ons
OFFLINE OFFLINE dkfdg STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1 ONLINE ONLINE dkfdg STABLE
ora.diskmon
1 OFFLINE OFFLINE STABLE
ora.dkf006.db
1 ONLINE ONLINE dkfdg Open,HOME=/u01/app/o
racle/product/19.3.0
/dbhome_1,STABLE
ora.evmd
1 ONLINE ONLINE dkfdg STABLE
--------------------------------------------------------------------------------
[grid@dkfdg ~]$
[grid@dkfdg admin]$ srvctl add listener
[grid@dkfdg admin]$ srvctl start listener
[grid@dkfdg admin]$
[grid@dkfdg ~]$ lsnrctl status
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 22-DEC-2022 17:06:16
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 22-DEC-2022 17:06:10
Uptime 0 days 0 hr. 0 min. 7 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/19.3.0/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/dkfdg/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.0.0.191)(PORT=1521)))
Services Summary...
Service "dkf006" has 1 instance(s).
Instance "dkf006", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[grid@dkfdg ~]$
数据库恢复正常。
==========================================================================================================================================================
RAC集群重新配置GI:参考资料:如何(Deconfigure)解除配置/(Reconfigure)重新配置(重建 OCR)或卸载 GI (文档 ID 2016852.1)
根据mos文档的步骤,重新配置gi
1.在节点1上deconfig GI
[root@dkfdg1 install]# ./rootcrs.pl -deconfig -force -verbose
2.在节点2上执行
[root@dkfdg2 install]# ./rootcrs.pl -deconfig -force -verbose -lastnode
3.节点1上执行root.sh。重新配置GI
[root@dkfdg1 grid]# /u01/app/19.3.0.0/grid/root.sh
- 节点2上执行root.sh
[root@dkfdg2 grid]# /u01/app/19.3.0.0/grid/root.sh
如出现报错,则按要求执行:
/u01/app/19.3.0.0/grid/oui/bin/runInstaller -jreLoc /u01/app/19.3.0.0/grid/jdk/jre -paramFile /u01/app/19.3.0.0/grid/oui/clusterparam.ini -silent -ignoreSysPrereqs -updateNodeList -bigCluster ORACLE_HOME=/u01/app/19.3.0.0/grid CLUSTER_NODES=dkfdg2 "NODES_TO_SET={dkfdg2,dkfdg2}" -invPtrLoc "/u01/app/19.3.0.0/grid/oraInst.loc" -local CRS=true -doNotUpdateNodeList
crs重新配置成功。