- 查看当前版本
Crs
[grid@rac1 ~]$ crsctl query crs activeversion
Oracle Clusterware active version on the cluster is [12.1.0.1.0]
[grid@rac1 ~]$ crsctl query crs releaseversion
Oracle High Availability Services release version on the local node is [12.1.0.1.0]
[grid@rac1 ~]$ crsctl query crs softwareversion
Oracle Clusterware version on node [rac1] is [12.1.0.1.0]
Db
SQL> select BANNER from v$version;
BANNER
-----------------------------------------------------------------------------------------------------
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
PL/SQL Release 12.1.0.1.0 - Production
CORE 12.1.0.1.0 Production
TNS for Linux: Version 12.1.0.1.0 – Production
NLSRTL Version 12.1.0.1.0 - Production
- 升级前准备
SQL> @?/rdbms/admin/preupgrd.sql
Loading Pre-Upgrade Package...
Executing Pre-Upgrade Checks...
Pre-Upgrade Checks Complete.
************************************************************
Results of the checks are located at:
/u01/app/oracle/cfgtoollogs/rac12c/preupgrade/preupgrade.log
Pre-Upgrade Fixup Script (run in source database environment):
/u01/app/oracle/cfgtoollogs/rac12c/preupgrade/preupgrade_fixups.sql
Post-Upgrade Fixup Script (run shortly after upgrade):
/u01/app/oracle/cfgtoollogs/rac12c/preupgrade/postupgrade_fixups.sql
***********************************************************
Fixup scripts must be reviewed prior to being executed.
************************************************************
************************************************************
====>> USER ACTION REQUIRED <<====
************************************************************
The following are *** ERROR LEVEL CONDITIONS *** that must be addressed
prior to attempting your upgrade.
Failure to do so will result in a failed upgrade.
1) Check Tag: OLS_SYS_MOVE
Check Summary: Check if SYSTEM.AUD$ needs to move to SYS.AUD$ before upgrade
Fixup Summary:
"Execute olspreupgrade.sql script prior to upgrade."
+++ Source Database Manual Action Required +++
You MUST resolve the above error prior to upgrade
************************************************************
执行以上提示的修复脚本,查看日志
SQL>@/u01/app/oracle/cfgtoollogs/rac12c/preupgrade/preupgrade_fixups.sql
SQL>@?/rdbms/admin/olspreupgrade.sql
[oracle@rac1 ~]$ cat /u01/app/oracle/cfgtoollogs/rac12c/preupgrade/preupgrade.log
- 升级Cluster
分别在两个节点创建升级用的目录
[root@rac1 ~]# mkdir –p /u01/12.1.0.2/grid
[root@rac1 ~]# chmod 775 -R /u01/12.1.0.2/grid
[root@rac1 ~]# chown grid:oinstall –R /u01/12.1.0.2/grid
上传介质,并解压
[root@rac1 software]# unzip linuxamd64_12102_grid_1of2.zip
[root@rac1 software]# unzip linuxamd64_12102_grid_2of2.zip
[root@rac1 software # chmod 777 –R grid/
[root@rac1 software]# su - grid
[grid@rac1 ~]$ export DISPLAY=192.168.24.23:0.0
[grid@rac1 ~]$ cd /u01/software/grid
[grid@rac1 grid]$ ./runInstaller
写成升级后的软件目录
- 运行脚本
[root@rac1 12.1.0.2]# /u01/12.1.0.2/grid/rootupgrade.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/12.1.0.2/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]: y
Copying oraenv to /usr/local/bin ...
The contents of "coraenv" have not changed. No need to overwrite.
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: /u01/12.1.0.2/grid/crs/install/crsconfig_params
2014/08/12 17:13:19 CLSRSC-4015: Performing install or upgrade action for Oracle Trace File Analyzer (TFA) Collector.
2014/08/12 17:13:46 CLSRSC-4003: Successfully patched Oracle Trace File Analyzer (TFA) Collector.
2014/08/12 17:13:52 CLSRSC-464: Starting retrieval of the cluster configuration data
2014/08/12 17:14:01 CLSRSC-465: Retrieval of the cluster configuration data has successfully completed.
2014/08/12 17:14:01 CLSRSC-363: User ignored prerequisites during installation
2014/08/12 17:14:18 CLSRSC-515: Starting OCR manual backup.
2014/08/12 17:14:21 CLSRSC-516: OCR manual backup successful.
2014/08/12 17:14:26 CLSRSC-468: Setting Oracle Clusterware and ASM to rolling migration mode
2014/08/12 17:14:26 CLSRSC-482: Running command: '/u01/12.1.0/grid/bin/crsctl start rollingupgrade 12.1.0.2.0'
CRS-1131: The cluster was successfully set to rolling upgrade mode.
2014/08/12 17:14:31 CLSRSC-482: Running command: '/u01/12.1.0.2/grid/bin/asmca -silent -upgradeNodeASM -nonRolling false -oldCRSHome /u01/12.1.0/grid -oldCRSVersion 12.1.0.1.0 -nodeNumber 1 -firstNode true -startRolling false'
ASM configuration upgraded in local node successfully.
2014/08/12 17:14:36 CLSRSC-469: Successfully set Oracle Clusterware and ASM to rolling migration mode
2014/08/12 17:14:36 CLSRSC-466: Starting shutdown of the current Oracle Grid Infrastructure stack
2014/08/12 17:16:04 CLSRSC-467: Shutdown of the current Oracle Grid Infrastructure stack has successfully completed.
OLR initialization - successful
2014/08/12 17:18:50 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.
2014/08/12 17:23:13 CLSRSC-472: Attempting to export the OCR
2014/08/12 17:23:13 CLSRSC-482: Running command: 'ocrconfig -upgrade grid oinstall'
2014/08/12 17:23:18 CLSRSC-473: Successfully exported the OCR
2014/08/12 17:23:24 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.
2014/08/12 17:23:24 CLSRSC-541:
To downgrade the cluster:
1. All nodes that have been upgraded must be downgraded.
2014/08/12 17:23:24 CLSRSC-542:
2. Before downgrading the last node, the Grid Infrastructure stack on all other cluster nodes must be down.
2014/08/12 17:23:24 CLSRSC-543:
3. The downgrade command must be run on the node rac1 with the '-lastnode' option to restore global configuration data.
2014/08/12 17:23:50 CLSRSC-343: Successfully started Oracle Clusterware stack
clscfg: EXISTING configuration version 5 detected.
clscfg: version 5 is 12c Release 1.
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.
2014/08/12 17:24:06 CLSRSC-474: Initiating upgrade of resource types
2014/08/12 17:24:12 CLSRSC-482: Running command: 'upgrade model -s 12.1.0.1.0 -d 12.1.0.2.0 -p first'
2014/08/12 17:24:12 CLSRSC-475: Upgrade of resource types successfully initiated.
2014/08/12 17:24:19 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded
[root@rac2 12.1.0.2]# /u01/12.1.0.2/grid/rootupgrade.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/12.1.0.2/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]: y
Copying oraenv to /usr/local/bin ...
The contents of "coraenv" have not changed. No need to overwrite.
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: /u01/12.1.0.2/grid/crs/install/crsconfig_params
2014/08/12 17:24:45 CLSRSC-4015: Performing install or upgrade action for Oracle Trace File Analyzer (TFA) Collector.
2014/08/12 17:25:11 CLSRSC-4003: Successfully patched Oracle Trace File Analyzer (TFA) Collector.
2014/08/12 17:25:14 CLSRSC-464: Starting retrieval of the cluster configuration data
2014/08/12 17:25:23 CLSRSC-465: Retrieval of the cluster configuration data has successfully completed.
2014/08/12 17:25:23 CLSRSC-363: User ignored prerequisites during installation
ASM configuration upgraded in local node successfully.
2014/08/12 17:25:38 CLSRSC-466: Starting shutdown of the current Oracle Grid Infrastructure stack
2014/08/12 17:27:01 CLSRSC-467: Shutdown of the current Oracle Grid Infrastructure stack has successfully completed.
OLR initialization - successful
2014/08/12 17:27:27 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.
2014/08/12 17:30:48 CLSRSC-343: Successfully started Oracle Clusterware stack
clscfg: EXISTING configuration version 5 detected.
clscfg: version 5 is 12c Release 1.
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.
2014/08/12 17:30:54 CLSRSC-478: Setting Oracle Clusterware active version on the last node to be upgraded
2014/08/12 17:30:54 CLSRSC-482: Running command: '/u01/12.1.0.2/grid/bin/crsctl set crs activeversion'
Started to upgrade the Oracle Clusterware. This operation may take a few minutes.
Started to upgrade the CSS.
The CSS was successfully upgraded.
Started to upgrade Oracle ASM.
Started to upgrade the CRS.
The CRS was successfully upgraded.
Successfully upgraded the Oracle Clusterware.
Oracle Clusterware operating version was successfully set to 12.1.0.2.0
2014/08/12 17:31:59 CLSRSC-479: Successfully set Oracle Clusterware active version
2014/08/12 17:32:05 CLSRSC-476: Finishing upgrade of resource types
2014/08/12 17:32:12 CLSRSC-482: Running command: 'upgrade model -s 12.1.0.1.0 -d 12.1.0.2.0 -p last'
2014/08/12 17:32:12 CLSRSC-477: Successfully completed upgrade of resource types
PRCN-3004 : Listener MGMTLSNR already exists
2014/08/12 17:32:42 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... Succeeded
- 升级数据库
在两个节点分别创建所需目录
[root@rac1 ~]# mkdir -p /u01/12.1.0.2/oracle
[root@rac1 ~]# chmod 775 –R /u01/12.1.0.2/oracle
[root@rac1 ~]# chown oracle:oinstall –R /u01/12.1.0.2/oracle
上传介质,解压后升级
[root@rac1 ~]# cd /u01/software/
[root@rac1 software]# unzip linuxamd64_12102_database_1of2.zip
[root@rac1 software]# unzip linuxamd64_12102_database_2of2.zip
[root@rac1 software]# cd database/
[root@rac1 database]# export DISPLAY=192.168.24.23:0.0
[root@rac1 database]# ./runInstaller
修改为升级的目录
两个节点分别执行脚本
[root@rac1 ~]# /u01/12.1.0.2/oracle/product/db_1/root.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/12.1.0.2/oracle/product/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
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.
[root@rac2 ~]# /u01/12.1.0.2/oracle/product/db_1/root.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/12.1.0.2/oracle/product/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
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.
- 上述最后一步自动调用DBUA
可以选择升级前后要运行的脚本
配置Express
上述完成后,点Results
升级完关闭窗口,并验证
SQL> select distinct object_name from dba_invalid_objects;
no rows selected
SQL> select banner from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
PL/SQL Release 12.1.0.2.0 - Production
CORE 12.1.0.2.0 Production
TNS for Linux: Version 12.1.0.2.0 - Production
NLSRTL Version 12.1.0.2.0 - Production
SQL> select comp_name,version,status from dba_registry;
COMP_NAME VERSION STATUS
---------------------------------------- ------------------------------ ----------------------
Oracle Database Vault 12.1.0.2.0 VALID
Oracle Application Express 4.2.5.00.08 VALID
Oracle Label Security 12.1.0.2.0 VALID
Spatial 12.1.0.2.0 VALID
Oracle Multimedia 12.1.0.2.0 VALID
Oracle Text 12.1.0.2.0 VALID
Oracle Workspace Manager 12.1.0.2.0 VALID
Oracle XML Database 12.1.0.2.0 VALID
Oracle Database Catalog Views 12.1.0.2.0 VALID
Oracle Database Packages and Types 12.1.0.2.0 VALID
JServer JAVA Virtual Machine 12.1.0.2.0 VALID
Oracle XDK 12.1.0.2.0 VALID
Oracle Database Java Packages 12.1.0.2.0 VALID
OLAP Analytic Workspace 12.1.0.2.0 VALID
Oracle OLAP API 12.1.0.2.0 VALID
Oracle Real Application Clusters 12.1.0.2.0 VALID
写成升级后的软件目录