把GI从11gR2升级到12cR1(12.1.0.2)很顺利。相对12.1.0.1来说,在12.1.0.2中GIMR(Grid Infrastructure Management Repository )是必选的,她作为单实例CDB运行在RAC中的其中一个节点,她保存了集群运行的一些监控数据,存放在OCR对应的磁盘组中,升级时该磁盘组至少需要4.5G的空间。
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management and Advanced Analytics options
SQL> select cdb,name from gv$database;
CDB NAME
--- ---------
YES _MGMTDB
SQL>
本文升级的环境为11.2.0.4升级到12.1.0.2,包含了主库两节点的RAC和备库两节点的RAC,主备库升级方式一样。
rootupgrade.sh
[root@ohs1 ~]# /pgold/orgrid/oracle/product/121/rootupgrade.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= orgrid
ORACLE_HOME= /pgold/orgrid/oracle/product/121
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying coraenv to /usr/local/bin ...
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: /pgold/orgrid/oracle/product/121/crs/install/crsconfig_params
2016/12/01 11:32:21 CLSRSC-4015: Performing install or upgrade action for Oracle Trace File Analyzer (TFA) Collector.
2016/12/01 11:32:55 CLSRSC-4003: Successfully patched Oracle Trace File Analyzer (TFA) Collector.
2016/12/01 11:32:58 CLSRSC-464: Starting retrieval of the cluster configuration data
2016/12/01 11:33:06 CLSRSC-465: Retrieval of the cluster configuration data has successfully completed.
2016/12/01 11:33:06 CLSRSC-363: User ignored prerequisites during installation
2016/12/01 11:33:17 CLSRSC-515: Starting OCR manual backup.
2016/12/01 11:33:19 CLSRSC-516: OCR manual backup successful.
2016/12/01 11:33:23 CLSRSC-468: Setting Oracle Clusterware and ASM to rolling migration mode
2016/12/01 11:33:23 CLSRSC-482: Running command: '/pgold/orgrid/oracle/product/121/bin/asmca -silent -upgradeNodeASM -nonRolling false -oldCRSHome /pgold/orgrid/oracle/product/112 -oldCRSVersion 11.2.0.4.0 -nodeNumber 1 -firstNode true -startRolling true'
ASM configuration upgraded in local node successfully.
2016/12/01 11:33:31 CLSRSC-469: Successfully set Oracle Clusterware and ASM to rolling migration mode
2016/12/01 11:33:31 CLSRSC-466: Starting shutdown of the current Oracle Grid Infrastructure stack
2016/12/01 11:34:14 CLSRSC-467: Shutdown of the current Oracle Grid Infrastructure stack has successfully completed.
OLR initialization - successful
2016/12/01 11:36:54 CLSRSC-329: Replacing Clusterware entries in file 'oracle-ohasd.conf'
CRS-4133: Oracle High Availability Services has been stopped.
CRS-4123: Oracle High Availability Services has been started.
2016/12/01 11:39:41 CLSRSC-472: Attempting to export the OCR
2016/12/01 11:39:41 CLSRSC-482: Running command: 'ocrconfig -upgrade orgrid oinstall'
2016/12/01 11:39:48 CLSRSC-473: Successfully exported the OCR
2016/12/01 11:39:54 CLSRSC-486:
At this stage of upgrade, the OCR has changed.
Any attempt to downgrade the cluster after this point will require a complete cluster outage to restore the OCR.
2016/12/01 11:39:54 CLSRSC-541:
To downgrade the cluster:
1. All nodes that have been upgraded must be downgraded.
2016/12/01 11:39:54 CLSRSC-542:
2. Before downgrading the last node, the Grid Infrastructure stack on all other cluster nodes must be down.
2016/12/01 11:39:54 CLSRSC-543:
3. The downgrade command must be run on the node ohs1 with the '-lastnode' option to restore global configuration data.
2016/12/01 11:40:20 CLSRSC-343: Successfully started Oracle Clusterware stack
clscfg: EXISTING configuration version 5 detected.
clscfg: version 5 is 11g Release 2.
Successfully taken the backup of node specific configuration in OCR.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
2016/12/01 11:40:40 CLSRSC-474: Initiating upgrade of resource types
2016/12/01 11:40:57 CLSRSC-482: Running command: 'upgrade model -s 11.2.0.4.0 -d 12.1.0.2.0 -p first'
2016/12/01 11:40:57 CLSRSC-475: Upgrade of resource types successfully initiated.
2016/12/01 11:41:02 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded
[root@ohs1 ~]#
注意:升级过程中cluster和数据库相关服务会关闭,然后从新的GI_HOME下启动,升级过程中会自动备份OCR。
升级后查看
[orgrid@ohs1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA_PROD.dg
ONLINE ONLINE ohs1 STABLE
ONLINE ONLINE ohs2 STABLE
ora.FRA_PROD.dg
ONLINE ONLINE ohs1 STABLE
ONLINE ONLINE ohs2 STABLE
ora.LISTENER.lsnr
ONLINE ONLINE ohs1 STABLE
ONLINE ONLINE ohs2 STABLE
ora.SYSTEMDG.dg
ONLINE ONLINE ohs1 STABLE
ONLINE ONLINE ohs2 STABLE
ora.asm
ONLINE ONLINE ohs1 Started,STABLE
ONLINE ONLINE ohs2 Started,STABLE
ora.net1.network
ONLINE ONLINE ohs1 STABLE
ONLINE ONLINE ohs2 STABLE
ora.ons
ONLINE ONLINE ohs1 STABLE
ONLINE ONLINE ohs2 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE ohs2 STABLE
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE ohs1 STABLE
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE ohs1 STABLE
ora.MGMTLSNR
1 ONLINE ONLINE ohs1 169.254.237.80 172.1
6.0.21,STABLE
ora.cvu
1 ONLINE ONLINE ohs2 STABLE
ora.mgmtdb
1 ONLINE ONLINE ohs1 Open,STABLE
ora.oc4j
1 ONLINE ONLINE ohs2 STABLE
ora.ohs1.vip
1 ONLINE ONLINE ohs1 STABLE
ora.ohs2.vip
1 ONLINE ONLINE ohs2 STABLE
ora.prod.db
1 ONLINE ONLINE ohs1 Open,STABLE
2 ONLINE ONLINE ohs2 Open,STABLE
ora.scan1.vip
1 ONLINE ONLINE ohs2 STABLE
ora.scan2.vip
1 ONLINE ONLINE ohs1 STABLE
ora.scan3.vip
1 ONLINE ONLINE ohs1 STABLE
--------------------------------------------------------------------------------
[orgrid@ohs1 ~]$
Reference
http://docs.oracle.com/database/121/CWLIN/procstop.htm#CWLIN10001
