暂无图片
暂无图片
12
暂无图片
暂无图片
暂无图片

Redhat7.6+ASM+12C单实例安装及升级至19C

原创 木底木叉 云和恩墨 2022-05-15
15898

12C ASM 单实例安装升级

一、12C+ASM安装

1、hosts
[root@ora12c ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.220.12 ora12c
2、防火墙
[root@ora12c ~]# systemctl stop firewalld.service
[root@ora12c ~]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
3、SELINUX
[root@ora12c ~]# sed -i  "s/SELINUX=enforcing/SELINUX=disabled/"  /etc/selinux/config
[root@ora12c ~]# cat  /etc/selinux/config
This file controls the state of SELinux on the system.
SELINUX= can take one of these three values:
enforcing - SELinux security policy is enforced.
permissive - SELinux prints warnings instead of enforcing.
disabled - No SELinux policy is loaded.
SELINUX=disabled
SELINUXTYPE= can take one of three values:
targeted - Targeted processes are protected,
minimum - Modification of targeted policy. Only selected processes are protected.
mls - Multi Level Security protection.
SELINUXTYPE=targeted
4、用户和组
groupadd -g 54321 oinstall
groupadd -g 54322 asmadmin
groupadd -g 54323 asmdba
groupadd -g 54324 asmoper
groupadd -g 54325 dba
groupadd -g 54326 oper
useradd -u 54321 -g oinstall -G dba,asmdba,oper oracle
useradd -u 54322 -g oinstall -G asmadmin,asmdba,asmoper,dba grid
passwd oracle
passwd grid
mkdir -p /u01/app/12.2.0/grid
mkdir -p /u01/app/grid
mkdir -p /u01/app/oracle/product/12.2.0/db_1
chown -R grid:oinstall /u01
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/
5、资源限制
vi /etc/security/limits.conf
#ORACLE SETTING
grid  soft  nproc 16384
grid  hard  nproc 16384
grid  soft  nofile 1024
grid  hard  nofile 65536
grid  soft  stack 10240
grid  hard  stack 32768
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack  10240
oracle hard stack  32768
oracle hard memlock 3145728
oracle soft memlock 3145728
6、镜像
mount /dev/cdrom /mnt
cd /etc/yum.repos.d
mkdir bk
mv *.repo bk/
echo "[EL]" >> /etc/yum.repos.d/rhel.repo
echo "name =Linux 7.x DVD" >> /etc/yum.repos.d/rhel.repo
echo "baseurl=file:///mnt" >> /etc/yum.repos.d/rhel.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/rhel.repo
echo "enabled=1" >> /etc/yum.repos.d/rhel.repo
cat /etc/yum.repos.d/rhel.repo
7、修改nproc参数
echo "* -nproc 16384" > /etc/security/limits.d/20-nproc.conf
cat /etc/security/limits.d/20-nproc.conf4
8、ulimit -a
echo "session required pam_limits.so" >> /etc/pam.d/login
cat /etc/pam.d/login
9、内核参数
#ORACLE SETTING
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
kernel.panic_on_oops = 1
vm.nr_hugepages = 1000				
kernel.shmmax = 1610612736
kernel.shmall = 393216					
kernel.shmmni = 4096
sysctl -p
10、透明页
cat /sys/kernel/mm/transparent_hugepage/defrag
[always] madvise never
cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never
vi /etc/rc.d/rc.local
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
chmod +x /etc/rc.d/rc.local
11、numa
numactl --hardware
vi /etc/default/grub
numa=off         #加到GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet"后面
grub2-mkconfig -o /etc/grub2.cfg
numactl --hardware
12、共享段
echo "none /dev/shm tmpfs defaults,size=8192m 0 0" >>/etc/fstab
mount -o remount /dev/shm
13、修改时区
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
hwclock
14、daemon
echo "NOZEROCONF=yes" >> /etc/sysconfig/network
systemctl stop avahi-daemon.socket avahi-daemon.service
systemctl disable avahi-daemon.socket avahi-daemon.service
15、修改nsswitch.conf
vi /etc/nsswitch.conf
hosts: files dns myhostname ni
16、环境变量

grid

vi ~/.bash_profile
PS1="[whoami@hostname:"'$PWD]$'
export PS1
umask 022
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
ORACLE_SID=+ASM; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
ORACLE_HOME=/u01/app/12.2.0.0/grid; export ORACLE_HOME
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi

oracle

[oracle@rac1:/home/oracle]$vi ~/.bash_profile
PS1="[whoami@hostname:"'$PWD]$'
export PS1
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/19.0.0/db_1; export ORACLE_HOME
ORACLE_SID=erpdb1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG
PATH=.:$PATH:$HOME/bin:$ORACLE_BASE/product/19.0.0/db_1/bin:$ORACLE_HOME/bin; export PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
17、磁盘组
for i in c d e f g h i j k;
do
echo "KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i", SYMLINK+="asmdisk/asmdisk$i",OWNER="grid", GROUP="asmadmin",MODE="0660""
done
KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c293c54f49347feae083b89319de", SYMLINK+="asmdisk/asmdiskc",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c2966b562c795905a1ecc5aa8f05", SYMLINK+="asmdisk/asmdiskd",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c29e96bb6208c16ecef75d545157", SYMLINK+="asmdisk/asmdiske",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c296fa8d6b13fe966a79db167ee8", SYMLINK+="asmdisk/asmdiskf",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c294e58f9588f7d813c3063177aa", SYMLINK+="asmdisk/asmdiskg",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c2986b18198444a79c04ab2a4f01", SYMLINK+="asmdisk/asmdiskh",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c296393b7b0616c6d7f2b1fe2a7d", SYMLINK+="asmdisk/asmdiski",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c2966281cdaec1507d9412cace07", SYMLINK+="asmdisk/asmdiskj",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c297b8505832d87b1c7439183a02", SYMLINK+="asmdisk/asmdiskk",OWNER="grid", GROUP="asmadmin",MODE="0660"
[root@ora12c rules.d]# vi 99-oracle-asmdevices.rules
/sbin/udevadm control --reload-rules
/sbin/udevadm trigger --type=devices --action=change
18、安装目录
pvcreate /dev/sdb
vgcreate oraclehome /dev/sdb
lvcreate -n oraclehomelv -L 200G oraclehome
mkfs.xfs /dev/oraclehome/oraclehomelv
19、安装GI
./gridInstaller  --图形界面选择Configure Oracle Gird Infrastructure for a Standalone Sever(Oracle Restart)
./Installer --安装数据库软件,之后可以建库
20、遇到的几个问题
1、创建磁盘组报错
DBT-30002
ORA-15018
ORA-15031
ORA-15014

创建磁盘组不要勾选Labal disks Using AFD

2、dbca建库报错ORA-27104:system-defined limits for shared memory was misconfigured

检查发现/etc/sysctl.config中kernel.shmall写错,最好手工计算

3、关机冲击后asm磁盘未启动,启动后没有磁盘组
ORA-01078: failure in processing system parameters
ORA-29701: unable to connect to Cluster Synchronization Service
crsctl check css
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Check failed, or completed with errors.
ERROR: diskgroup DATA was not mounted
ORA-15032: not all alterations performed
ORA-15017: diskgroup "DATA" cannot be mounted
ORA-15040: diskgroup is incomplete
SQL> show parameter ASM_DISKSTRING
NAME                                 TYPE        VALUE
--------------------------------------------------------------------------------
asm_diskstring                       string      AFD:*

修改GI 的ORACLE_HOME/dbs/init+ASM.ora参数文件中的asm_diskstring 参数

重启后

crsctl start has

二、安装19C软件

1、用户、组、目录
useradd -u 54321 -g oinstall -G dba,asmdba,oper ora19c
passwd ora19c
mkdir -p /u02/app/oracle/product/19.3.0/db_1
chown -R grid:oinstall /u02
chown -R ora19c:oinstall /u02/app/oracle
chmod -R 775 /u02/
2、资源限制
vi /etc/security/limits.conf
ora19c soft nproc 16384
ora19c hard nproc 16384
ora19c soft nofile 1024
ora19c hard nofile 65536
ora19c soft stack  10240
ora19c hard stack  32768
ora19c hard memlock 3145728
ora19c soft memlock 3145728
3、环境变量
[root@rac1 ~]# su - ora19c
PS1="[whoami@hostname:"'$PWD]$'
export PS1
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
ORACLE_BASE=/u02/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/19.3.0/db_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG
PATH=.:$PATH:$HOME/bin:$ORACLE_BASE/product/19.3.0/db_1/bin:$ORACLE_HOME/bin; export PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
4、安装软件
./Installer --只安装数据库软件
5、建库
dbca
--Creation Mode 处报错
DBT-05806 An older ASM instance was found--12casm不能用户19c数据库。

三、升级12C ASM

1、安装目录

可以继续在u01下的ORACLE_HOME下创建,测出为了测试,新建了/u03

mkdir -p /u03/app/19.0.0/grid
mkdir -p /u03/app/grid
mkdir -p /u03/app/oracle
mkdir -p /u03/app/oracle/product/19.0.0/db_1
chown -R grid:oinstall /u03
chown -R oracle:oinstall /u03/app/oracle
2、安装GI软件
./gridInstaller  --图形界面选择Configure Oracle Gird Infrastructure for a Standalone Sever(Oracle Restart)
3、报错

Prerequisite Checks报错

Oracle patch 28553832
Oracle patch 27006180

好吧,需要打上这两patch,暂停打补丁

四、12C 打补丁27006180

1、上传、解压
unzip p27006180_12201171003OCWRU_Linux-x86-64.zip
ls 
[grid@ora12c:/u01]$ls
27006180  database   
[grid@ora12c:/u01/app/12.2.0/grid/OPatch]$./opatch version
OPatch Version: 12.2.0.1.6

OPatch succeeded. --opatch版本大于12.2.0.1.5 不用替换
2、OCM配置
The OPatch utility will prompt for your OCM (Oracle Configuration Manager) response file when it is run. You should enter a complete path of OCM response file if you already have created this in your environment.

If you do not have the OCM response file (ocm.rsp), then you should run the following command to create it.

As the GI home owner execute:

$ <ORACLE_HOME>/OPatch/ocm/bin/emocmrsp
[grid@ora12c:/u01/app/12.2.0/grid/OPatch]$cd ocm/bin
[grid@ora12c:/u01/app/12.2.0/grid/OPatch]$cd ocm/
[grid@ora12c:/u01/app/12.2.0/grid/OPatch/ocm]$ls
generic.zip --没有这个文件

查看mos

OCM IS NO LONGER PACKAGED WITH OPATCH
Note:  This enhancement to OPatch exists in 12.2.0.1.5 release and later
In the past, when a "silent" installation was executed, it was necessary to generate a response file and include it in the command line of the OPatch apply.  For example:

# opatchauto apply <UNZIPPED_PATCH_LOCATION>/23273686 -ocmrf <ocm response file>
The option -ocmrf is used to provide OPatch the OCM responses during a silent install.  Since OCM is no longer packaged with OPatch, the -ocmrf is no longer needed on the command line.  The command can now be

# opatchauto apply <UNZIPPED_PATCH_LOCATION>/23273686
The command "emocmrsp" is used to create the response file for the option -ocmrf.  This no longer is needed since the -ocmrf is no longer needed

If -ocmrf is included in the command line, the following ignorable warning will be returned

***You are calling OPatch with -ocmrf option while this OPatch is generic, not being bundled with OCM. The -ocmrf option is being deprecated. Please remove it while calling OPatch.***

OPatch: Behavior Changes starting in OPatch 12.2.0.1.5 and 11.2.0.3.14 releases (Doc ID 2161861.1)

这个已经去掉了,直接使用opatchauto

3、Oracle Inventory 的验证
[grid@ora12c:/u01/app/12.2.0/grid/OPatch]$./opatch lsinventory -oh $ORACLE_HOME
The user is root. OPatch cannot continue if the user is root.

OPatch failed with error code 255
[grid@ora12c:/u01/app/12.2.0/grid/OPatch]$exit
exit
[grid@ora12c:/u01/app/12.2.0/grid/OPatch/ocm]$cd ..
[grid@ora12c:/u01/app/12.2.0/grid/OPatch]$./opatch lsinventory -oh $ORACLE_HOME
Oracle Interim Patch Installer version 12.2.0.1.6
Copyright (c) 2022, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/12.2.0/grid
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/12.2.0/grid/oraInst.loc
OPatch version    : 12.2.0.1.6
OUI version       : 12.2.0.1.4
Log file location : /u01/app/12.2.0/grid/cfgtoollogs/opatch/opatch2022-05-13_06-47-33AM_1.log

Lsinventory Output file location : /u01/app/12.2.0/grid/cfgtoollogs/opatch/lsinv/lsinventory2022-05-13_06-47-33AM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: ora12c
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1): 

Oracle Grid Infrastructure 12c                                       12.2.0.1.0
There are 1 products installed in this Oracle Home.


There are no Interim patches installed in this Oracle Home.


--------------------------------------------------------------------------------

OPatch succeeded.
4、一次性补丁冲突检测
[grid@ora12c:/u01/27006180]$$ORACLE_HOME/OPatch/opatchauto apply /u01/27006180  analyze;
OPATCHAUTO-72046: Invalid wallet parameters.
OPATCHAUTO-72046: The wallet path or wallet password provided is not valid.
OPATCHAUTO-72046: Please provide valid wallet information.

opatchauto bootstrapping failed with error code 46.

需要用root

[grid@ora12c:/u01/27006180]$su root
Password: 

[grid@ora12c:/u01/27006180]$/u01/app/12.2.0/grid/OPatch/opatchauto apply /u01/27006180  -analyze;

System initialization log file is /u01/app/12.2.0/grid/cfgtoollogs/opatchautodb/systemconfig2022-05-13_06-55-27AM.log.

Session log file is /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/opatchauto2022-05-13_06-55-31AM.log
The id for this session is JQJH
[init:init] Executing OPatchAutoBinaryAction action on home /u01/app/oracle/product/12.2.0/db_1

Executing OPatch prereq operations to verify patch applicability on SIDB Home........

[init:init] OPatchAutoBinaryAction action completed on home /u01/app/oracle/product/12.2.0/db_1 successfully
[init:init] Executing SIDBPrereqAction action on home /u01/app/oracle/product/12.2.0/db_1

Executing prereq operations before applying on SIDB Home........

[init:init] SIDBPrereqAction action completed on home /u01/app/oracle/product/12.2.0/db_1 successfully
[init:init] Executing OPatchAutoBinaryAction action on home /u01/app/12.2.0/grid

Executing OPatch prereq operations to verify patch applicability on SIHA Home........

[init:init] OPatchAutoBinaryAction action completed on home /u01/app/12.2.0/grid successfully
[init:init] Executing SIHAPrereqAction action on home /u01/app/12.2.0/grid

Executing prereq operations before applying on SIHA Home........

[init:init] SIHAPrereqAction action completed on home /u01/app/12.2.0/grid successfully
OPatchAuto successful.

--------------------------------Summary--------------------------------

Analysis for applying patches has completed successfully:

Host:ora12c
SIDB Home:/u01/app/oracle/product/12.2.0/db_1


==Following patches were SUCCESSFULLY analyzed to be applied:

Patch: /u01/27006180/27006180
Log: /u01/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2022-05-13_06-55-38AM_1.log


Host:ora12c
SIHA Home:/u01/app/12.2.0/grid


==Following patches were SUCCESSFULLY analyzed to be applied:

Patch: /u01/27006180/27006180
Log: /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-05-13_06-56-03AM_1.log
5、安装补丁
[root@ora12c ~]# /u01/app/12.2.0/grid/OPatch/opatchauto apply /u01/27006180 -oh /u01/app/12.2.0/grid

System initialization log file is /u01/app/12.2.0/grid/cfgtoollogs/opatchautodb/systemconfig2022-05-13_07-00-50AM.log.

会话日志文件是/u01/app/12.2.0/grid/cfgtoollogs/opatchauto/opatchauto2022-05-13_07-00-54AM.log
此会话的 ID 为 6HE2
[init:init] 正在home /u01/app/12.2.0/grid上执行OPatchAutoBinaryAction操作

Executing OPatch prereq operations to verify patch applicability on SIHA Home........

[init:init] OPatchAutoBinaryAction操作在home /u01/app/12.2.0/grid 成功上已完成
[init:init] 正在home /u01/app/12.2.0/grid上执行SIHAPrereqAction操作

Executing prereq operations before applying on SIHA Home........

[init:init] SIHAPrereqAction操作在home /u01/app/12.2.0/grid 成功上已完成
[shutdown:shutdown] 正在home /u01/app/12.2.0/grid上执行SIHAShutDownAction操作

Performing prepatch operations on SIHA Home........

Prepatch operation log file location: /u01/app/grid/crsdata/ora12c/crsconfig/hapatch_2022-05-13_07-01-16AM.log 

[shutdown:shutdown] SIHAShutDownAction操作在home /u01/app/12.2.0/grid 成功上已完成
[offline:binary-patching] 正在home /u01/app/12.2.0/grid上执行OPatchAutoBinaryAction操作

Start applying binary patches on SIHA Home........

[offline:binary-patching] OPatchAutoBinaryAction操作在home /u01/app/12.2.0/grid 成功上已完成
[startup:startup] 正在home /u01/app/12.2.0/grid上执行SIHAStartupAction操作

Performing postpatch operations on SIHA Home........

Postpatch operation log file location: /u01/app/grid/crsdata/ora12c/crsconfig/hapatch_2022-05-13_07-02-18AM.log 

[startup:startup] SIHAStartupAction操作在home /u01/app/12.2.0/grid 成功上已完成
[finalize:finalize] 正在home /u01/app/12.2.0/grid上执行OracleHomeLSInventoryGrepAction操作

Verifying patches applied on SIHA Home.

[finalize:finalize] OracleHomeLSInventoryGrepAction操作在home /u01/app/12.2.0/grid 成功上已完成
OPatchAuto 成功。

--------------------------------Summary--------------------------------

Patching is completed successfully. Please find the summary as follows:

Host:ora12c
SIHA Home:/u01/app/12.2.0/grid
Summary:

==Following patches were SUCCESSFULLY applied:

Patch: /u01/27006180/27006180
Log: /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-05-13_07-01-41上午_1.log
[root@ora12c ~]# /u01/app/12.2.0/grid/OPatch/opatchauto apply /u01/27006180 -oh /u01/app/oracle/product/12.2.0/db_1

opatchauto must run from one of the homes specified
opatchauto returns with error code = 2
[root@ora12c ~]# /u01/app/oracle/product/12.2.0/db_1/OPatch apply /u01/27006180 -oh /u01/app/oracle/product/12.2.0/db_1
-bash: /u01/app/oracle/product/12.2.0/db_1/OPatch: 是一个目录
[root@ora12c ~]# /u01/app/oracle/product/12.2.0/db_1/OPatch/opatchauto apply /u01/27006180 -oh /u01/app/oracle/product/12.2.0/db_1

System initialization log file is /u01/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatchautodb/systemconfig2022-05-13_07-05-58AM.log.

会话日志文件是/u01/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatchauto/opatchauto2022-05-13_07-06-03AM.log
此会话的 ID 为 I5D5
[init:init] 正在home /u01/app/oracle/product/12.2.0/db_1上执行OPatchAutoBinaryAction操作

Executing OPatch prereq operations to verify patch applicability on SIDB Home........

[init:init] OPatchAutoBinaryAction操作在home /u01/app/oracle/product/12.2.0/db_1 成功上已完成
[init:init] 正在home /u01/app/oracle/product/12.2.0/db_1上执行SIDBPrereqAction操作

Executing prereq operations before applying on SIDB Home........

[init:init] SIDBPrereqAction操作在home /u01/app/oracle/product/12.2.0/db_1 成功上已完成
[shutdown:prepare-shutdown] 正在home /u01/app/oracle/product/12.2.0/db_1上执行SIDBPrepareShutDownAction操作

Preparing SIDB Home to bring down database service........

[shutdown:prepare-shutdown] SIDBPrepareShutDownAction操作在home /u01/app/oracle/product/12.2.0/db_1 成功上已完成
[shutdown:shutdown] 正在home /u01/app/oracle/product/12.2.0/db_1上执行SIDBShutDownAction操作

Stopping the database service on SIDB Home for patching........

Following database is been stopped and will be restarted later during the session: orcl

[shutdown:shutdown] SIDBShutDownAction操作在home /u01/app/oracle/product/12.2.0/db_1 成功上已完成
[offline:binary-patching] 正在home /u01/app/oracle/product/12.2.0/db_1上执行OPatchAutoBinaryAction操作

Start applying binary patches on SIDB Home........

[offline:binary-patching] OPatchAutoBinaryAction操作在home /u01/app/oracle/product/12.2.0/db_1 成功上已完成
[startup:startup] 正在home /u01/app/oracle/product/12.2.0/db_1上执行SIDBStartupAction操作

Starting the database service on SIDB Home........

[startup:startup] SIDBStartupAction操作在home /u01/app/oracle/product/12.2.0/db_1 成功上已完成
[startup:finalize] 正在home /u01/app/oracle/product/12.2.0/db_1上执行SIDBFinalizeStartAction操作

No step execution required.........

[startup:finalize] SIDBFinalizeStartAction操作在home /u01/app/oracle/product/12.2.0/db_1 成功上已完成
[online:product-patching] 正在home /u01/app/oracle/product/12.2.0/db_1上执行SIDBOnlineAction操作

Trying to apply SQL patches on SIDB Home.

[WARNING] The database instance 'orcl' from '/u01/app/oracle/product/12.2.0/db_1', in host'ora12c' is not running. SQL changes, if any,  will not be applied.
To apply. the SQL changes, bring up the database instance and run the command manually from any one node (run as oracle).
Refer to the readme to get the correct steps for applying the sql changes.

[online:product-patching] SIDBOnlineAction操作在home /u01/app/oracle/product/12.2.0/db_1 成功上已完成
[finalize:finalize] 正在home /u01/app/oracle/product/12.2.0/db_1上执行OracleHomeLSInventoryGrepAction操作

Verifying patches applied on SIDB Home.

[finalize:finalize] OracleHomeLSInventoryGrepAction操作在home /u01/app/oracle/product/12.2.0/db_1 成功上已完成
OPatchAuto 成功。

--------------------------------Summary--------------------------------

Patching is completed successfully. Please find the summary as follows:

Host:ora12c
SIDB Home:/u01/app/oracle/product/12.2.0/db_1
Summary:

==Following patches were SUCCESSFULLY applied:

Patch: /u01/27006180/27006180
Log: /u01/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2022-05-13_07-06-49上午_1.log
[root@ora12c ~]# su - grid
上一次登录:五 5月 13 07:03:45 CST 2022
[grid@ora12c:/home/grid]$crsctl status res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ARCH.dg
               ONLINE  ONLINE       ora12c                   STABLE
ora.DATA.dg
               ONLINE  ONLINE       ora12c                   STABLE
ora.DGSYSTEM.dg
               ONLINE  ONLINE       ora12c                   STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       ora12c                   STABLE
ora.asm
               ONLINE  ONLINE       ora12c                   Started,STABLE
ora.ons
               OFFLINE OFFLINE      ora12c                   STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       ora12c                   STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.driver.afd
      1        ONLINE  ONLINE       ora12c                   STABLE
ora.evmd
      1        ONLINE  ONLINE       ora12c                   STABLE
ora.orcl.db
      1        ONLINE  ONLINE       ora12c                   Open,HOME=/u01/app/o
                                                             racle/product/12.2.0
                                                             /db_1,STABLE
--------------------------------------------------------------------------------

五、12C安装28553832补丁

1、opatch版本大于12.2.0.1.5满足
2、OCM配置 忽略
3、Oracle Inventory 的验证
[oracle@ora12c:/u01/app/oracle/product/12.2.0/db_1/OPatch]$.//opatch lsinventory -oh $ORACLE_HOME
Oracle Interim Patch Installer version 12.2.0.1.6
Copyright (c) 2022, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/12.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/12.2.0/db_1/oraInst.loc
OPatch version    : 12.2.0.1.6
OUI version       : 12.2.0.1.4
Log file location : /u01/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatch/opatch2022-05-13_07-21-42AM_1.log

Lsinventory Output file location : /u01/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2022-05-13_07-21-42AM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: ora12c
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1): 

Oracle Database 12c                                                  12.2.0.1.0
There are 1 products installed in this Oracle Home.


Interim patches (1) :

Patch  27006180     : applied on Fri May 13 07:07:14 CST 2022
Unique Patch ID:  21761216
Patch description:  "OCW Interim patch for 27006180"
   Created on 30 Nov 2017, 08:08:31 hrs PST8PDT
   Bugs fixed:
     27006180, 26144044, 25541343, 25715179, 25493588, 24932026, 24801915
     25832375, 25728787, 25825732, 24578464, 25832312, 25742471, 25790699
     25655495, 25307145, 25485737, 25505841, 25697364, 24663993, 25026470
     25591658, 25537905, 24451580, 25409838, 25371632, 25569634, 25245759
     24665035, 25646592, 25025157, 24732650, 24664849, 24584419, 24423011
     24831158, 25037836, 25556203, 24464953, 24657753, 25197670, 24796183
     20559126, 25197395, 24808260, 26546632, 24792446, 25774482, 26529142
     26379711, 26248428, 25865563, 25408895, 25667162, 26301456, 26238801
     25801922, 25216003, 25825755, 25233797, 25164540, 25049033, 24824518
     24509984, 24462646, 24422155, 23762756, 25851874, 25518447, 24953946
     13250991, 22999793, 24670214, 24583356, 22986384, 25784424, 25301463
     25448476, 24403376, 23722215, 23340259, 25564644, 26198627, 25785073
     24445255, 26088770



--------------------------------------------------------------------------------

OPatch succeeded.
[oracle@ora12c:/u01/app/oracle/product/12.2.0/db_1/OPatch]$exit
logout
[root@ora12c ~]# su - grid
上一次登录:五 5月 13 07:16:22 CST 2022pts/0 上
[grid@ora12c:/home/grid]$cd $ORACLE_HOME
[grid@ora12c:/u01/app/12.2.0/grid]$cd OPatch/
[grid@ora12c:/u01/app/12.2.0/grid/OPatch]$./opatch lsinventory -oh $ORACLE_HOME
Oracle Interim Patch Installer version 12.2.0.1.6
Copyright (c) 2022, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/12.2.0/grid
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/12.2.0/grid/oraInst.loc
OPatch version    : 12.2.0.1.6
OUI version       : 12.2.0.1.4
Log file location : /u01/app/12.2.0/grid/cfgtoollogs/opatch/opatch2022-05-13_07-22-39AM_1.log

Lsinventory Output file location : /u01/app/12.2.0/grid/cfgtoollogs/opatch/lsinv/lsinventory2022-05-13_07-22-39AM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: ora12c
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1): 

Oracle Grid Infrastructure 12c                                       12.2.0.1.0
There are 1 products installed in this Oracle Home.


Interim patches (1) :

Patch  27006180     : applied on Fri May 13 07:02:13 CST 2022
Unique Patch ID:  21761216
Patch description:  "OCW Interim patch for 27006180"
   Created on 30 Nov 2017, 08:08:31 hrs PST8PDT
   Bugs fixed:
     27006180, 26144044, 25541343, 25715179, 25493588, 24932026, 24801915
     25832375, 25728787, 25825732, 24578464, 25832312, 25742471, 25790699
     25655495, 25307145, 25485737, 25505841, 25697364, 24663993, 25026470
     25591658, 25537905, 24451580, 25409838, 25371632, 25569634, 25245759
     24665035, 25646592, 25025157, 24732650, 24664849, 24584419, 24423011
     24831158, 25037836, 25556203, 24464953, 24657753, 25197670, 24796183
     20559126, 25197395, 24808260, 26546632, 24792446, 25774482, 26529142
     26379711, 26248428, 25865563, 25408895, 25667162, 26301456, 26238801
     25801922, 25216003, 25825755, 25233797, 25164540, 25049033, 24824518
     24509984, 24462646, 24422155, 23762756, 25851874, 25518447, 24953946
     13250991, 22999793, 24670214, 24583356, 22986384, 25784424, 25301463
     25448476, 24403376, 23722215, 23340259, 25564644, 26198627, 25785073
     24445255, 26088770



--------------------------------------------------------------------------------

OPatch succeeded.
4、解压
[grid@ora12c:/u01]$unzip p28553832_12201180417OCWApr2018RU_Linux-x86-64.zip 
[grid@ora12c:/u01]$ls
27006180  app       linuxx64_12201_database.zip   p27006180_12201171003OCWRU_Linux-x86-64.zip
28553832  database  
5、一次性补丁冲突检测与解决
[root@ora12c 28553832]# /u01/app/12.2.0/grid/OPatch/opatchauto apply /u01/28553832  -analyze;
opatchauto must run from one of the homes specified
opatchauto returns with error code = 2
--什么鬼,换个终端
[root@ora12c ~]# /u01/app/12.2.0/grid/OPatch/opatchauto apply /u01/28553832  -analyze;

System initialization log file is /u01/app/12.2.0/grid/cfgtoollogs/opatchautodb/systemconfig2022-05-13_07-30-59AM.log.

会话日志文件是/u01/app/12.2.0/grid/cfgtoollogs/opatchauto/opatchauto2022-05-13_07-31-04AM.log
此会话的 ID 为 C95K
[init:init] 正在home /u01/app/oracle/product/12.2.0/db_1上执行OPatchAutoBinaryAction操作

Executing OPatch prereq operations to verify patch applicability on SIDB Home........

[init:init] OPatchAutoBinaryAction操作在home /u01/app/oracle/product/12.2.0/db_1 成功上已完成
[init:init] 正在home /u01/app/oracle/product/12.2.0/db_1上执行SIDBPrereqAction操作

Executing prereq operations before applying on SIDB Home........

[init:init] SIDBPrereqAction操作在home /u01/app/oracle/product/12.2.0/db_1 成功上已完成
[init:init] 正在home /u01/app/12.2.0/grid上执行OPatchAutoBinaryAction操作

Executing OPatch prereq operations to verify patch applicability on SIHA Home........

[init:init] OPatchAutoBinaryAction操作在home /u01/app/12.2.0/grid 成功上已完成
[init:init] 正在home /u01/app/12.2.0/grid上执行SIHAPrereqAction操作

Executing prereq operations before applying on SIHA Home........

[init:init] SIHAPrereqAction操作在home /u01/app/12.2.0/grid 成功上已完成
OPatchAuto 成功。

--------------------------------Summary--------------------------------

Analysis for applying patches has completed successfully:

Host:ora12c
SIDB Home:/u01/app/oracle/product/12.2.0/db_1


==Following patches were SUCCESSFULLY analyzed to be applied:

Patch: /u01/28553832/28553832
Log: /u01/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2022-05-13_07-31-10上午_1.log


Host:ora12c
SIHA Home:/u01/app/12.2.0/grid


==Following patches were SUCCESSFULLY analyzed to be applied:

Patch: /u01/28553832/28553832
Log: /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-05-13_07-31-31上午_1.log
6、应用
[root@ora12c ~]# /u01/app/oracle/product/12.2.0/db_1/OPatch/opatchauto apply /u01/28553832  -analyze; -oh /u01/app/oracle/product/12.2.0/db_1

opatchauto must run from Grid Home with current arguments. Please retry it inside Grid Home
opatchauto returns with error code = 2
bash: -oh: 未找到命令...
[root@ora12c ~]# /u01/app/12.2.0/grid/OPatch/opatchauto apply /u01/28553832 -oh /u01/app/12.2.0/grid

System initialization log file is /u01/app/12.2.0/grid/cfgtoollogs/opatchautodb/systemconfig2022-05-13_07-57-23AM.log.

会话日志文件是/u01/app/12.2.0/grid/cfgtoollogs/opatchauto/opatchauto2022-05-13_07-57-26AM.log
此会话的 ID 为 EMAA
[init:init] 正在home /u01/app/12.2.0/grid上执行OPatchAutoBinaryAction操作

Executing OPatch prereq operations to verify patch applicability on SIHA Home........

[init:init] OPatchAutoBinaryAction操作在home /u01/app/12.2.0/grid 成功上已完成
[init:init] 正在home /u01/app/12.2.0/grid上执行SIHAPrereqAction操作

Executing prereq operations before applying on SIHA Home........

[init:init] SIHAPrereqAction操作在home /u01/app/12.2.0/grid 成功上已完成
[shutdown:shutdown] 正在home /u01/app/12.2.0/grid上执行SIHAShutDownAction操作

Performing prepatch operations on SIHA Home........

Prepatch operation log file location: /u01/app/grid/crsdata/ora12c/crsconfig/hapatch_2022-05-13_07-57-49AM.log 

[shutdown:shutdown] SIHAShutDownAction操作在home /u01/app/12.2.0/grid 成功上已完成
[offline:binary-patching] 正在home /u01/app/12.2.0/grid上执行OPatchAutoBinaryAction操作

Start applying binary patches on SIHA Home........

[offline:binary-patching] OPatchAutoBinaryAction操作在home /u01/app/12.2.0/grid 成功上已完成
[startup:startup] 正在home /u01/app/12.2.0/grid上执行SIHAStartupAction操作

Performing postpatch operations on SIHA Home........

Postpatch operation log file location: /u01/app/grid/crsdata/ora12c/crsconfig/hapatch_2022-05-13_07-58-54AM.log 

[startup:startup] SIHAStartupAction操作在home /u01/app/12.2.0/grid 成功上已完成
[finalize:finalize] 正在home /u01/app/12.2.0/grid上执行OracleHomeLSInventoryGrepAction操作

Verifying patches applied on SIHA Home.

[finalize:finalize] OracleHomeLSInventoryGrepAction操作在home /u01/app/12.2.0/grid 成功上已完成
OPatchAuto 成功。

--------------------------------Summary--------------------------------

Patching is completed successfully. Please find the summary as follows:

Host:ora12c
SIHA Home:/u01/app/12.2.0/grid
Summary:

==Following patches were SUCCESSFULLY applied:

Patch: /u01/28553832/28553832
Log: /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-05-13_07-58-11上午_1.log
[root@ora12c ~]# /u01/app/oracle/product/12.2.0/db_1/OPatch/opatchauto apply /u01/28553832  -oh /u01/app/oracle/product/12.2.0/db_1

System initialization log file is /u01/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatchautodb/systemconfig2022-05-13_07-40-33AM.log.

会话日志文件是/u01/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatchauto/opatchauto2022-05-13_07-40-37AM.log
此会话的 ID 为 PQ9F
[init:init] 正在home /u01/app/oracle/product/12.2.0/db_1上执行OPatchAutoBinaryAction操作

Executing OPatch prereq operations to verify patch applicability on SIDB Home........

[init:init] OPatchAutoBinaryAction操作在home /u01/app/oracle/product/12.2.0/db_1 成功上已完成
[init:init] 正在home /u01/app/oracle/product/12.2.0/db_1上执行SIDBPrereqAction操作

Executing prereq operations before applying on SIDB Home........

[init:init] SIDBPrereqAction操作在home /u01/app/oracle/product/12.2.0/db_1 成功上已完成
[shutdown:prepare-shutdown] 正在home /u01/app/oracle/product/12.2.0/db_1上执行SIDBPrepareShutDownAction操作

Preparing SIDB Home to bring down database service........

[shutdown:prepare-shutdown] SIDBPrepareShutDownAction操作在home /u01/app/oracle/product/12.2.0/db_1 成功上已完成
[shutdown:shutdown] 正在home /u01/app/oracle/product/12.2.0/db_1上执行SIDBShutDownAction操作

Stopping the database service on SIDB Home for patching........

Following database is been stopped and will be restarted later during the session: orcl

[shutdown:shutdown] SIDBShutDownAction操作在home /u01/app/oracle/product/12.2.0/db_1 成功上已完成
[offline:binary-patching] 正在home /u01/app/oracle/product/12.2.0/db_1上执行OPatchAutoBinaryAction操作

Start applying binary patches on SIDB Home........

[offline:binary-patching] OPatchAutoBinaryAction操作在home /u01/app/oracle/product/12.2.0/db_1 成功上已完成
[startup:startup] 正在home /u01/app/oracle/product/12.2.0/db_1上执行SIDBStartupAction操作

Starting the database service on SIDB Home........

[startup:startup] SIDBStartupAction操作在home /u01/app/oracle/product/12.2.0/db_1 成功上已完成
[startup:finalize] 正在home /u01/app/oracle/product/12.2.0/db_1上执行SIDBFinalizeStartAction操作

No step execution required.........

[startup:finalize] SIDBFinalizeStartAction操作在home /u01/app/oracle/product/12.2.0/db_1 成功上已完成
[online:product-patching] 正在home /u01/app/oracle/product/12.2.0/db_1上执行SIDBOnlineAction操作

Trying to apply SQL patches on SIDB Home.

[WARNING] The database instance 'orcl' from '/u01/app/oracle/product/12.2.0/db_1', in host'ora12c' is not running. SQL changes, if any,  will not be applied.
To apply. the SQL changes, bring up the database instance and run the command manually from any one node (run as oracle).
Refer to the readme to get the correct steps for applying the sql changes.

[online:product-patching] SIDBOnlineAction操作在home /u01/app/oracle/product/12.2.0/db_1 成功上已完成
[finalize:finalize] 正在home /u01/app/oracle/product/12.2.0/db_1上执行OracleHomeLSInventoryGrepAction操作

Verifying patches applied on SIDB Home.

[finalize:finalize] OracleHomeLSInventoryGrepAction操作在home /u01/app/oracle/product/12.2.0/db_1 成功上已完成
OPatchAuto 成功。

--------------------------------Summary--------------------------------

Patching is completed successfully. Please find the summary as follows:

Host:ora12c
SIDB Home:/u01/app/oracle/product/12.2.0/db_1
Summary:

==Following patches were SUCCESSFULLY applied:

Patch: /u01/28553832/28553832
Log: /u01/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2022-05-13_07-41-22上午_1.log

六、继续升级

1、安装

0

1652616063136

0

0

1652616149532

很奇怪,检查$ORALCE_HOME/gpnp/ora12c/profiles/peer下并没有任何文件。忽略得了。

0

2、执行脚本
[root@ora12c ~]# /u03/app/19.0.0/grid/rootupgrade.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME=  /u03/app/19.0.0/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]:
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]:
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u03/app/19.0.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
/u03/app/grid/crsdata/ora12c/crsconfig/roothas_2022-05-13_08-30-53AM.log
2022/05/13 08:30:54 CLSRSC-595: Executing upgrade step 1 of 12: 'UpgPrechecks'.
2022/05/13 08:30:56 CLSRSC-363: User ignored prerequisites during installation
2022/05/13 08:30:57 CLSRSC-595: Executing upgrade step 2 of 12: 'GetOldConfig'.
2022/05/13 08:31:00 CLSRSC-595: Executing upgrade step 3 of 12: 'GenSiteGUIDs'.
2022/05/13 08:31:00 CLSRSC-595: Executing upgrade step 4 of 12: 'SetupOSD'.
2022/05/13 08:31:00 CLSRSC-595: Executing upgrade step 5 of 12: 'PreUpgrade'.
已成功升级并启动 ASM。
2022/05/13 08:31:41 CLSRSC-595: Executing upgrade step 6 of 12: 'UpgradeAFD'.
2022/05/13 08:32:28 CLSRSC-595: Executing upgrade step 7 of 12: 'UpgradeOLR'.
clscfg: EXISTING configuration version 0 detected.
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
2022/05/13 08:32:32 CLSRSC-595: Executing upgrade step 8 of 12: 'UpgradeOCR'.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node ora12c successfully pinned.
2022/05/13 08:32:34 CLSRSC-595: Executing upgrade step 9 of 12: 'CreateOHASD'.
2022/05/13 08:32:35 CLSRSC-595: Executing upgrade step 10 of 12: 'ConfigOHASD'.
2022/05/13 08:32:36 CLSRSC-329: Replacing Clusterware entries in file 'oracle-ohasd.service'
2022/05/13 08:33:21 CLSRSC-595: Executing upgrade step 11 of 12: 'UpgradeSIHA'.
ora12c     2022/05/13 08:34:31     /u03/app/grid/crsdata/ora12c/olr/backup_20220513_083431.olr     724960844
2022/05/13 08:34:31 CLSRSC-595: Executing upgrade step 12 of 12: 'InstallACFS'.
2022/05/13 08:36:30 CLSRSC-327: Successfully configured Oracle Restart for a standalone server
3、测试
[grid@ora12c:/home/grid]$sqlplus / as sysasm
SQL*Plus: Release 12.2.0.1.0 Production on Fri May 13 08:42:45 2022
Copyright (c) 1982, 2016, Oracle.  All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
SQL> exi
SP2-0042: unknown command "exi" - rest of line ignored.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
[grid@ora12c:/home/grid]$asmcmd lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304     51200    50464                0           50464              0             N  ARCH/
MOUNTED  NORMAL  N         512             512   4096  4194304     61440    57000            20480           18260              0             N  DATA/
MOUNTED  HIGH    N         512             512   4096  4194304     25600    25312            10240            5024              0             N  DGSYSTEM/
4、用19c数据库试试

1652616542981

0

[ora19c@ora12c bin]$ export ORACLE_SID=orcl19c
[ora19c@ora12c bin]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Fri May 13 09:15:12 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> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

七、数据库升级

1、安装数据库软件
[oracle@ora12c:/home/oracle]$mkdir -p /u01/app/oracle/product/19.0.0/db_1
[oracle@ora12c:/u03]$unzip LINUX.X64_193000_db_home.zip -d $ORACLE_HOME
[oracle@ora12c:/u03]$vncserver
Warning: ora12c:1 is taken because of /tmp/.X11-unix/X1
Remove this file if there is no X server ora12c:1
Warning: ora12c:2 is taken because of /tmp/.X11-unix/X2
Remove this file if there is no X server ora12c:2
New 'ora12c:5 (oracle)' desktop is ora12c:5
Starting applications specified in /home/oracle/.vnc/xstartup
Log file is /home/oracle/.vnc/ora12c:5.log

0

0

0

0

1652616758328

0

1652616790255

0

2、执行脚本
[oracle@ora12c:/u01/app/oracle/product/12.2.0/db_1/jdk/bin]$/u01/app/oracle/product/12.2.0/db_1/jdk/bin/java -jar /u01/app/oracle/product/19.0.0/db_1/rdbms/admin/preupgrade.jar
ERROR - Unable to run preupgrade due to:
select open_mode from v$database
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0
[oracle@ora12c:/u01/app/oracle/product/12.2.0/db_1/jdk/bin]$sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Fri May 13 10:01:02 2022
Copyright (c) 1982, 2016, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started
Total System Global Area 2466250752 bytes
Fixed Size                  8623688 bytes
Variable Size             671091128 bytes
Database Buffers         1778384896 bytes
Redo Buffers                8151040 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@ora12c:/u01/app/oracle/product/12.2.0/db_1/jdk/bin]$/u01/app/oracle/product/12.2.0/db_1/jdk/bin/java -jar /u01/app/oracle/product/19.0.0/db_1/rdbms/admin/preupgrade.jar
PREUPGRADE SUMMARY
/u01/app/oracle/cfgtoollogs/orcl/preupgrade/preupgrade.log
/u01/app/oracle/cfgtoollogs/orcl/preupgrade/preupgrade_fixups.sql
/u01/app/oracle/cfgtoollogs/orcl/preupgrade/postupgrade_fixups.sql
Execute fixup scripts as indicated below:
Before upgrade:
Log into the database and execute the preupgrade fixups
@/u01/app/oracle/cfgtoollogs/orcl/preupgrade/preupgrade_fixups.sql
After the upgrade:
Log into the database and execute the postupgrade fixups
@/u01/app/oracle/cfgtoollogs/orcl/preupgrade/postupgrade_fixups.sql
Preupgrade complete: 2022-05-13T10:01:34

[oracle@ora12c:/u01/app/oracle/product/12.2.0/db_1/jdk/bin]$sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Fri May 13 10:02:34 2022
Copyright (c) 1982, 2016, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> @/u01/app/oracle/cfgtoollogs/orcl/preupgrade/preupgrade_fixups.sql
Executing Oracle PRE-Upgrade Fixup Script
Auto-Generated by:       Oracle Preupgrade Script
Version: 19.0.0.0.0 Build: 1
Generated on:            2022-05-13 10:01:31
For Source Database:     ORCL
Source Database Version: 12.2.0.1.0
For Upgrade to Version:  19.0.0.0.0
Preup                             Preupgrade
Action                            Issue Is
Number  Preupgrade Check Name     Remedied    Further DBA Action
1.  dictionary_stats          YES         None.
2.  pre_fixed_objects         YES         None.
3.  tablespaces_info          NO          Informational only.
                                          Further action is optional.
4.  rman_recovery_version     NO          Informational only.
                                          Further action is optional.
                                          The fixup scripts have been run and resolved what they can. However,
there are still issues originally identified by the preupgrade that
have not been remedied and are still present in the database.
Depending on the severity of the specific issue, and the nature of
the issue itself, that could mean that your database is not ready
for upgrade.  To resolve the outstanding issues, start by reviewing
the preupgrade_fixups.sql and searching it for the name of
the failed CHECK NAME or Preupgrade Action Number listed above.
There you will find the original corresponding diagnostic message
from the preupgrade which explains in more detail what still needs
to be done.
PL/SQL procedure successfully completed.
TIMESTAMP
COMP_TIMESTAMP UTLRP_BGN              2022-05-13 10:07:22
DOC>   The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC>   objects in the database. Recompilation time is proportional to the
DOC>   number of invalid objects in the database, so this command may take
DOC>   a long time to execute on a database with a large number of invalid
DOC>   objects.
DOC>
DOC>   Use the following queries to track recompilation progress:
DOC>
DOC>   1. Query returning the number of invalid objects remaining. This
DOC>      number should decrease with time.
DOC>         SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);

SQL> SQL> select count(*) from dba_objects where status='INVALID';
     1
SQL> select substr(comp_name,1,40) comp_name, status, substr(version,1,10) version from dba_registry order by comp_name;
COMP_NAME                      STATUS                         VERSION
--------------------------------------------------------------------------------
JServer JAVA Virtual Machine   VALID                          12.2.0.1.0
OLAP Analytic Workspace        VALID                          12.2.0.1.0
Oracle Database Catalog Views  VALID                          12.2.0.1.0
Oracle Database Java Packages  VALID                          12.2.0.1.0
Oracle Database Packages and T VALID                          12.2.0.1.0
ypes
Oracle Database Vault          VALID                          12.2.0.1.0
Oracle Label Security          VALID                          12.2.0.1.0
Oracle Multimedia              VALID                          12.2.0.1.0
Oracle OLAP API                VALID                          12.2.0.1.0
Oracle Real Application Cluste OPTION OFF                     12.2.0.1.0
rs
Oracle Text                    VALID                          12.2.0.1.0
Oracle Workspace Manager       VALID                          12.2.0.1.0
Oracle XDK                     VALID                          12.2.0.1.0
Oracle XML Database            VALID                          12.2.0.1.0
Spatial                        VALID                          12.2.0.1.0
15 rows selected.
SQL>  select * from v$timezone_file;
FILENAME                                    VERSION     CON_ID
--------------------------------------------------------------------------------
timezlrg_26.dat                                  26          0

SQL> SELECT * FROM v$backup WHERE status != 'NOT ACTIVE';
no rows selected

SQL> SELECT * FROM v$recover_file;
no rows selected

SQL> alter system set db_recovery_file_dest='+arch' scope=both;
System altered.
SQL> alter system set db_recovery_file_dest_size=20G scope=both;
System altered.

[oracle@ora12c:/u01/app/oracle/product/19.0.0/db_1]$export ORACLE_HOME=/u01/app/oracle/product/19.0.0/db_1
[oracle@ora12c:/u01/app/oracle/product/19.0.0/db_1]$cd $ORACLE_HOME/bin

3、dbua
[oracle@ora12c:/u01/app/oracle/product/19.0.0/db_1]$./dbua

0

0

0

1652617102666

0

1652617139349

1652617178671

0

4、执行脚本
[oracle@ora12c:/u01/app/oracle/product/12.2.0/db_1/jdk/bin]$sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Fri May 13 10:02:34 2022
Copyright (c) 1982, 2016, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> @/u01/app/oracle/cfgtoollogs/orcl/preupgrade/postupgrade_fixups.sql
最后修改时间:2022-05-16 09:28:22
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论