打补丁(18370031)
1 停掉has
若已经配置好的需要进行删除
我这里是之前是采用dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1
命令进行启动的,需要停掉has,然后再删除
[root@localhost bin]# cd /u01/grid/grid_home/bin
[root@localhost bin]# ./crsctl stop has
也可以不用停掉has
2 删除掉Stand-Alone
[root@localhost bin]# /u01/grid/grid_home/perl/bin/perl -I/u01/grid/grid_home/perl/lib -I/u01/grid/grid_home/crs/install /u01/grid/grid_home/crs/install/roothas.pl -deconfig -force -verbose Using configuration parameter file: /u01/grid/grid_home/crs/install/crsconfig_params CRS-4639: Could not contact Oracle High Availability Services CRS-4000: Command Stop failed, or completed with errors. CRS-4639: Could not contact Oracle High Availability Services CRS-4000: Command Delete failed, or completed with errors. CRS-4544: Unable to connect to OHAS CRS-4000: Command Stop failed, or completed with errors. Successfully deconfigured Oracle Restart stack |
3 下载补丁
下载补丁需要有metlink账号才能下载
4 补丁上传到服务器并进行打补丁
[root@localhost soft]# unzip p18370031_112040_Linux-x86-64.zip
[root@localhost grid_home]# su - grid
[grid@localhost ~]$ cd $ORACLE_HOME
[grid@localhost grid_home]$ cd OPatch/
打补丁的命令需要在grid用户下执行,补丁解压缩的路径可以是root权限账号下的(/soft/18370031)
[grid@localhost ~]$ cd $ORACLE_HOME/OPatch [grid@localhost OPatch]$ ./opatch napply -local /soft/18370031 |
这里报错误,查看目录权限
[root@localhost ~]# cd /u01/grid
[root@localhost grid]# ls
grid_base grid_home oraInventory
[root@localhost grid]# ls -al
total 4
drwxr-xr-x. 5 grid oinstall 60 Nov 3 06:14 .
drwxr-xr-x. 4 oracle oinstall 32 Nov 3 03:04 ..
drwxr-xr-x. 8 grid oinstall 105 Nov 3 06:33 grid_base
drwxr-x---. 67 root oinstall 4096 Nov 3 06:25 grid_home
drwxrwx--- 6 grid oinstall 103 Nov 4 01:14 oraInventory
[root@localhost grid]#
不知道什么原因,怎么grid_home的是root账号的,修改成grid用户
[root@localhost grid]# cd /u01/grid
[root@localhost grid]# chown -R grid:oinstall ./grid_home
[grid@localhost ~]$ cd $ORACLE_HOME/OPatch [grid@localhost OPatch]$ ./opatch napply -local /soft/18370031 Oracle Interim Patch Installer version 11.2.0.3.4 Copyright (c) 2012, Oracle Corporation. All rights reserved.
Oracle Home : /u01/grid/grid_home Central Inventory : /u01/grid/oraInventory from : /u01/grid/grid_home/oraInst.loc OPatch version : 11.2.0.3.4 OUI version : 11.2.0.4.0 Log file location : /u01/grid/grid_home/cfgtoollogs/opatch/opatch2020-10-26_02-32-55AM_1.log
Verifying environment and performing prerequisite checks... OPatch continues with these patches: 18370031
Do you want to proceed? [y|n] y User Responded with: Y All checks passed.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system. (Oracle Home = \'/u01/grid/grid_home\')
Is the local system ready for patching? [y|n] y User Responded with: Y Backing up files... Applying interim patch \'18370031\' to OH \'/u01/grid/grid_home\'
Patching component oracle.crs, 11.2.0.4.0...
Verifying the update... Patch 18370031 successfully applied. Log file location: /u01/grid/grid_home/cfgtoollogs/opatch/opatch2020-10-26_02-32-55AM_1.log
OPatch succeeded. |
5 检查补丁情况
[grid@localhost OPatch]$ ./opatch lsinventory Oracle Interim Patch Installer version 11.2.0.3.4 Copyright (c) 2012, Oracle Corporation. All rights reserved.
Oracle Home : /u01/grid/grid_home Central Inventory : /u01/grid/oraInventory from : /u01/grid/grid_home/oraInst.loc OPatch version : 11.2.0.3.4 OUI version : 11.2.0.4.0 Log file location : /u01/grid/grid_home/cfgtoollogs/opatch/opatch2020-10-26_02-38-53AM_1.log
Lsinventory Output file location : /u01/grid/grid_home/cfgtoollogs/opatch/lsinv/lsinventory2020-10-26_02-38-53AM.txt
-------------------------------------------------------------------------------- Installed Top-level Products (1):
Oracle Grid Infrastructure 11g 11.2.0.4.0 There are 1 products installed in this Oracle Home.
Interim patches (1) :
Patch 18370031 : applied on Mon Oct 26 02:34:34 EDT 2020 Unique Patch ID: 17950825 Patch description: "Grid Infrastructure Patch Set Update : 11.2.0.4.x (gibugno)" Created on 15 Aug 2014, 16:14:40 hrs PST8PDT Bugs fixed: 18370031
--------------------------------------------------------------------------------
OPatch succeeded. |
6 重新配置Stand-Alone
[root@localhost grid]# /u01/grid/grid_home/perl/bin/perl -I/u01/grid/grid_home/perl/lib -I/u01/grid/grid_home/crs/install /u01/grid/grid_home/crs/install/roothas.pl Using configuration parameter file: /u01/grid/grid_home/crs/install/crsconfig_params 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 localhost successfully pinned. Adding Clusterware entries to oracle-ohasd.service
localhost 2020/10/26 02:42:52 /u01/grid/grid_home/cdata/localhost/backup_20201026_024252.olr Successfully configured Oracle Grid Infrastructure for a Standalone Server |
这个时候就不需要使用dd命令,has就可以自动启动了
[root@localhost grid]# cd /u01/grid/grid_home/bin
[root@localhost bin]# ./crsctl check has
CRS-4638: Oracle High Availability Services is online
[root@localhost bin]# ./crsctl check evm
CRS-4533: Event Manager is online
[root@localhost bin]# ./crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.cssd ora.cssd.type 0/5 0/5 OFFLINE OFFLINE
ora.diskmon ora....on.type 0/10 0/5 OFFLINE OFFLINE
ora.evmd ora.evm.type 0/10 0/5 ONLINE ONLINE localhost
ora.ons ora.ons.type 0/3 0/ OFFLINE OFFLINE
系统重启动后,has也会自动启动,
7.若安装的是Standalone Server,重新配置ha后,发现cssd和asm都没有启动
[root@localhost bin]# ./crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.cssd ora.cssd.type 0/5 0/5 OFFLINE OFFLINE
ora.diskmon ora....on.type 0/10 0/5 OFFLINE OFFLINE
ora.evmd ora.evm.type 0/10 0/5 ONLINE ONLINE localhost
ora.ons ora.ons.type 0/3 0/ OFFLINE OFFLINE
手工启动cssd服务
[root@localhost bin]# ./crsctl start resource ora.cssd
CRS-2672: Attempting to start \'ora.cssd\' on \'localhost\'
CRS-2672: Attempting to start \'ora.diskmon\' on \'localhost\'
CRS-2676: Start of \'ora.diskmon\' on \'localhost\' succeeded
CRS-2676: Start of \'ora.cssd\' on \'localhost\' succeeded
8.将asm服务添加到gi,grid用户下添加
[grid@localhost ~]$ whoami
grid
[grid@localhost ~]$ srvctl add asm
[grid@localhost ~]$ srvctl start asm
登陆asm实例发现,磁盘组没有加载
[grid@localhost ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Fri Nov 6 01:01:18 2020
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect / as sysasm
Connected.
SQL> show parameters asm*;
SQL> select name,state from v$asm_diskgroup;
no rows selected
SQL>
编辑初始化参数
[grid@oragrid dbs]$ vi /tmp/init+ASM.ora
asm_diskstring=\'/dev/asm*\'
asm_diskgroups=\'DATA\'
asm_power_limit=1
diagnostic_dest=\'/u01/grid/grid_base\'
instance_type=\'asm\'
large_pool_size=12M
remote_login_passwordfile=\'EXCLUSIVE\'
关闭asm实例
SQL> shutdown immediate
ORA-15100: invalid or missing diskgroup name
ASM instance shutdown
创建spfile
SQL> create spfile from pfile=\'/tmp/init+ASM.ora\';
然后启动
SQL> startup
ASM instance started
Total System Global Area 1135747072 bytes
Fixed Size 2260728 bytes
Variable Size 1108320520 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
查看相应的参数
SQL> set linesize 1000;
SQL> show parameters asm;
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
asm_diskgroups string DATA
asm_diskstring string /dev/asm*
asm_power_limit integer 1
asm_preferred_read_failure_groups string
SQL>
将其他的磁盘组加入到参数里
SQL> alter system set asm_diskgroups=DATA,DATA1 scope=both;
然后重启asm实例
SQL> startup force
ASM instance started
Total System Global Area 1135747072 bytes
Fixed Size 2260728 bytes
Variable Size 1108320520 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
再次查看资源情况
[root@localhost bin]# ./crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.DATA.dg ora....up.type 0/5 0/ ONLINE ONLINE localhost
ora.DATA1.dg ora....up.type 0/5 0/ ONLINE ONLINE localhost
ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE localhost
ora.cssd ora.cssd.type 0/5 0/5 ONLINE ONLINE localhost
ora.diskmon ora....on.type 0/10 0/5 OFFLINE OFFLINE
ora.evmd ora.evm.type 0/10 0/5 ONLINE ONLINE localhost
ora.ons ora.ons.type 0/3 0/ OFFLINE OFFLINE
9.添加监听器
添加监听器
[grid@localhost ~]$ srvctl add listener
PRCN-2061 : Failed to add listener ora.LISTENER.lsnr
PRCN-2065 : Port(s) 1521 are not available on the nodes given
PRCN-2067 : Port 1521 is not available across node(s) "localhost.localdomain"
重启机器后问题解决,然后启动监听器
或是杀掉之前的监听进程
[grid@localhost ~]$ ss -nlp|grep 1521
u_str LISTEN 0 100 /var/tmp/.oracle/sEXTPROC1521 29110 * 0 users:(("tnslsnr",pid=2652,fd=8))
tcp LISTEN 0 128 [::]:1521 [::]:* users:(("tnslsnr",pid=2652,fd=11))
[grid@localhost ~]$ ps -ef|grep 2652
grid 2652 1 0 Nov24 ? 00:00:00 /u01/grid/grid_home/bin/tnslsnr LISTENER -inherit
grid 14536 13946 0 01:40 pts/1 00:00:00 grep --color=auto 2652
[grid@localhost ~]$ kill 2652
[grid@localhost ~]$ srvctl start listener
10.重启机器 检查has是否自启动
[grid@localhost ~]$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.DATA.dg ora....up.type 0/5 0/ ONLINE ONLINE localhost
ora.DATA1.dg ora....up.type 0/5 0/ ONLINE ONLINE localhost
ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE localhost
ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE localhost
ora.cssd ora.cssd.type 0/5 0/5 ONLINE ONLINE localhost
ora.diskmon ora....on.type 0/10 0/5 OFFLINE OFFLINE
ora.evmd ora.evm.type 0/10 0/5 ONLINE ONLINE localhost
ora.ons ora.ons.type 0/3 0/ OFFLINE OFFLINE