Bo's Oracle Station

【博客文章2016】Oracle12c RAC和Grid Infrastructure部署系列一:使用保障前台业务0暂停的方式升级Oracle11gR2 MAA到Oracle12c MAA

2016-6-17 15:32| 发布者: admin| 查看: 8354| 评论: 0|原作者: Bo Tang

摘要: 本文介绍:我们已经完成了Oracle MAA 从11.2.0.4滚动升级到12.1.0.2的过程。利用物理Standby->逻辑Standby->物理Standby的转换,整个升级过程中前台业务暂停的时间只有短短的2分钟,几乎可以认定是无影响。

Author: Bo Tang



摘要

本文介绍:Oracle12c RACGrid Infrastructure(简称GI)部署系列一:使用保障前台业务0暂停的方式升级Oracle11gR2 MAAOracle12c MAA。原先打算升级一套11.2.0.4MAA系统到12.1.0.2MAA。实验起点为4台主机加2个盘阵组成的MAA架构,4台主机的操作系统都是Oracle Enterprise Linux 6.8 x8664 uek核:

MAA架构中 station9192.168.0.9)和station10192.168.0.10)运行着两节点RAC主库;station11192.168.0.11)和station12192.168.0.12)运行着两节点RAC物理备库。

之后确信独立发现BUG(见:https://www.botangdb.com/forum.php?mod=viewthread&tid=583&extra=page%3D1)。这个BUG本人猜测是由于192.168.0.9192.168.0.10这两个节点ip不对称导致12c软件调用Perl程序去取字符串时少取一位造成的。使用完全“干净”的环境实验,确证过数十次。经过反复折腾,实验环境不得不重新准备。改成仍升级一套11.2.0.4MAA系统到12.1.0.2MAA。实验起点仍为4台主机加2个盘阵组成的MAA架构,4台主机的操作系统仍都是Oracle Enterprise Linux 6.8 x8664 uek核。 但是IP地址做了更换:

MAA架构中 station11192.168.0.11)和station12192.168.0.12)运行两节点RAC主库,station13192.168.0.13)和station14192.168.0.14)运行两节点RAC物理备库。(由于本实验起点是预装好的11.2.0.4MAA,起点很高。准备环境和更换环境都是非常大的工程。真是幸好所有环境都是由PXE推送器推出来的,非常一致和完全“干净”。)

在升级过程中显然应该先升级GI12c。升级12cGI过程中,由于数据库软件仍然是11.2.0.4MAA架构得以继续保持物理Standby架构。但是请注意所谓“保障前台业务0暂停的方式”是这样的:升级GI过程中是通过Dataguard Switchover技术实现Rolling Patch的。在Rolling Patch过程中,我们只能保证主库时刻都在线,而物理备库(至少其中的一个实例)是会在升级GI过程中多次重启的。实际上升级GI和之后所有的升级活动都是先在备库上进行的,然后通过Dataguard Switchover技术把升级好的备库切成主库,再然后在新备库(原主库)上进行第二批升级活动,最后通过Dataguard Switchover技术切回最初的主库备库关系。

GI升级完成后接下来升级数据库软件,这下难题出现了:如果我们先升级物理备库到12.1.0.2,那么备库(12.1.0.2)和主库(11.2.0.4)的版本就会不一样。大家都知道的基本常识是:物理备库和主库数据库软件版本必需完全一样(这两个库的数据文件都是能互替!)。如果数据库软件版本不一样,基于物理StandbyMAA架构就不复存在了,进而就根本不可能Switchover,再进而就完全不可能进行Rolling Patch。但是又要保障前台业务0暂停,所以我们就不能在升级数据库软件过程中破坏的Dataguard架构。大家知道:Oracle只有两种DataguardA. 物理StandbyB. 逻辑Standby。因此经过以上解释,所有人都会自然得出结论:为了保障前台业务0暂停,在升级数据库前,应该先把原先基于物理StandbyMAA架构转成基于逻辑Standby的。

My Oracle Support Bulletin 949322.1就是这么做的。下面介绍过程。


微信查看请扫:

 

目录

1. 环境概览

1.1 升级前环境概览

1.2 备库升级后环境概览

2. 通过两次Dataguard切换,升级所有GI

2.1 主库Dataguard切换

2.2 原主库(新备库)升级后环境概览

2.3 主库Dataguard切换,原主库(新备库)重新成为主库

3. 通过Transient Logical Standby转换,升级所有DB

3.1 My Oracle Support Bulletin 949322.1综述

3.2 升级前的准备工作

3.2.1 停用Datagurad Broker

3.2.2 确保主库和备库闪回区都存在,并都设置了正确的大小

3.2.3 主库和备库配置闪回数据库

3.2.4 确保升级前,备库进行着健康的Recover Managed Standby Database

3.3 第一次执行physru.sh

3.4 Transient Logical Standby上执行dbua

3.5 第二次执行physru.sh

3.6 手工重配置cluster01以便使用12.1.0.2数据库软件直接打开c01orclmount的状态

3.7 最后一次执行physru.sh

3.8 三次成功执行physru.sh后的善后工作

3.8.1 打开c01orcl的所有实例

3.8.2 打开c02orcl的所有实例

3.8.3 验证在dbua过程中做的两个事务在主备库中都存在

3.8.4 重新启用Datagurad Broker

3.8.5 主备库设置compatible参数为12.1.0.2.0

总结

正文


1. 环境概览

1.1 升级前环境概览

将要升级一套11.2.0.4MAA系统到12.1.0.2。系统是x8664架构,MAA架构中 station11station12运行两节点RAC主库,station13station14运行Data Guard物理备库。

station11

Station12

Station13

station14


[oracle@station11 ~]$ srvctl config database -d c01orcl -v

Database unique name: c01orcl

Database name: c01orcl

Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1

Oracle user: oracle

Spfile: +DATA/c01orcl/spfilec01orcl.ora

Domain: example.com

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools: c01orcl

Database instances: c01orcl1,c01orcl2

Disk Groups: DATA,FRA

Mount point paths:

Services:

Type: RAC

Database is administrator managed

[oracle@station11 ~]$


[oracle@station13 ~]$ srvctl config database -d c02orcl -v

Database unique name: c02orcl

Database name:

Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1

Oracle user: oracle

Spfile:

Domain: example.com

Start options: open

Stop options: immediate

Database role: PHYSICAL_STANDBY

Management policy: AUTOMATIC

Server pools: c02orcl

Database instances: c02orcl1,c02orcl2

Disk Groups: DATA,FRA

Mount point paths:

Services:

Type: RAC

Database is administrator managed

[oracle@station13 ~]$


[oracle@station11 ~]$ dgmgrl

DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production


Copyright (c) 2000, 2009, Oracle. All rights reserved.


Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle_4U@c01orcl

Connected.

DGMGRL> show configuration verbose;


Configuration - dg_config


Protection Mode: MaxPerformance

Databases:

c01orcl - Primary database

c02orcl - Physical standby database


Properties:

FastStartFailoverThreshold = '30'

OperationTimeout = '30'

FastStartFailoverLagLimit = '30'

CommunicationTimeout = '180'

ObserverReconnect = '0'

FastStartFailoverAutoReinstate = 'TRUE'

FastStartFailoverPmyShutdown = 'TRUE'

BystandersFollowRoleChange = 'ALL'

ObserverOverride = 'FALSE'

ExternalDestination1 = ''

ExternalDestination2 = ''

PrimaryLostWriteAction = 'CONTINUE'


Fast-Start Failover: DISABLED


Configuration Status:

SUCCESS


[grid@station11 ~]$ crsctl query crs activeversion

Oracle Clusterware active version on the cluster is [11.2.0.4.0]


[grid@station13 ~]$ crsctl query crs activeversion

Oracle Clusterware active version on the cluster is [11.2.0.4.0]


下面将要使用Oracle Grid Infrastructure Configuration Utility在以上两套网格基础架构的各个节点上进行升级。为了尽量不影响主库,我们先升级备库两个节点(升级之前这两个节点,可能要通过添加共享磁盘扩大+DATA+FRA盘组的大小,保证 +DATA可用空间不小于8G)。station11、station12、station13和station14都以grid用户预先采用“software-only installation”选项在/u01/app/12.1.0/grid目录下安装了12.1.0.2.0版本的Grid Infrastructure软件。










station11/u01/app/oraInventory/logs目录下面看日志,在我的环境中执行了46分钟:


[grid@station13 ~]$ tail -f /u01/app/oraInventory/logs/configActions2016-09-03_04-09-46-PM.log

INFO: OracleHomeToUpdate:/u01/app/12.1.0/grid;isCRS:false;isCFS:false;isLocal:false

INFO: From map: Hosts:[station13, station14] => Nodelist:[station13, station14]

INFO: Before calling api: Hosts:[station13, station14] => Nodelist:[station13, station14], update localnode? true

INFO: Number of scripts to be executed as root user = 1

INFO: Gathering system details...

WARNING: [WARNING] Configuration scripts generated by the Installer need to be run as a privileged user (root). Installer will run these scripts using the privileged user credentials provided earlier.

INFO: Advice is CONTINUE

INFO: Execute root script on nodes of Batch 1 in progress.

INFO: executing GI Upgrade script on nodes: [station13, station14]

INFO: PRCZ-2012 : station13 configuration started


INFO: PRCZ-2013 : station13 configuration ended

INFO: Progress:50

INFO: PRCZ-2012 : station14 configuration started

INFO: PRCZ-2013 : station14 configuration ended

INFO: Progress:100

INFO: status of GI Upgrade script execution is:true

INFO: *********************************************

INFO: Execution of GI Upgrade script is successful on nodes : [station14, station13]


Execution status of succeeded node:station14

Standard output : Check /u01/app/12.1.0/grid/install/root_station14.example.com_2016-09-03_18-13-36.log for the output of root script


Execution status of succeeded node:station13

Standard output :

Check /u01/app/12.1.0/grid/install/root_station13.example.com_2016-09-03_17-50-17.log for the output of root script



Execution status of station14 is:true

Execution exit code of station14 is:0

Execution status of station13 is:true

Execution exit code of station13 is:0


INFO: *********************************************

INFO: Execute root script on nodes of Batch 1 successful.

INFO: Overall status of execution of root/configuration scripts : succeeded

INFO: Performing Configuration

INFO: Entering ConfigClient.init method

INFO: ConfigClient.init sOracleHomeLoc=/u01/app/12.1.0/grid, sTopAggId=oracle.crs

INFO: Entering ConfigClient.initClientAndSession method

INFO: ConfigClient.initClientAndSession status : connected to the config framework

INFO: ConfigClient.initClientAndSession session begun oracle.sysman.emCfg.client.CfwSession@31b42659

INFO: ConfigClient.initClientAndSession m_oAggregate=[Loracle.sysman.emCfg.common.IAggregate;@2a41b68d

INFO: Configuration log directory - /u01/app/12.1.0/grid/cfgtoollogs

INFO: Exiting ConfigClient.init method

INFO: Calling event ConfigSessionInitialized

INFO: ConfigClient.registerOutErrStream method called

INFO: Enabling the Inactive Tools in the Aggregates

INFO: Enabled the Inactive Tools in the Aggregates

INFO: Updating Transient Parameters in the Aggregates

INFO: Updating Transient Parameters for oracle.crs

INFO: Setting value to transient variable oracle_install_crs_dropDBCmd

INFO: Setting value to transient variable ORACLE_HOME

INFO: Setting value to transient variable oracle_install_crs_cluvfyargs

INFO: Setting value to transient variable oracle_install_crs_CommaSeparatedNodes

INFO: Setting value to transient variable oracle_install_crs_MgmtDB_Std

INFO: Setting value to transient variable oracle_install_crs_emcaCmd

INFO: Setting value to transient variable s_upgradeFlagForGridconfigBat

INFO: Setting value to transient variable oracle_install_crs_ConfigureMgmtDB

INFO: Setting value to transient variable oracle_install_crs_cluvfyCmd

INFO: Setting value to transient variable s_mgmtDBCAPdbArgs

INFO: Setting value to transient variable oracle_install_crs_LaunchRootBat

INFO: Setting value to transient variable oracle_install_oldGIHome

INFO: Setting value to transient variable s_winServiceUserPasswordFlag

INFO: Setting value to transient variable oracle_install_LaunchInvUpdate

INFO: Setting value to transient variable oracle_install_crs_MgmtDB_CDB

INFO: Setting value to transient variable s_mgmtDBCACdbArgs

INFO: Setting value to transient variable oracle_install_crs_UseIPMI

INFO: Setting value to transient variable S_WINSERVICEUSERPASSWORD

INFO: Setting value to transient variable oracle_install_crs_LaunchCluvfy

INFO: Setting value to transient variable oracle_install_crs_MgmtDB_DropDB

INFO: Setting value to transient variable oracle_install_crs_ipmiCACmd

INFO: Setting value to transient variable oracle_install_db_dbcaCmd

INFO: Updating Transient Parameters for oracle.assistants.server

INFO: Setting value to transient variable oracle_install_db_LaunchDBCA

INFO: Setting value to transient variable ORACLE_HOME

INFO: Setting value to transient variable oracle_install_db_dbuaCmd

INFO: Setting value to transient variable oracle_install_db_LaunchODMA

INFO: Setting value to transient variable oracle_install_db_dbcaCmd

INFO: Updating Transient Parameters for oracle.assistants.netca.client

INFO: Setting value to transient variable oracle_install_LaunchNetCA

INFO: Setting value to transient variable ORACLE_HOME

INFO: Setting value to transient variable s_netCA_Args

INFO: Setting value to transient variable oracle_install_netcaDeinstCmd

INFO: Setting value to transient variable oracle_install_netcaCmd

INFO: Updating Transient Parameters for OuiConfigVariables

INFO: Setting value to transient variable ORACLE_HOME

INFO: Setting value to transient variable ORACLE_HOSTNAME

INFO: Updating Transient Parameters for oracle.assistants.asm

INFO: Setting value to transient variable ORACLE_HOME

INFO: Setting value to transient variable oracle_install_crs_asmcaCmd

INFO: Setting value to transient variable oracle_install_crs_LaunchASMCA

INFO: Successfully updated Transient Parameters in the Aggregates

INFO: Entering ConfigClient.getToolsList method

INFO: Created config job for Update CRS flag in Inventory

INFO: Created config job for Creating Container Database for Oracle Grid Infrastructure Management Repository

INFO: Created config job for Setting up Oracle Grid Infrastructure Management Repository

INFO: Created config job for MGMT Configuration Assistant

INFO: Created config job for Oracle Cluster Verification Utility

INFO: Configuration log directory - /u01/app/12.1.0/grid/cfgtoollogs

INFO: Entering ConfigClient.executeToolsInAggregate method

INFO: ConfigClient.executeToolsInAggregate oAggregate=oracle.crs:oracle.crs:12.1.0.2.0:common

INFO: Entering ConfigClient.assignAction method

INFO: ConfigClient.assignAction actionref=[Loracle.sysman.emCfg.common.IActionReference;@53fac759

INFO: ConfigClient.assignAction action is of type :configuration

INFO: Exiting ConfigClient.assignAction method

INFO: ConfigClient.executeToolsInAggregate action assigned

INFO: Started Plugin named: Update CRS flag in Inventory

INFO: Found associated job

INFO: Starting 'Update Inventory'

INFO: Starting 'Update Inventory'

INFO: UpdateNodelist data:

INFO: oracle.installer.oui_loc:/u01/app/12.1.0/grid/oui

INFO: oracle.installer.jre_loc:/u01/app/12.1.0/grid/jdk/jre

INFO: oracle.installer.doNotUpdateNodeList:true

INFO: oracle.installer.rootOwnedHome:true

INFO: OracleHomeToUpdate:/u01/app/11.2.0/grid;isCRS:false;isCFS:false;isLocal:false

INFO: From map: Hosts:[station13, station14] => Nodelist:[station13, station14]

INFO: Before calling api: Hosts:[station13, station14] => Nodelist:[station13, station14], update localnode? true

INFO: UpdateNodelist data:

INFO: oracle.installer.oui_loc:/u01/app/12.1.0/grid/oui

INFO: oracle.installer.jre_loc:/u01/app/12.1.0/grid/jdk/jre

INFO: oracle.installer.doNotUpdateNodeList:true

INFO: oracle.installer.rootOwnedHome:

INFO: OracleHomeToUpdate:/u01/app/12.1.0/grid;isCRS:true;isCFS:false;isLocal:false

INFO: From map: Hosts:[station13, station14] => Nodelist:[station13, station14]

INFO: Before calling api: Hosts:[station13, station14] => Nodelist:[station13, station14], update localnode? true

INFO: Completed Plugin named: Update CRS flag in Inventory

INFO: Completed 'Update Inventory'

INFO: Completed 'Update Inventory'

INFO: Started Plugin named: Creating Container Database for Oracle Grid Infrastructure Management Repository

INFO: Found associated job

INFO: Starting 'Creating Container Database for Oracle Grid Infrastructure Management Repository'

INFO: Starting 'Creating Container Database for Oracle Grid Infrastructure Management Repository'

INFO: MgmtDBCDBInternalPlugin: ... adding

INFO: Executing MGMTDBCDB

INFO: Command /u01/app/12.1.0/grid/bin/dbca -silent -createDatabase -createAsContainerDatabase true -templateName MGMTSeed_Database.dbc -sid -MGMTDB -gdbName _mgmtdb -storageType ASM -diskGroupName DATA -datafileJarLocation /u01/app/12.1.0/grid/assistants/dbca/templates -characterset AL32UTF8 -autoGeneratePasswords -skipUserTemplateCheck -oui_internal

INFO: ... GenericInternalPlugIn.handleProcess() entered.

INFO: ... GenericInternalPlugIn: getting configAssistantParmas.

INFO: ... GenericInternalPlugIn: checking secretArguments.

INFO: No arguments to pass to stdin

INFO: ... GenericInternalPlugIn: starting read loop.

INFO: Read: Registering database with Oracle Grid Infrastructure

WARNING: Skipping line: Registering database with Oracle Grid Infrastructure

INFO: End of argument passing to stdin

INFO: Read: 5% complete

WARNING: Skipping line: 5% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: Copying database files

WARNING: Skipping line: Copying database files

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 7% complete

WARNING: Skipping line: 7% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 9% complete

WARNING: Skipping line: 9% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 16% complete

WARNING: Skipping line: 16% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 23% complete

WARNING: Skipping line: 23% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 30% complete

WARNING: Skipping line: 30% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 37% complete

WARNING: Skipping line: 37% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 41% complete

WARNING: Skipping line: 41% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: Creating and starting Oracle instance

WARNING: Skipping line: Creating and starting Oracle instance

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 43% complete

WARNING: Skipping line: 43% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 48% complete

WARNING: Skipping line: 48% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 49% complete

WARNING: Skipping line: 49% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 50% complete

WARNING: Skipping line: 50% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 55% complete

WARNING: Skipping line: 55% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 60% complete

WARNING: Skipping line: 60% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 61% complete

WARNING: Skipping line: 61% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 64% complete

WARNING: Skipping line: 64% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: Completing Database Creation

WARNING: Skipping line: Completing Database Creation

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 68% complete

WARNING: Skipping line: 68% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 79% complete

WARNING: Skipping line: 79% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 89% complete

WARNING: Skipping line: 89% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 100% complete

WARNING: Skipping line: 100% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: Look at the log file "/u01/app/grid/cfgtoollogs/dbca/_mgmtdb/_mgmtdb.log" for further details.

WARNING: Skipping line: Look at the log file "/u01/app/grid/cfgtoollogs/dbca/_mgmtdb/_mgmtdb.log" for further details.

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Completed Plugin named: Creating Container Database for Oracle Grid Infrastructure Management Repository

INFO: Completed 'Creating Container Database for Oracle Grid Infrastructure Management Repository'

INFO: Completed 'Creating Container Database for Oracle Grid Infrastructure Management Repository'

INFO: Started Plugin named: Setting up Oracle Grid Infrastructure Management Repository

INFO: Found associated job

INFO: Starting 'Setting up Oracle Grid Infrastructure Management Repository'

INFO: Starting 'Setting up Oracle Grid Infrastructure Management Repository'

INFO: MgmtDBPDBInternalPlugin: ... adding

INFO: Executing MGMTDBPDB

INFO: Command /u01/app/12.1.0/grid/bin/dbca -silent -createPluggableDatabase -sourceDB -MGMTDB -pdbName cluster02 -createPDBFrom RMANBACKUP -PDBBackUpfile /u01/app/12.1.0/grid/assistants/dbca/templates/mgmtseed_pdb.dfb -PDBMetadataFile /u01/app/12.1.0/grid/assistants/dbca/templates/mgmtseed_pdb.xml -createAsClone true -internalSkipGIHomeCheck -oui_internal

INFO: ... GenericInternalPlugIn.handleProcess() entered.

INFO: ... GenericInternalPlugIn: getting configAssistantParmas.

INFO: ... GenericInternalPlugIn: checking secretArguments.

INFO: No arguments to pass to stdin

INFO: ... GenericInternalPlugIn: starting read loop.

INFO: Read: Creating Pluggable Database

WARNING: Skipping line: Creating Pluggable Database

INFO: End of argument passing to stdin

INFO: Read: 4% complete

WARNING: Skipping line: 4% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 12% complete

WARNING: Skipping line: 12% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 21% complete

WARNING: Skipping line: 21% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

这里时间可能很长

INFO: Read: 38% complete

WARNING: Skipping line: 38% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 55% complete

WARNING: Skipping line: 55% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 85% complete

WARNING: Skipping line: 85% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: Completing Pluggable Database Creation

WARNING: Skipping line: Completing Pluggable Database Creation

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 100% complete

WARNING: Skipping line: 100% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: Look at the log file "/u01/app/grid/cfgtoollogs/dbca/_mgmtdb/cluster02/_mgmtdb.log" for further details.

WARNING: Skipping line: Look at the log file "/u01/app/grid/cfgtoollogs/dbca/_mgmtdb/cluster02/_mgmtdb.log" for further details.

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Completed Plugin named: Setting up Oracle Grid Infrastructure Management Repository

INFO: Completed 'Setting up Oracle Grid Infrastructure Management Repository'

INFO: Completed 'Setting up Oracle Grid Infrastructure Management Repository'

INFO: Started Plugin named: MGMT Configuration Assistant

INFO: Found associated job

INFO: Starting 'Management Database Configuration Assistant'

INFO: Starting 'Management Database Configuration Assistant'

INFO:

WARNING:

INFO: Completed Plugin named: MGMT Configuration Assistant

INFO: Completed 'Management Database Configuration Assistant'

INFO: Completed 'Management Database Configuration Assistant'

INFO: Started Plugin named: Oracle Cluster Verification Utility

INFO: Found associated job

INFO: Starting 'Oracle Cluster Verification Utility'

INFO: Starting 'Oracle Cluster Verification Utility'

INFO: Performing post-checks for cluster services setup

INFO: Checking node reachability...

INFO: Node reachability check passed from node "station13"

INFO: Checking user equivalence...

INFO: User equivalence check passed for user "grid"

INFO: Checking node connectivity...

INFO: Checking hosts config file...

INFO: Verification of the hosts config file successful

INFO: Check: Node connectivity using interfaces on subnet "192.168.0.0"

INFO: Node connectivity passed for subnet "192.168.0.0" with node(s) station13,station14

INFO: TCP connectivity check passed for subnet "192.168.0.0"

INFO: Check: Node connectivity using interfaces on subnet "172.31.118.0"

INFO: Node connectivity passed for subnet "172.31.118.0" with node(s) station14,station13

INFO: TCP connectivity check passed for subnet "172.31.118.0"

INFO: Checking subnet mask consistency...

INFO: Subnet mask consistency check passed for subnet "192.168.0.0".

INFO: Subnet mask consistency check passed for subnet "172.31.118.0".

INFO: Subnet mask consistency check passed.

INFO: Node connectivity check passed

INFO: Checking multicast communication...

INFO: Checking subnet "172.31.118.0" for multicast communication with multicast group "224.0.0.251"...

INFO: Check of subnet "172.31.118.0" for multicast communication with multicast group "224.0.0.251" passed.

INFO: Check of multicast communication passed.

INFO: Checking whether the ASM filter driver is active and consistent on all nodes

INFO: ASM filter driver library is not installed on any of the cluster nodes.

INFO: ASM filter driver configuration was found consistent across all the cluster nodes.

INFO: Time zone consistency check passed

INFO: Checking Cluster manager integrity...

INFO: Checking CSS daemon...

INFO: Oracle Cluster Synchronization Services appear to be online.

INFO: Cluster manager integrity check passed

INFO: UDev attributes check for OCR locations started...

INFO: UDev attributes check passed for OCR locations

INFO: UDev attributes check for Voting Disk locations started...

INFO: UDev attributes check passed for Voting Disk locations

INFO: Default user file creation mask check passed

INFO: Checking cluster integrity...

INFO: Cluster integrity check passed

INFO: Checking OCR integrity...

INFO: Checking the absence of a non-clustered configuration...

INFO: All nodes free of non-clustered, local-only configurations

INFO: Checking daemon liveness...

INFO: Liveness check passed for "CRS daemon"

INFO: Checking OCR config file "/etc/oracle/ocr.loc"...

INFO: OCR config file "/etc/oracle/ocr.loc" check successful

INFO: Disk group for ocr location "+DATA/cluster02/OCRFILE/REGISTRY.255.919853143" is available on all the nodes

INFO: Checking OCR backup location "/u01/app/12.1.0/grid/cdata/cluster02"

INFO: OCR backup location "/u01/app/12.1.0/grid/cdata/cluster02" check passed

INFO: NOTE:

INFO: This check does not verify the integrity of the OCR contents. Execute 'ocrcheck' as a privileged user to verify the contents of OCR.

INFO: OCR integrity check passed

INFO: Checking CRS integrity...

INFO: Clusterware version consistency passed.

INFO: CRS integrity check passed

INFO: Checking node application existence...

INFO: Checking existence of VIP node application (required)

INFO: VIP node application check passed

INFO: Checking existence of NETWORK node application (required)

INFO: NETWORK node application check passed

INFO: Checking existence of ONS node application (optional)

INFO: ONS node application check passed

INFO: Checking Single Client Access Name (SCAN)...

INFO: Checking TCP connectivity to SCAN listeners...

INFO: TCP connectivity to SCAN listeners exists on all cluster nodes

INFO: Checking name resolution setup for "scan13.example.com"...

INFO: Checking integrity of name service switch configuration file "/etc/nsswitch.conf" ...

INFO: All nodes have same "hosts" entry defined in file "/etc/nsswitch.conf"

INFO: Check for integrity of name service switch configuration file "/etc/nsswitch.conf" passed

INFO: Checking SCAN IP addresses...

INFO: Check of SCAN IP addresses passed

INFO: Verification of SCAN VIP and listener setup passed

INFO: Checking OLR integrity...

INFO: Check of existence of OLR configuration file "/etc/oracle/olr.loc" passed

INFO: Check of attributes of OLR configuration file "/etc/oracle/olr.loc" passed

INFO: WARNING:

INFO: This check does not verify the integrity of the OLR contents. Execute 'ocrcheck -local' as a privileged user to verify the contents of OLR.

INFO: OLR integrity check passed

INFO: Checking Oracle Cluster Voting Disk configuration...

INFO: Oracle Cluster Voting Disk configuration check passed

INFO: User "grid" is not part of "root" group. Check passed

INFO: Oracle Clusterware is installed on all nodes.

INFO: CTSS resource check passed

INFO: Query of CTSS for time offset passed

INFO: CTSS is in Observer state. Switching over to clock synchronization checks using NTP

INFO: Starting Clock synchronization checks using Network Time Protocol(NTP)...

INFO: NTP configuration file "/etc/ntp.conf" existence check passed

INFO: Liveness check passed for "ntpd"

INFO: Check for NTP daemon or service alive passed on all nodes

INFO: Check of common NTP Time Server passed

INFO: Clock time offset check passed

INFO: Clock synchronization check using Network Time Protocol(NTP) passed

INFO: Oracle Cluster Time Synchronization Services check passed

INFO: Checking VIP configuration.

INFO: Checking VIP Subnet configuration.

INFO: Check for VIP Subnet configuration passed.

INFO: Checking VIP reachability

INFO: Check for VIP reachability passed.

INFO: Collecting OS mandatory requirements baseline

INFO: Collecting Multicast check ...nothing to collect

INFO: Collecting ASMLib installation and configuration verification. ...nothing to collect

INFO: Collecting Physical Memory ...collected

INFO: Collecting Available Physical Memory ...collected

INFO: Collecting Swap Size ...nothing to collect

INFO: Collecting Free Space: station14:/usr,station14:/var,station14:/etc,station14:/u01/app/12.1.0/grid,station14:/sbin,station14:/tmp ...collected

INFO: Collecting Free Space: station13:/usr,station13:/var,station13:/etc,station13:/u01/app/12.1.0/grid,station13:/sbin,station13:/tmp ...collected

INFO: Collecting User Existence: grid ...nothing to collect

INFO: Collecting Group Existence: oinstall ...nothing to collect

INFO: Collecting Group Membership: oinstall(Primary) ...nothing to collect

INFO: Collecting Run Level ...collected

INFO: Collecting Hard Limit: maximum open file descriptors ...collected

INFO: Collecting Soft Limit: maximum open file descriptors ...collected

...

INFO: Collecting Network configuration consistency checks ...nothing to collect

INFO: Collecting Software home: /u01/app/12.1.0/grid ...collected

这里时间可能很长

INFO: Collecting Clusterware best practice baseline

INFO: Collecting CSS misscount parameter ...collected

INFO: Collecting CSS reboottime parameter ...collected

INFO: Collecting CSS disktimeout parameter ...collected

INFO: Baseline collected.

INFO: Collection report for this execution is saved in file "/u01/app/grid/crsdata/@global/cvu/baseline/install/grid_install_12.1.0.2.0.xml".

INFO: Post-check for cluster services setup was successful.

INFO:

WARNING:

INFO: Completed Plugin named: Oracle Cluster Verification Utility

INFO: Completed 'Oracle Cluster Verification Utility'

INFO: Completed 'Oracle Cluster Verification Utility'

INFO: ConfigClient.executeToolsInAggregate action performed

INFO: Exiting ConfigClient.executeToolsInAggregate method

INFO: Calling event ConfigToolsExecuted

INFO: ConfigClient.saveSession method called

INFO: Calling event ConfigSessionEnding

INFO: ConfigClient.endSession method called

INFO: Completed Configuration

INFO: Setup completed with overall status as Succeeded

INFO: All forked task are completed at state setup

INFO: Completed background operations

INFO: Moved to state

INFO: Waiting for completion of background operations

INFO: Completed background operations

INFO: Validating view at state

INFO: Completed validating view at state

INFO: Validating state

INFO: Completed validating state

INFO: Verifying route success

INFO: Get view named [FinishUI]

INFO: View for [FinishUI] is oracle.install.ivw.crs.view.FinishGUI@46ae8bb1

INFO: Initializing view at state

INFO: Completed initializing view at state

INFO: Displaying view at state

INFO: Completed displaying view at state

INFO: Loading view at state

INFO: Install Succeeded: true

INFO: Config Tool Succeeded: true

INFO: Remote Install Succeeded: true

INFO: Completed loading view at state

INFO: Localizing view at state

INFO: Completed localizing view at state

INFO: Waiting for completion of background operations

INFO: Completed background operations

INFO: Executing action at state finish

INFO: FinishAction Actions.execute called

INFO: Completed executing action at state

INFO: Waiting for completion of background operations

INFO: Completed background operations

INFO: Moved to state



 


1.2 备库升级后环境概览


[grid@station13 ~]$ crsctl query crs activeversion

Oracle Clusterware active version on the cluster is [12.1.0.2.0]


2. 通过两次Dataguard切换,升级所有GI

2.1 主库Dataguard切换


[oracle@station11 ~]$ dgmgrl

DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production


Copyright (c) 2000, 2009, Oracle. All rights reserved.


Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle_4U@c01orcl

Connected.

DGMGRL> show configuration verbose;


Configuration - dg_config


Protection Mode: MaxPerformance

Databases:

c01orcl - Primary database

c02orcl - Physical standby database


Properties:

FastStartFailoverThreshold = '30'

OperationTimeout = '30'

FastStartFailoverLagLimit = '30'

CommunicationTimeout = '180'

ObserverReconnect = '0'

FastStartFailoverAutoReinstate = 'TRUE'

FastStartFailoverPmyShutdown = 'TRUE'

BystandersFollowRoleChange = 'ALL'

ObserverOverride = 'FALSE'

ExternalDestination1 = ''

ExternalDestination2 = ''

PrimaryLostWriteAction = 'CONTINUE'


Fast-Start Failover: DISABLED


Configuration Status:

SUCCESS


DGMGRL>


并且确保备库接收日志没有延迟,应用日志也没有延迟。


DGMGRL> show database c02orcl


Database - c02orcl


Role: PHYSICAL STANDBY

Intended State: APPLY-ON

Transport Lag: 0 seconds (computed 1 second ago)

Apply Lag: 0 seconds (computed 0 seconds ago)

Apply Rate: 377.00 KByte/s

Real Time Query: ON

Instance(s):

c02orcl1 (apply instance)

c02orcl2


Database Status:

SUCCESS


DGMGRL>


DGMGRL> switchover to c02orcl

Performing switchover NOW, please wait...

Operation requires a connection to instance "c02orcl1" on database "c02orcl"

Connecting to instance "c02orcl1"...

Connected.

New primary database "c02orcl" is opening...

Operation requires startup of instance "c01orcl1" on database "c01orcl"

Starting instance "c01orcl1"...

ORACLE instance started.

Database mounted.

Database opened.

Switchover succeeded, new primary is "c02orcl"

DGMGRL>


DGMGRL> show configuration verbose;


Configuration - dg_config


Protection Mode: MaxPerformance

Databases:

c02orcl - Primary database

c01orcl - Physical standby database


Properties:

FastStartFailoverThreshold = '30'

OperationTimeout = '30'

FastStartFailoverLagLimit = '30'

CommunicationTimeout = '180'

ObserverReconnect = '0'

FastStartFailoverAutoReinstate = 'TRUE'

FastStartFailoverPmyShutdown = 'TRUE'

BystandersFollowRoleChange = 'ALL'

ObserverOverride = 'FALSE'

ExternalDestination1 = ''

ExternalDestination2 = ''

PrimaryLostWriteAction = 'CONTINUE'


Fast-Start Failover: DISABLED


Configuration Status:

SUCCESS


DGMGRL>


确保新备库接收日志没有延迟,应用日志也没有延迟。


DGMGRL> show database c01orcl;


Database - c01orcl


Role: PHYSICAL STANDBY

Intended State: APPLY-ON

Transport Lag: 0 seconds (computed 0 seconds ago)

Apply Lag: 0 seconds (computed 1 second ago)

Apply Rate: 28.00 KByte/s

Real Time Query: ON

Instance(s):

c01orcl1 (apply instance)

c01orcl2


Database Status:

SUCCESS


DGMGRL>


下面将要使用Oracle Grid Infrastructure Configuration Utilitystation11上升级网格基础架构。


 








如果进度条在44%时报错,点“retry”就是。


[grid@station11 ~]$ tail -n 30 -f /u01/app/oraInventory/logs/configActions2016-09-03_10-32-09-PM.log

INFO: OracleHomeToUpdate:/u01/app/12.1.0/grid;isCRS:false;isCFS:false;isLocal:false

INFO: From map: Hosts:[station11, station12] => Nodelist:[station11, station12]

INFO: Before calling api: Hosts:[station11, station12] => Nodelist:[station11, station12], update localnode? true

INFO: Number of scripts to be executed as root user = 1

INFO: Gathering system details...

WARNING: [WARNING] Configuration scripts generated by the Installer need to be run as a privileged user (root). Installer will run these scripts using the privileged user credentials provided earlier.

INFO: Advice is CONTINUE

INFO: Execute root script on nodes of Batch 1 in progress.

INFO: executing GI Upgrade script on nodes: [station11, station12]

INFO: PRCZ-2012 : station11 configuration started

INFO: status of GI Upgrade script execution is:true

INFO: *********************************************

INFO: Execution of GI Upgrade script is successful on nodes : []

这个“[]”导致报错,界面点“Retry”,会通过。

INFO: *********************************************

INFO: Progress:50

INFO: Execute root script on nodes of Batch 1 failed.

INFO: Overall status of execution of root/configuration scripts : failed

INFO: All forked task are completed at state setup

INFO: Completed background operations

INFO: Moved to state

INFO: Number of scripts to be executed as root user = 1

INFO: Selecting job named 'Execute root script on nodes of Batch 1' for retry

INFO: Execute root script on nodes of Batch 1 in progress.

INFO: executing GI Upgrade script on nodes: [station11, station12]

INFO: PRCZ-2012 : station11 configuration started

INFO: PRCZ-2013 : station11 configuration ended

INFO: Progress:50

INFO: PRCZ-2012 : station12 configuration started

INFO: PRCZ-2013 : station12 configuration ended

INFO: Progress:100

INFO: status of GI Upgrade script execution is:true

INFO: *********************************************

INFO: Execution of GI Upgrade script is successful on nodes : [station12, station11]


Execution status of succeeded node:station12

Standard output : Check /u01/app/12.1.0/grid/install/root_station12.example.com_2016-09-04_08-49-50.log for the output of root script


Execution status of succeeded node:station11

Standard output :

Check /u01/app/12.1.0/grid/install/root_station11.example.com_2016-09-04_08-49-03.log for the output of root script



Execution status of station12 is:true

Execution exit code of station12 is:0

Execution status of station11 is:true

Execution exit code of station11 is:0


INFO: *********************************************

INFO: Execute root script on nodes of Batch 1 successful.

INFO: Overall status of execution of root/configuration scripts : succeeded

INFO: Performing Configuration

INFO: Entering ConfigClient.init method

INFO: ConfigClient.init sOracleHomeLoc=/u01/app/12.1.0/grid, sTopAggId=oracle.crs

INFO: Entering ConfigClient.initClientAndSession method

INFO: ConfigClient.initClientAndSession status : connected to the config framework

INFO: ConfigClient.initClientAndSession session begun oracle.sysman.emCfg.client.CfwSession@4856d15d

INFO: ConfigClient.initClientAndSession m_oAggregate=[Loracle.sysman.emCfg.common.IAggregate;@3bcb55c5

INFO: Configuration log directory - /u01/app/12.1.0/grid/cfgtoollogs

INFO: Exiting ConfigClient.init method

INFO: Calling event ConfigSessionInitialized

INFO: ConfigClient.registerOutErrStream method called

INFO: Enabling the Inactive Tools in the Aggregates

INFO: Enabled the Inactive Tools in the Aggregates

INFO: Updating Transient Parameters in the Aggregates

INFO: Updating Transient Parameters for oracle.crs

INFO: Setting value to transient variable oracle_install_crs_dropDBCmd

INFO: Setting value to transient variable ORACLE_HOME

INFO: Setting value to transient variable oracle_install_crs_cluvfyargs

INFO: Setting value to transient variable oracle_install_crs_CommaSeparatedNodes

INFO: Setting value to transient variable oracle_install_crs_MgmtDB_Std

INFO: Setting value to transient variable oracle_install_crs_emcaCmd

INFO: Setting value to transient variable s_upgradeFlagForGridconfigBat

INFO: Setting value to transient variable oracle_install_crs_ConfigureMgmtDB

INFO: Setting value to transient variable oracle_install_crs_cluvfyCmd

INFO: Setting value to transient variable s_mgmtDBCAPdbArgs

INFO: Setting value to transient variable oracle_install_crs_LaunchRootBat

INFO: Setting value to transient variable oracle_install_oldGIHome

INFO: Setting value to transient variable s_winServiceUserPasswordFlag

INFO: Setting value to transient variable oracle_install_LaunchInvUpdate

INFO: Setting value to transient variable oracle_install_crs_MgmtDB_CDB

INFO: Setting value to transient variable s_mgmtDBCACdbArgs

INFO: Setting value to transient variable oracle_install_crs_UseIPMI

INFO: Setting value to transient variable S_WINSERVICEUSERPASSWORD

INFO: Setting value to transient variable oracle_install_crs_LaunchCluvfy

INFO: Setting value to transient variable oracle_install_crs_MgmtDB_DropDB

INFO: Setting value to transient variable oracle_install_crs_ipmiCACmd

INFO: Setting value to transient variable oracle_install_db_dbcaCmd

INFO: Updating Transient Parameters for oracle.assistants.server

INFO: Setting value to transient variable oracle_install_db_LaunchDBCA

INFO: Setting value to transient variable ORACLE_HOME

INFO: Setting value to transient variable oracle_install_db_dbuaCmd

INFO: Setting value to transient variable oracle_install_db_LaunchODMA

INFO: Setting value to transient variable oracle_install_db_dbcaCmd

INFO: Updating Transient Parameters for oracle.assistants.netca.client

INFO: Setting value to transient variable oracle_install_LaunchNetCA

INFO: Setting value to transient variable ORACLE_HOME

INFO: Setting value to transient variable s_netCA_Args

INFO: Setting value to transient variable oracle_install_netcaDeinstCmd

INFO: Setting value to transient variable oracle_install_netcaCmd

INFO: Updating Transient Parameters for OuiConfigVariables

INFO: Setting value to transient variable ORACLE_HOME

INFO: Setting value to transient variable ORACLE_HOSTNAME

INFO: Updating Transient Parameters for oracle.assistants.asm

INFO: Setting value to transient variable ORACLE_HOME

INFO: Setting value to transient variable oracle_install_crs_asmcaCmd

INFO: Setting value to transient variable oracle_install_crs_LaunchASMCA

INFO: Successfully updated Transient Parameters in the Aggregates

INFO: Entering ConfigClient.getToolsList method

INFO: Created config job for Update CRS flag in Inventory

INFO: Created config job for Creating Container Database for Oracle Grid Infrastructure Management Repository

INFO: Created config job for Setting up Oracle Grid Infrastructure Management Repository

INFO: Created config job for MGMT Configuration Assistant

INFO: Created config job for Oracle Cluster Verification Utility

INFO: Configuration log directory - /u01/app/12.1.0/grid/cfgtoollogs

INFO: Entering ConfigClient.executeToolsInAggregate method

INFO: ConfigClient.executeToolsInAggregate oAggregate=oracle.crs:oracle.crs:12.1.0.2.0:common

INFO: Entering ConfigClient.assignAction method

INFO: ConfigClient.assignAction actionref=[Loracle.sysman.emCfg.common.IActionReference;@7b3cf3bb

INFO: ConfigClient.assignAction action is of type :configuration

INFO: Exiting ConfigClient.assignAction method

INFO: ConfigClient.executeToolsInAggregate action assigned

INFO: Started Plugin named: Update CRS flag in Inventory

INFO: Found associated job

INFO: Starting 'Update Inventory'

INFO: Starting 'Update Inventory'

INFO: UpdateNodelist data:

INFO: oracle.installer.oui_loc:/u01/app/12.1.0/grid/oui

INFO: oracle.installer.jre_loc:/u01/app/12.1.0/grid/jdk/jre

INFO: oracle.installer.doNotUpdateNodeList:true

INFO: oracle.installer.rootOwnedHome:true

INFO: OracleHomeToUpdate:/u01/app/11.2.0/grid;isCRS:false;isCFS:false;isLocal:false

INFO: From map: Hosts:[station11, station12] => Nodelist:[station11, station12]

INFO: Before calling api: Hosts:[station11, station12] => Nodelist:[station11, station12], update localnode? true

INFO: UpdateNodelist data:

INFO: oracle.installer.oui_loc:/u01/app/12.1.0/grid/oui

INFO: oracle.installer.jre_loc:/u01/app/12.1.0/grid/jdk/jre

INFO: oracle.installer.doNotUpdateNodeList:true

INFO: oracle.installer.rootOwnedHome:

INFO: OracleHomeToUpdate:/u01/app/12.1.0/grid;isCRS:true;isCFS:false;isLocal:false

INFO: From map: Hosts:[station11, station12] => Nodelist:[station11, station12]

INFO: Before calling api: Hosts:[station11, station12] => Nodelist:[station11, station12], update localnode? true

INFO: Completed Plugin named: Update CRS flag in Inventory

INFO: Completed 'Update Inventory'

INFO: Completed 'Update Inventory'

INFO: Started Plugin named: Creating Container Database for Oracle Grid Infrastructure Management Repository

INFO: Found associated job

INFO: Starting 'Creating Container Database for Oracle Grid Infrastructure Management Repository'

INFO: Starting 'Creating Container Database for Oracle Grid Infrastructure Management Repository'

INFO: MgmtDBCDBInternalPlugin: ... adding

INFO: Executing MGMTDBCDB

INFO: Command /u01/app/12.1.0/grid/bin/dbca -silent -createDatabase -createAsContainerDatabase true -templateName MGMTSeed_Database.dbc -sid -MGMTDB -gdbName _mgmtdb -storageType ASM -diskGroupName DATA -datafileJarLocation /u01/app/12.1.0/grid/assistants/dbca/templates -characterset AL32UTF8 -autoGeneratePasswords -skipUserTemplateCheck -oui_internal

INFO: ... GenericInternalPlugIn.handleProcess() entered.

INFO: ... GenericInternalPlugIn: getting configAssistantParmas.

INFO: ... GenericInternalPlugIn: checking secretArguments.

INFO: No arguments to pass to stdin

INFO: ... GenericInternalPlugIn: starting read loop.

INFO: Read: Registering database with Oracle Grid Infrastructure

WARNING: Skipping line: Registering database with Oracle Grid Infrastructure

INFO: End of argument passing to stdin

INFO: Read: 5% complete

WARNING: Skipping line: 5% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: Copying database files

WARNING: Skipping line: Copying database files

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 7% complete

WARNING: Skipping line: 7% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 9% complete

WARNING: Skipping line: 9% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 16% complete

WARNING: Skipping line: 16% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 23% complete

WARNING: Skipping line: 23% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 30% complete

WARNING: Skipping line: 30% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 37% complete

WARNING: Skipping line: 37% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 41% complete

WARNING: Skipping line: 41% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: Creating and starting Oracle instance

WARNING: Skipping line: Creating and starting Oracle instance

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 43% complete

WARNING: Skipping line: 43% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 48% complete

WARNING: Skipping line: 48% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 49% complete

WARNING: Skipping line: 49% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 50% complete

WARNING: Skipping line: 50% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 55% complete

WARNING: Skipping line: 55% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 60% complete

WARNING: Skipping line: 60% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 61% complete

WARNING: Skipping line: 61% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 64% complete

WARNING: Skipping line: 64% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: Completing Database Creation

WARNING: Skipping line: Completing Database Creation

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 68% complete

WARNING: Skipping line: 68% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 79% complete

WARNING: Skipping line: 79% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 89% complete

WARNING: Skipping line: 89% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 100% complete

WARNING: Skipping line: 100% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: Look at the log file "/u01/app/grid/cfgtoollogs/dbca/_mgmtdb/_mgmtdb.log" for further details.

WARNING: Skipping line: Look at the log file "/u01/app/grid/cfgtoollogs/dbca/_mgmtdb/_mgmtdb.log" for further details.

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Completed Plugin named: Creating Container Database for Oracle Grid Infrastructure Management Repository

INFO: Completed 'Creating Container Database for Oracle Grid Infrastructure Management Repository'

INFO: Completed 'Creating Container Database for Oracle Grid Infrastructure Management Repository'

INFO: Started Plugin named: Setting up Oracle Grid Infrastructure Management Repository

INFO: Found associated job

INFO: Starting 'Setting up Oracle Grid Infrastructure Management Repository'

INFO: Starting 'Setting up Oracle Grid Infrastructure Management Repository'

INFO: MgmtDBPDBInternalPlugin: ... adding

INFO: Executing MGMTDBPDB

INFO: Command /u01/app/12.1.0/grid/bin/dbca -silent -createPluggableDatabase -sourceDB -MGMTDB -pdbName cluster01 -createPDBFrom RMANBACKUP -PDBBackUpfile /u01/app/12.1.0/grid/assistants/dbca/templates/mgmtseed_pdb.dfb -PDBMetadataFile /u01/app/12.1.0/grid/assistants/dbca/templates/mgmtseed_pdb.xml -createAsClone true -internalSkipGIHomeCheck -oui_internal

INFO: ... GenericInternalPlugIn.handleProcess() entered.

INFO: ... GenericInternalPlugIn: getting configAssistantParmas.

INFO: ... GenericInternalPlugIn: checking secretArguments.

INFO: No arguments to pass to stdin

INFO: ... GenericInternalPlugIn: starting read loop.

INFO: Read: Creating Pluggable Database

WARNING: Skipping line: Creating Pluggable Database

INFO: End of argument passing to stdin

INFO: Read: 4% complete

WARNING: Skipping line: 4% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 12% complete

WARNING: Skipping line: 12% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 21% complete

WARNING: Skipping line: 21% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

这里时间可能很长

INFO: Read: 38% complete

WARNING: Skipping line: 38% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 55% complete

WARNING: Skipping line: 55% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 85% complete

WARNING: Skipping line: 85% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: Completing Pluggable Database Creation

WARNING: Skipping line: Completing Pluggable Database Creation

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: 100% complete

WARNING: Skipping line: 100% complete

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Read: Look at the log file "/u01/app/grid/cfgtoollogs/dbca/_mgmtdb/cluster01/_mgmtdb.log" for further details.

WARNING: Skipping line: Look at the log file "/u01/app/grid/cfgtoollogs/dbca/_mgmtdb/cluster01/_mgmtdb.log" for further details.

INFO: Exceeded the number of arguments passed to stdin. CurrentCount:1 Total args:0

INFO: Completed Plugin named: Setting up Oracle Grid Infrastructure Management Repository

INFO: Completed 'Setting up Oracle Grid Infrastructure Management Repository'

INFO: Completed 'Setting up Oracle Grid Infrastructure Management Repository'

INFO: Started Plugin named: MGMT Configuration Assistant

INFO: Found associated job

INFO: Starting 'Management Database Configuration Assistant'

INFO: Starting 'Management Database Configuration Assistant'

WARNING:

INFO:

INFO: Completed Plugin named: MGMT Configuration Assistant

INFO: Completed 'Management Database Configuration Assistant'

INFO: Completed 'Management Database Configuration Assistant'

INFO: Started Plugin named: Oracle Cluster Verification Utility

INFO: Found associated job

INFO: Starting 'Oracle Cluster Verification Utility'

INFO: Starting 'Oracle Cluster Verification Utility'

INFO: Performing post-checks for cluster services setup

INFO: Checking node reachability...

INFO: Node reachability check passed from node "station11"

INFO: Checking user equivalence...

INFO: User equivalence check passed for user "grid"

INFO: Checking node connectivity...

INFO: Checking hosts config file...

INFO: Verification of the hosts config file successful

INFO: Check: Node connectivity using interfaces on subnet "172.31.118.0"

INFO: Node connectivity passed for subnet "172.31.118.0" with node(s) station12,station11

INFO: TCP connectivity check passed for subnet "172.31.118.0"

INFO: Check: Node connectivity using interfaces on subnet "192.168.0.0"

INFO: Node connectivity passed for subnet "192.168.0.0" with node(s) station11,station12

INFO: TCP connectivity check passed for subnet "192.168.0.0"

INFO: Checking subnet mask consistency...

INFO: Subnet mask consistency check passed for subnet "192.168.0.0".

INFO: Subnet mask consistency check passed for subnet "172.31.118.0".

INFO: Subnet mask consistency check passed.

INFO: Node connectivity check passed

INFO: Checking multicast communication...

INFO: Checking subnet "172.31.118.0" for multicast communication with multicast group "224.0.0.251"...

INFO: Check of subnet "172.31.118.0" for multicast communication with multicast group "224.0.0.251" passed.

INFO: Check of multicast communication passed.

INFO: Checking whether the ASM filter driver is active and consistent on all nodes

INFO: ASM filter driver library is not installed on any of the cluster nodes.

INFO: ASM filter driver configuration was found consistent across all the cluster nodes.

INFO: Time zone consistency check passed

INFO: Checking Cluster manager integrity...

INFO: Checking CSS daemon...

INFO: Oracle Cluster Synchronization Services appear to be online.

INFO: Cluster manager integrity check passed

INFO: UDev attributes check for OCR locations started...

INFO: UDev attributes check passed for OCR locations

INFO: UDev attributes check for Voting Disk locations started...

INFO: UDev attributes check passed for Voting Disk locations

INFO: Default user file creation mask check passed

INFO: Checking cluster integrity...

INFO: Cluster integrity check passed

INFO: Checking OCR integrity...

INFO: Checking the absence of a non-clustered configuration...

INFO: All nodes free of non-clustered, local-only configurations

INFO: Checking daemon liveness...

INFO: Liveness check passed for "CRS daemon"

INFO: Checking OCR config file "/etc/oracle/ocr.loc"...

INFO: OCR config file "/etc/oracle/ocr.loc" check successful

INFO: Disk group for ocr location "+DATA/cluster01/OCRFILE/REGISTRY.255.919882523" is available on all the nodes

INFO: Checking OCR backup location "/u01/app/12.1.0/grid/cdata/cluster01"

INFO: OCR backup location "/u01/app/12.1.0/grid/cdata/cluster01" check passed

INFO: NOTE:

INFO: This check does not verify the integrity of the OCR contents. Execute 'ocrcheck' as a privileged user to verify the contents of OCR.

INFO: OCR integrity check passed

INFO: Checking CRS integrity...

INFO: Clusterware version consistency passed.

INFO: CRS integrity check passed

INFO: Checking node application existence...

INFO: Checking existence of VIP node application (required)

INFO: VIP node application check passed

INFO: Checking existence of NETWORK node application (required)

INFO: NETWORK node application check passed

INFO: Checking existence of ONS node application (optional)

INFO: ONS node application check passed

INFO: Checking Single Client Access Name (SCAN)...

INFO: Checking TCP connectivity to SCAN listeners...

INFO: TCP connectivity to SCAN listeners exists on all cluster nodes

INFO: Checking name resolution setup for "scan11.example.com"...

INFO: Checking integrity of name service switch configuration file "/etc/nsswitch.conf" ...

INFO: All nodes have same "hosts" entry defined in file "/etc/nsswitch.conf"

INFO: Check for integrity of name service switch configuration file "/etc/nsswitch.conf" passed

INFO: Checking SCAN IP addresses...

INFO: Check of SCAN IP addresses passed

INFO: Verification of SCAN VIP and listener setup passed

INFO: Checking OLR integrity...

INFO: Check of existence of OLR configuration file "/etc/oracle/olr.loc" passed

INFO: Check of attributes of OLR configuration file "/etc/oracle/olr.loc" passed

INFO: WARNING:

INFO: This check does not verify the integrity of the OLR contents. Execute 'ocrcheck -local' as a privileged user to verify the contents of OLR.

INFO: OLR integrity check passed

INFO: Checking Oracle Cluster Voting Disk configuration...

INFO: Oracle Cluster Voting Disk configuration check passed

INFO: User "grid" is not part of "root" group. Check passed

INFO: Oracle Clusterware is installed on all nodes.

INFO: CTSS resource check passed

INFO: Query of CTSS for time offset passed

INFO: CTSS is in Observer state. Switching over to clock synchronization checks using NTP

INFO: Starting Clock synchronization checks using Network Time Protocol(NTP)...

INFO: NTP configuration file "/etc/ntp.conf" existence check passed

INFO: Liveness check passed for "ntpd"

INFO: Check for NTP daemon or service alive passed on all nodes

INFO: Check of common NTP Time Server passed

INFO: Clock time offset check passed

INFO: Clock synchronization check using Network Time Protocol(NTP) passed

INFO: Oracle Cluster Time Synchronization Services check passed

INFO: Checking VIP configuration.

INFO: Checking VIP Subnet configuration.

INFO: Check for VIP Subnet configuration passed.

INFO: Checking VIP reachability

INFO: Check for VIP reachability passed.

INFO: Collecting OS mandatory requirements baseline

INFO: Collecting Multicast check ...nothing to collect

INFO: Collecting ASMLib installation and configuration verification. ...nothing to collect

INFO: Collecting Physical Memory ...collected

INFO: Collecting Available Physical Memory ...collected

INFO: Collecting Swap Size ...nothing to collect

INFO: Collecting Free Space: station12:/usr,station12:/var,station12:/etc,station12:/u01/app/12.1.0/grid,station12:/sbin,station12:/tmp ...collected

INFO: Collecting Free Space: station11:/usr,station11:/var,station11:/etc,station11:/u01/app/12.1.0/grid,station11:/sbin,station11:/tmp ...collected

INFO: Collecting User Existence: grid ...nothing to collect

INFO: Collecting Group Existence: oinstall ...nothing to collect

INFO: Collecting Group Membership: oinstall(Primary) ...nothing to collect

INFO: Collecting Run Level ...collected

INFO: Collecting Hard Limit: maximum open file descriptors ...collected

INFO: Collecting Soft Limit: maximum open file descriptors ...collected

...

INFO: Collecting Network configuration consistency checks ...nothing to collect

INFO: Collecting Software home: /u01/app/12.1.0/grid ...collected

这里时间可能很长

INFO: Collecting Clusterware best practice baseline

INFO: Collecting CSS misscount parameter ...collected

INFO: Collecting CSS reboottime parameter ...collected

INFO: Collecting CSS disktimeout parameter ...collected

INFO: Baseline collected.

INFO: Collection report for this execution is saved in file "/u01/app/grid/crsdata/@global/cvu/baseline/install/grid_install_12.1.0.2.0.xml".

INFO: Post-check for cluster services setup was successful.

INFO:

WARNING:

INFO: Completed Plugin named: Oracle Cluster Verification Utility

INFO: Completed 'Oracle Cluster Verification Utility'

INFO: Completed 'Oracle Cluster Verification Utility'

INFO: ConfigClient.executeToolsInAggregate action performed

INFO: Exiting ConfigClient.executeToolsInAggregate method

INFO: Calling event ConfigToolsExecuted

INFO: ConfigClient.saveSession method called

INFO: Calling event ConfigSessionEnding

INFO: ConfigClient.endSession method called

INFO: Completed Configuration



2.2 原主库(新备库升级后环境概览


[grid@station11 ~]$ crsctl query crs activeversion

Oracle Clusterware active version on the cluster is [12.1.0.2.0]


2.3 主库Dataguard切换,原主库(新备库)重新成为主库


[oracle@station11 ~]$ dgmgrl

DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production


Copyright (c) 2000, 2009, Oracle. All rights reserved.


Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle_4U@c01orcl

Connected.

DGMGRL> show configuration verbose;


Configuration - dg_config


Protection Mode: MaxPerformance

Databases:

c02orcl - Primary database

c01orcl - Physical standby database


Properties:

FastStartFailoverThreshold = '30'

OperationTimeout = '30'

FastStartFailoverLagLimit = '30'

CommunicationTimeout = '180'

ObserverReconnect = '0'

FastStartFailoverAutoReinstate = 'TRUE'

FastStartFailoverPmyShutdown = 'TRUE'

BystandersFollowRoleChange = 'ALL'

ObserverOverride = 'FALSE'

ExternalDestination1 = ''

ExternalDestination2 = ''

PrimaryLostWriteAction = 'CONTINUE'


Fast-Start Failover: DISABLED


Configuration Status:

SUCCESS


DGMGRL>


并且确保备库接收日志没有延迟,应用日志也没有延迟。


DGMGRL> show database c01orcl;


Database - c01orcl


Role: PHYSICAL STANDBY

Intended State: APPLY-ON

Transport Lag: 0 seconds (computed 1 second ago)

Apply Lag: 0 seconds (computed 0 seconds ago)

Apply Rate: 73.00 KByte/s

Real Time Query: ON

Instance(s):

c01orcl1 (apply instance)

c01orcl2


Database Status:

SUCCESS


DGMGRL>


DGMGRL> switchover to c01orcl;

Performing switchover NOW, please wait...

Operation requires a connection to instance "c01orcl1" on database "c01orcl"

Connecting to instance "c01orcl1"...

Connected.

New primary database "c01orcl" is opening...

Operation requires startup of instance "c02orcl1" on database "c02orcl"

Starting instance "c02orcl1"...

ORACLE instance started.

Database mounted.

Database opened.

Switchover succeeded, new primary is "c01orcl"


DGMGRL> show configuration verbose;


Configuration - dg_config


Protection Mode: MaxPerformance

Databases:

c01orcl - Primary database

c02orcl - Physical standby database


Properties:

FastStartFailoverThreshold = '30'

OperationTimeout = '30'

FastStartFailoverLagLimit = '30'

CommunicationTimeout = '180'

ObserverReconnect = '0'

FastStartFailoverAutoReinstate = 'TRUE'

FastStartFailoverPmyShutdown = 'TRUE'

BystandersFollowRoleChange = 'ALL'

ObserverOverride = 'FALSE'

ExternalDestination1 = ''

ExternalDestination2 = ''

PrimaryLostWriteAction = 'CONTINUE'


Fast-Start Failover: DISABLED


Configuration Status:

SUCCESS


DGMGRL>


确保新备库接收日志没有延迟,应用日志也没有延迟。


DGMGRL> show database c02orcl;


Database - c02orcl


Role: PHYSICAL STANDBY

Intended State: APPLY-ON

Transport Lag: 0 seconds (computed 0 seconds ago)

Apply Lag: 0 seconds (computed 0 seconds ago)

Apply Rate: 137.00 KByte/s

Real Time Query: ON

Instance(s):

c02orcl1 (apply instance)

c02orcl2


Database Status:

SUCCESS


DGMGRL>


到此四台主机上的GI都成功升级完成,请把station11station13/home/grid/.bash_profile文件以grid用户都改成:


# .bash_profile


# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi


# User specific environment and startup programs


PATH=$PATH:$HOME/bin


export PATH

export ORACLE_BASE=/u01/app/grid

export ORACLE_HOME=/u01/app/12.1.0/grid

export ORACLE_SID=+ASM1

export TNS_ADMIN=$ORACLE_HOME/network/admin

export NLS_LANG=american_america.AL32UTF8

export ORACLE_TERM=xterm

export EDITOR=vi

export PATH=$ORACLE_HOME/bin:$PATH

export LANG=en_US


改后都要以grid用户使其生效:


. .bash_profile


请把station12station14/home/grid/.bash_profile文件以grid用户都改成:


# .bash_profile


# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi


# User specific environment and startup programs


PATH=$PATH:$HOME/bin


export PATH

export ORACLE_BASE=/u01/app/grid

export ORACLE_HOME=/u01/app/12.1.0/grid

export ORACLE_SID=+ASM2

export TNS_ADMIN=$ORACLE_HOME/network/admin

export NLS_LANG=american_america.AL32UTF8

export ORACLE_TERM=xterm

export EDITOR=vi

export PATH=$ORACLE_HOME/bin:$PATH

export LANG=en_US


改后都要以grid用户使其生效:


. .bash_profile


3. 通过Transient Logical Standby转换,升级所有DB

3.1 My Oracle Support Bulletin 949322.1综述

到此,我们已经升级了所有的GI。下一步我们要准备升级MAA中的两个数据库,并且要在升级过程中使用Rolling Patch技术以期达到对前台业务的0影响。我们注意到早在201525日已经发布的My Oracle Support Bulletin 949322.1专注于在Linux/UNIX上实现这一工作并提供一个叫做“physru.sh”Bash Shell脚本来具体实施。但是949322.1标注的适用范围是11.1.0.6(含RAC)到11.2.0.4(含RAC)。于是需要仔细评估一下这个由大量SQL操作和验证语句写成的“physru.sh”脚本在我们这套MAA数据库从11.2.0.4升级到12.1.0.2的场景里的适用性,最后需要进行严格实验测试。

My Oracle Support Bulletin 949322.1中提到的Transient Logical Standby” 应该指的是为了执行升级目的而临时由物理Standby数据库转换成的逻辑Standby数据库;通过在转换前设定保障闪回还原点可以在升级后再转换回物理Standby架构。 “Transient Logical Standby”的概念最早出现在11.1Oracle官网解释。利用转换“Transient Logical Standby”过程,可以在升级或打冷补丁时实现前台业务0暂停。因为GI升级完成后接下来升级数据库软件,这下难题出现了:如果我们先升级物理备库到12.1.0.2,那么备库(12.1.0.2)和主库(11.2.0.4)的版本就会不一样。大家都知道的基本常识是:物理备库和主库数据库软件版本必需完全一样(这两个库的数据文件都是能互替!)。如果数据库软件版本不一样,基于物理StandbyMAA架构就不复存在了,进而就根本不可能Switchover,再进而就完全不可能进行Rolling Patch。但是又要保障前台业务0暂停,所以我们就不能在升级数据库软件过程中破坏的Dataguard架构。大家知道:Oracle只有两种DataguardA. 物理StandbyB. 逻辑Standby。因此经过以上解释,所有人都会自然得出结论:为了保障前台业务0暂停,在升级数据库前,应该先把原先基于物理StandbyMAA架构转成基于逻辑Standby的。这个过程有以下几个优点:

1. 逻辑StandbySQL Apply是允许主库版本低于备库版本的。

2. 利用已经存在的物理Standby转换成 Transient Logical Standby,不需要额外的存储,不需要部署另外一套逻辑Standby

3. 整个过程中只要升级Transient Logical Standby 数据库的数据字典到12c。通过对升级过程中的日志进行挖掘,进而再进行SQL Apply,剩下的一个库会“隐式”升级成12c


3.2 升级前的准备工作

实验到此为止,我们已经完成了升级MAA的所有两个GI的工作。下面要对MAA中主库和备库做准备工作,以期望能够顺利完成剩下的DB Rolling Patch


3.2.1 停用Datagurad Broker

station11上执行:


[oracle@station11 ~]$ . oraenv

ORACLE_SID = [c01orcl1] ?

The Oracle base remains unchanged with value /u01/app/oracle

[oracle@station11 ~]$ dgmgrl

DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production


Copyright (c) 2000, 2009, Oracle. All rights reserved.


Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle_4U@c01orcl

Connected.

DGMGRL> disable configuration

Disabled.


station11上执行:


[oracle@station11 ~]$ sqlplus /nolog


SQL*Plus: Release 11.2.0.4.0 Production on Wed Sep 14 19:18:26 2016


Copyright (c) 1982, 2013, Oracle. All rights reserved.


SQL> conn / as sysdba

Connected.

SQL> alter system set dg_broker_start=false;


System altered.


station13上执行:


[oracle@station13 ~]$ sqlplus /nolog


SQL*Plus: Release 11.2.0.4.0 Production on Wed Sep 14 19:22:23 2016


Copyright (c) 1982, 2013, Oracle. All rights reserved.


SQL> conn / as sysdba

Connected.

SQL> alter system set dg_broker_start=false;


System altered.


3.2.2 确保主库和备库闪回区都存在,并都设置了正确的大小

station11上执行:


[grid@station11 ~]$ . oraenv

ORACLE_SID = [+ASM1] ?

The Oracle base remains unchanged with value /u01/app/grid

[grid@station11 ~]$ sqlplus /nolog


SQL*Plus: Release 12.1.0.2.0 Production on Wed Sep 14 20:04:50 2016


Copyright (c) 1982, 2014, Oracle. All rights reserved.


SQL> conn / as sysdba

Connected.

SQL> set linesize 1000

SQL> col name format a10

SQL> select name,total_mb, usable_file_mb from v$asm_diskgroup ;


NAME TOTAL_MB USABLE_FILE_MB

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

FRA 14754 11880

DATA 39344 9953


station11上执行:


SQL> alter system set db_recovery_file_dest_size=14754M;


System altered.


station13上执行:


[grid@station13 ~]$ . oraenv

ORACLE_SID = [+ASM1] ?

The Oracle base remains unchanged with value /u01/app/grid

[grid@station11 ~]$ sqlplus /nolog


SQL*Plus: Release 12.1.0.2.0 Production on Wed Sep 14 20:06:10 2016


Copyright (c) 1982, 2014, Oracle. All rights reserved.


SQL> conn / as sysdba

Connected.

SQL> set linesize 1000

SQL> col name format a10

SQL> select name,total_mb, usable_file_mb from v$asm_diskgroup ;


NAME TOTAL_MB USABLE_FILE_MB

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

FRA 14754 11880

DATA 39344 9953


station13上执行:


SQL> alter system set db_recovery_file_dest_size=14754M;


System altered.


3.2.3 主库和备库配置闪回数据库

station11上执行:


SQL> alter database flashback on;


Database altered.


station13上执行:


SQL>alter database recover managed standby database cancel;


Database altered.

SQL> alter database flashback on;


Database altered.


3.2.4 确保升级前,备库进行着健康的Recover Managed Standby Database

station13上执行:


SQL> alter database recover managed standby database using current logfile disconnect;


Database altered.


3.3 第一次执行physru.sh

数据库滚动升级过程包含许多步骤和多次数据库角色切换并且需要严格按照顺序进行。为了简化这个过程,也为了减少出错可能性,My Oracle Support Bulletin 949322.1提供了由SQL语句和验证过程编写而成的Bash Sell脚本:physru.sh。脚本会探测每一步的执行状态,有些步骤需要同时开另一Terminal进行手工操作。需要手工操作时会给出指引(RAC环境需要手工操作的地方还是比较多的)。physru.sh允许出错重试,重试时会提示是否要从上次执行位置开始或者干脆从头再来。physru.sh被设计成至少要在第一次调用处(带着相同的6个参数)重复执行三次,才会成功完成整个Rolling Patch过程。本人下载了该脚本,并且将其存放在station11/home/oracle/目录下。然后用dos2unix工具将其转成UNIX格式后再加上可执行位并执行。(在本文附录stage2中加密了该脚本,它是MOS的财产,请读者自行去MOS下载)。

station11上不带任何参数执行输出如下(执行会报错,但是会看到physru.sh的自我介绍):


[oracle@station11 ~]$ ./physru.sh


Usage: physru


Purpose:

Perform a rolling upgrade between a primary and physical standby database.


This script simplifies a physical standby rolling upgrade. While numerous

steps have been automated, this script must be called at least three times

in order to complete a rolling upgrade. When this script reaches a point

where user intervention is required, it outputs a message indicating what

is expected of the user. Once the user action is complete, this script can

be called to resume the rolling upgrade. In the event of an error, a user

can take corrective action, and simply call this script again to resume the

rolling upgrade. In the event one wishes to abandon the rolling upgrade, and

revert the configuration back to its pre-upgrade state, this script creates

guaranteed flashback database restore points on both the primary and standby

databases, and backs up each databases' associated control file. The names

of the restore points and backup control files are output to the console and

logfile when they are initially created.


When this script is called, it assumes all databases to be either mounted or

open. It requires flashback database to be enabled on both the primary and

standby instances. RAC configurations are permitted but there is limited

automation provided by the script. At specific points it may become

necessary to manually shutdown/startup instances and change init.ora

parameter values. When appropriate, the script will output when these

requirements are expected of the user. RAC configurations are also required

to define static tns services since this script expects a given tns service

name to contact the same instance on successive calls.


Arguments:

= dba username

= tns service name to primary

= tns service name to physical standby

= db_unique_name of primary

= db_unique_name of standby

= target rdbms version


Example:

physru sys hq_tnspri hq_tnsstb hq_primary hq_standby 11.2.0.2.0


NOTE: This script performs role transitions, and it is not necessary to

adjust the tns and db name arguments to their respective database roles

on successive calls. That is, the arguments must remain the same from

first-invocation to completion.


ERROR: 0 of the 6 required parameters have been specified


[oracle@station11 ~]$


应该特别注意:以上输出中提到在“RAC配置中需要提供只连接到某个特定实例(一般是第一个实例)的TNS串” 也就是说这个TNS串不能包含任何Load Balancing或Failover配置。同时可以得出推论:physru.sh可以使用这个TNS串实现远程打开数据库。因此在运行physru.sh前应该分别在station11station13/u01/app/12.1.0/grid/network/admin/目录下配置相应的listener.ora文件。使服务名c01orcl.example.com在station11的监听器上做静态注册;使服务名c02orcl.example.com在station13的监听器上做静态注册。

还应该特别注意:在使用physru.sh进行Rolling Upgrade过程中, Transient Logical Standby数据库可能会周期性地无法接收到来自主库的更新。如果此时万一主库发生故障,就没有备库应急,甚至会发生数据丢失。 因此在特别重要的生产环境中,要考虑到这种风险并采取相应手段比如准备备用的Logical Standby以应对。

station11上执行(在出现提示“Please enter the sysdba password:”时输入“oracle_4U”):


[oracle@station11 ~]$ ./physru.sh sys c01orcl1 c02orcl1 c01orcl c02orcl 12.1.0.2.0

Please enter the sysdba password:


### Initialize script to either start over or resume execution

Sep 14 21:59:16 2016 [0-1] Identifying rdbms software version

Sep 14 21:59:17 2016 [0-1] database c01orcl is at version 11.2.0.4.0

Sep 14 21:59:18 2016 [0-1] database c02orcl is at version 11.2.0.4.0

Sep 14 21:59:19 2016 [0-1] verifying flashback database is enabled at c01orcl and c02orcl

Sep 14 21:59:20 2016 [0-1] verifying available flashback restore points

Sep 14 21:59:20 2016 [0-1] verifying DG Broker is disabled

Sep 14 21:59:21 2016 [0-1] looking up prior execution history

Sep 14 21:59:21 2016 [0-1] purging script execution state from database c01orcl

Sep 14 21:59:22 2016 [0-1] purging script execution state from database c02orcl

Sep 14 21:59:22 2016 [0-1] starting new execution of script


### Stage 1: Backup user environment in case rolling upgrade is aborted

Sep 14 21:59:23 2016 [1-1] stopping media recovery on c02orcl

Sep 14 21:59:27 2016 [1-1] creating restore point PRU_0000_0001 on database c02orcl

Sep 14 21:59:28 2016 [1-1] backing up current control file on c02orcl

Sep 14 21:59:32 2016 [1-1] created backup control file /u01/app/oracle/product/11.2.0/dbhome_1/dbs/PRU_0001_c02orcl_f.f

Sep 14 21:59:32 2016 [1-1] creating restore point PRU_0000_0001 on database c01orcl

Sep 14 21:59:35 2016 [1-1] backing up current control file on c01orcl


### The following error was encountered:

alter database backup controlfile to '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/PRU_0001_c01orcl_f.f'

*

ERROR at line 1:

ORA-00245: control file backup failed; target is likely on a local file system


### The offending sql code in its entirety:

set pagesize 0 feedback off verify off heading off echo off tab off

whenever sqlerror exit sql.sqlcode

alter database backup controlfile to '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/PRU_0001_c01orcl_f.f';

exit;


Sep 14 21:59:40 2016 [1-1] ERROR: failed to backup control file on database c01orcl


报错可能是由于physru.sh遇到未公开发布的Bug12753750Bug14174798Bug12694192中的一个或多个所致。不做任何处理再次运行physru.sh

station11上执行(在出现提示“Please enter the sysdba password:”时输入“oracle_4U”):


[oracle@station11 ~]$ ./physru.sh sys c01orcl1 c02orcl1 c01orcl c02orcl 12.1.0.2.0

Please enter the sysdba password:


### Initialize script to either start over or resume execution

Sep 14 22:01:52 2016 [0-1] Identifying rdbms software version

Sep 14 22:01:52 2016 [0-1] database c01orcl is at version 11.2.0.4.0

Sep 14 22:01:53 2016 [0-1] database c02orcl is at version 11.2.0.4.0

Sep 14 22:01:54 2016 [0-1] verifying flashback database is enabled at c01orcl and c02orcl

Sep 14 22:01:55 2016 [0-1] verifying available flashback restore points

Sep 14 22:01:56 2016 [0-1] verifying DG Broker is disabled

Sep 14 22:01:56 2016 [0-1] looking up prior execution history

Sep 14 22:01:57 2016 [0-1] purging script execution state from database c01orcl

Sep 14 22:01:57 2016 [0-1] purging script execution state from database c02orcl


### The following error was encountered:

declare

*

ERROR at line 1:

ORA-16000: database open for read-only access

ORA-06512: at line 6


### The offending sql code in its entirety:

set pagesize 0 feedback off verify off heading off echo off tab off

whenever sqlerror exit sql.sqlcode

declare

cursor curs is

select name from v$restore_point where name like 'PRU_%';

begin

for r_curs in curs loop

execute immediate 'drop restore point ' || r_curs.name;

end loop;

end;

/

exit;


Sep 14 22:01:58 2016 [0-1] ERROR: failed to purge script state from database c02orcl


这次出错信息又变成别的了。但是这次看出来physru.sh正提醒我们关闭c02orclActive Data Guard功能,需要重新启动c02orclmount状态,并且开启Recover Managed Standby进程。照做后,还需要再删除两次出错遗留的痕迹:删除station13上的/u01/app/oracle/product/11.2.0/dbhome_1/dbs/PRU_0001_c02orcl_f.f(还要确认c02orcl的闪回区在+FRA)


station13上执行:


[oracle@station13 ~]$ srvctl stop database -d c02orcl

[oracle@station13 ~]$ srvctl start database -d c02orcl -o mount

[oracle@station13 ~]$ rm -f /u01/app/oracle/product/11.2.0/dbhome_1/dbs/PRU_0001_c02orcl_f.f


SQL> alter database recover managed standby database using current logfile disconnect;


Database altered.


SQL> alter system set db_recovery_file_dest=‘+FRA’;


System altered.


再次在station11上执行physru.sh(在出现提示“Please enter the sysdba password:”时输入“oracle_4U”):


[oracle@station11 ~]$ ./physru.sh sys c01orcl1 c02orcl1 c01orcl c02orcl 12.1.0.2.0

Please enter the sysdba password:


### Initialize script to either start over or resume execution

Sep 14 22:29:50 2016 [0-1] Identifying rdbms software version

Sep 14 22:29:50 2016 [0-1] database c01orcl is at version 11.2.0.4.0

Sep 14 22:29:50 2016 [0-1] database c02orcl is at version 11.2.0.4.0

Sep 14 22:29:52 2016 [0-1] verifying flashback database is enabled at c01orcl and c02orcl

Sep 14 22:29:52 2016 [0-1] verifying available flashback restore points

Sep 14 22:29:53 2016 [0-1] verifying DG Broker is disabled

Sep 14 22:29:54 2016 [0-1] looking up prior execution history

Sep 14 22:29:55 2016 [0-1] purging script execution state from database c01orcl

Sep 14 22:29:55 2016 [0-1] purging script execution state from database c02orcl

Sep 14 22:29:56 2016 [0-1] starting new execution of script


### Stage 1: Backup user environment in case rolling upgrade is aborted

Sep 14 22:29:56 2016 [1-1] creating restore point PRU_0000_0001 on database c02orcl

Sep 14 22:29:59 2016 [1-1] backing up current control file on c02orcl

Sep 14 22:30:03 2016 [1-1] created backup control file /u01/app/oracle/product/11.2.0/dbhome_1/dbs/PRU_0001_c02orcl_f.f

Sep 14 22:30:03 2016 [1-1] creating restore point PRU_0000_0001 on database c01orcl

Sep 14 22:30:06 2016 [1-1] backing up current control file on c01orcl

Sep 14 22:30:11 2016 [1-1] created backup control file /u01/app/oracle/product/11.2.0/dbhome_1/dbs/PRU_0001_c01orcl_f.f


NOTE: Restore point PRU_0000_0001 and backup control file PRU_0001_c02orcl_f.f

can be used to restore c02orcl back to its original state as a

physical standby, in case the rolling upgrade operation needs to be aborted

prior to the first switchover done in Stage 4.


### Stage 2: Create transient logical standby from existing physical standby

Sep 14 22:30:12 2016 [2-1] verifying RAC is disabled at c02orcl


WARN: c02orcl is a RAC database. Before this script can continue, you

must manually reduce the RAC to a single instance, disable the RAC, and

restart instance c02orcl1 in mounted mode. This can be accomplished

with the following steps:


1) Shutdown all instances other than instance c02orcl1.

eg: srvctl stop instance -d c02orcl -i c02orcl2 -o abort


2) On instance c02orcl1, set the cluster_database parameter to FALSE.

eg: SQL> alter system set cluster_database=false scope=spfile;


3) Shutdown instance c02orcl1.

eg: SQL> shutdown abort;


4) Startup instance c02orcl1 in mounted mode.

eg: SQL> startup mount;


Once these steps have been performed, enter 'y' to continue the script.

If desired, you may enter 'n' to exit the script to perform the required

steps, and recall the script to resume from this point.


Are you ready to continue? (y/n):


先不输入。

以上physru.sh执行过程说明如下:在Stage 1 中主备库各创建一个保障闪回还原点PRU_0000_0001PRU_0000_0001在后面的Stage 4(第一次Swithover)来临前都有效, 可将两个数据库回到升级前状态。 Stage 2 将要转换现有的物理Standby数据库c02orclTransient Logical Standby数据库。这一步是整个0停机升级过程的关键。只要转换成功,事务就仍能从主库源源不断同步到备库。physru.sh脚本中与这一步相关最关键的SQL语句如下:

脚本3779行到3809行(不能直接展示脚本内容,做了图像模糊处理):



脚本3811行到3866行(不能直接展示脚本内容,做了图像模糊处理):



分析以上两段脚本得知转换前物理Standby备库只能启动一个实例才能执行dbms_logstdby.build。其实也可以直接根据提示做以下准备工作:

station13上执行:


[oracle@station13 ~]$ srvctl stop instance -d c02orcl -i c02orcl2 -o abort

[oracle@station13 ~]$ sqlplus /nolog


SQL*Plus: Release 11.2.0.4.0 Production on Wed Sep 14 23:14:18 2016


Copyright (c) 1982, 2013, Oracle. All rights reserved.


SQL> conn / as sysdba

Connected.

SQL> alter system set cluster_database=false scope=spfile;


System altered.


SQL> shutdown abort

ORACLE instance shut down.

SQL> startup mount;

ORACLE instance started.


Total System Global Area 3023110144 bytes

Fixed Size 2257072 bytes

Variable Size 1291849552 bytes

Database Buffers 1711276032 bytes

Redo Buffers 17727488 bytes

Database mounted.

SQL>


回到station11上,输入“y”


Are you ready to continue? (y/n): y


Sep 14 23:16:10 2016 [2-1] continuing

Sep 14 23:16:10 2016 [2-1] verifying RAC is disabled at c02orcl

Sep 14 23:16:10 2016 [2-1] verifying database roles

Sep 14 23:16:11 2016 [2-1] verifying physical standby is mounted

Sep 14 23:16:11 2016 [2-1] verifying database protection mode

Sep 14 23:16:11 2016 [2-1] verifying transient logical standby datatype support


WARN: Objects have been identified on the primary database which will not be

replicated on the transient logical standby. The complete list of

objects and their associated unsupported datatypes can be found in the

dba_logstdby_unsupported view. For convenience, this script has written

the contents of this view to a file - physru_unsupported.log.


Various options exist to deal with these objects such as:

- disabling applications that modify these objects

- manually resolving these objects after the upgrade

- extending support to these objects (see metalink note: 559353.1)


If you need time to review these options, you should enter 'n' to exit

the script. Otherwise, you should enter 'y' to continue with the

rolling upgrade.


Are you ready to proceed with the rolling upgrade? (y/n):


逻辑Standby有许多对象是不支持主备库同步的。在继续 physru.sh脚本前,请查看station11/home/oracle/physru_unsupported.log(即调用physru.sh的位置)会列出这些对象。这些对象包括:sys拥有的对象、用以支持物化视图的表、全局临时表、带压缩的表和包含bfile,rowid,urowid等字段类型的表等等。

只要生产环境不涉及这些对象,就可以安全回答"y"。如果涉及这些对象,就要额外考虑这些对象的同步问题,再回答"y"。本文附录中有physru_unsupported.log全文。

回到station11上,输入“y”


Are you ready to proceed with the rolling upgrade? (y/n): y


Sep 14 23:27:25 2016 [2-1] continuing

Sep 14 23:27:26 2016 [2-2] starting media recovery on c02orcl

Sep 14 23:27:35 2016 [2-2] confirming media recovery is running

Sep 14 23:27:38 2016 [2-2] waiting for apply lag to fall under 30 seconds

Sep 14 23:28:00 2016 [2-2] apply lag measured at 21 seconds

Sep 14 23:28:00 2016 [2-2] stopping media recovery on c02orcl

Sep 14 23:28:01 2016 [2-2] executing dbms_logstdby.build on database c01orcl

Sep 14 23:29:32 2016 [2-2] converting physical standby into transient logical standby

Sep 14 23:30:00 2016 [2-3] opening database c02orcl

./physru.sh: line 3337: warning: here-document at line 3332 delimited by end-of-file (wanted `EOF')

Sep 14 23:30:19 2016 [2-4] configuring transient logical standby parameters for rolling upgrade

Sep 14 23:30:21 2016 [2-4] starting logical standby on database c02orcl

Sep 14 23:30:28 2016 [2-4] waiting until logminer dictionary has fully loaded

Sep 14 23:31:01 2016 [2-4] dictionary load 03% complete

Sep 14 23:31:11 2016 [2-4] dictionary load 06% complete

Sep 14 23:31:22 2016 [2-4] dictionary load 14% complete

Sep 14 23:31:32 2016 [2-4] dictionary load 24% complete

Sep 14 23:31:43 2016 [2-4] dictionary load 27% complete

Sep 14 23:31:53 2016 [2-4] dictionary load 33% complete

Sep 14 23:32:03 2016 [2-4] dictionary load 38% complete

Sep 14 23:32:14 2016 [2-4] dictionary load 45% complete

Sep 14 23:32:24 2016 [2-4] dictionary load 46% complete

Sep 14 23:32:35 2016 [2-4] dictionary load 56% complete

Sep 14 23:32:45 2016 [2-4] dictionary load 61% complete

Sep 14 23:32:55 2016 [2-4] dictionary load 62% complete

Sep 14 23:34:08 2016 [2-4] dictionary load 70% complete

Sep 14 23:34:28 2016 [2-4] dictionary load 75% complete

Sep 14 23:34:49 2016 [2-4] dictionary load 99% complete

Sep 14 23:35:00 2016 [2-4] dictionary load is complete

Sep 14 23:35:02 2016 [2-4] waiting for apply lag to fall under 30 seconds

Sep 14 23:35:20 2016 [2-4] apply lag measured at 17 seconds


NOTE: Database c02orcl is now ready to be upgraded. This script has left the

database open in case you want to perform any further tasks before

upgrading the database. Once the upgrade is complete, the database must

opened in READ WRITE mode before this script can be called to resume the

rolling upgrade.


NOTE: Database c02orcl may be reverted back to a RAC database upon completion

of the rdbms upgrade. This can be accomplished by performing the

following steps:


1) On instance c02orcl1, set the cluster_database parameter to TRUE.

eg: SQL> alter system set cluster_database=true scope=spfile;


2) Shutdown instance c02orcl1.

eg: SQL> shutdown abort;


3) Startup and open all instances for database c02orcl.

eg: srvctl start database -d c02orcl


[oracle@station11 ~]$


到此 physru.sh的第一执行成功结束。也意味着升级过程到达stage2c02orcl变成Logical Standby

station11上查看:


[oracle@station11 ~]$ sqlplus /nolog


SQL*Plus: Release 11.2.0.4.0 Production on Fri Sep 16 18:20:26 2016


Copyright (c) 1982, 2013, Oracle. All rights reserved.


SQL> conn / as sysdba

Connected.

SQL> set linesize 1000

SQL> select NAME, DB_UNIQUE_NAME, DATABASE_ROLE,PROTECTION_MODE,CONTROLFILE_TYPE from v$database;


NAME DB_UNIQUE_NAME DATABASE_ROLE PROTECTION_MODE CONTROL

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

C01ORCL c01orcl PRIMARY MAXIMUM PERFORMANCE CURRENT


station11上查看脚本执行过程中的/u01/app/oracle/diag/rdbms/c01orcl/c01orcl1/trace/alert_c01orcl1.log


Wed Sep 14 23:27:37 2016

......

Wed Sep 14 23:28:02 2016

alter database add supplemental log data (primary key, unique index) columns

Wed Sep 14 23:28:02 2016

SUPLOG: Previous supplemental logging attributes at scn = 2586473

SUPLOG: minimal = OFF, primary key = OFF

SUPLOG: unique = OFF, foreign key = OFF, all column = OFF

SUPLOG: procedural replication = OFF

SUPLOG: New supplemental logging attributes at scn = 2586484

SUPLOG: minimal = ON, primary key = ON

SUPLOG: unique = ON, foreign key = OFF, all column = OFF

SUPLOG: procedural replication = OFF

Completed: alter database add supplemental log data (primary key, unique index) columns

alter database add supplemental log data for procedural replication

SUPLOG: Previous supplemental logging attributes at scn = 2586514

SUPLOG: minimal = ON, primary key = ON

SUPLOG: unique = ON, foreign key = OFF, all column = OFF

SUPLOG: procedural replication = OFF

SUPLOG: New supplemental logging attributes at scn = 2586514

SUPLOG: minimal = ON, primary key = ON

SUPLOG: unique = ON, foreign key = OFF, all column = OFF

SUPLOG: procedural replication = ON

Completed: alter database add supplemental log data for procedural replication

Wed Sep 14 23:28:10 2016

Logminer Bld: Build started

......

Logminer Bld: Lockdown Complete. DB_TXN_SCN is 0 2586504 LockdownSCN is 2586597

......

Wed Sep 14 23:29:24 2016

Wed Sep 14 23:29:24 2016

Logminer Bld: Done

LOGMINER: Dictionary Build: Waiting for txns in-flight at scn 0x0000.002777e5 [2586597] to complete

LOGMINER: Dictionary Build: All in-flight txns at scn 0x0000.002777e5 [2586597] completed

......


station13上查看:


[oracle@station13 ~]$ sqlplus /nolog


SQL*Plus: Release 11.2.0.4.0 Production on Fri Sep 16 18:14:57 2016


Copyright (c) 1982, 2013, Oracle. All rights reserved.


SQL> conn / as sysdba

Connected.

SQL> set linesize 1000

SQL> select NAME, DB_UNIQUE_NAME, DATABASE_ROLE,PROTECTION_MODE,CONTROLFILE_TYPE from v$database;


NAME DB_UNIQUE_NAME DATABASE_ROLE PROTECTION_MODE CONTROL

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

C01ORCL c02orcl LOGICAL STANDBY MAXIMUM PERFORMANCE CURRENT


SQL>


station13上查看脚本执行过程中的/u01/app/oracle/diag/rdbms/c01orcl/c01orcl1/trace/alert_c01orcl1.log


Wed Sep 14 23:27:26 2016

Created guaranteed restore point PRU_0201

Wed Sep 14 23:27:26 2016

alter database recover managed standby database using current logfile through next switchover disconnect

Attempt to start background Managed Standby Recovery process (c02orcl1)

Wed Sep 14 23:27:27 2016

MRP0 started with pid=29, OS id=1824

MRP0: Background Managed Standby Recovery process started (c02orcl1)

started logmerger process

Wed Sep 14 23:27:32 2016

Managed Standby Recovery starting Real Time Apply

Parallel Media Recovery started with 8 slaves

Waiting for all non-current ORLs to be archived...

All non-current ORLs have been archived.

......

Completed: alter database recover managed standby database using current logfile through next switchover disconnect

......

Wed Sep 14 23:28:00 2016

alter database recover managed standby database cancel

MRP0: Background Media Recovery cancelled with status 16037

......

alter database recover to logical standby keep identity

Media Recovery Start: Managed Standby Recovery (c02orcl1)

started logmerger process

Wed Sep 14 23:29:32 2016

Managed Standby Recovery not using Real Time Apply

......

Incomplete Recovery applied until change 2591737 time 09/14/2016 23:29:25

Wed Sep 14 23:29:54 2016

Media Recovery Complete (c02orcl1)

Wed Sep 14 23:29:54 2016

Killing 6 processes with pids 30526,29884,29821,29825,29827,29841 (all RFS) in order to disallow current and future RFS connections. Requested by OS process 29619

Begin: Standby Redo Logfile archival

End: Standby Redo Logfile archival

RESETLOGS after incomplete recovery UNTIL CHANGE 2591737

......

Wed Sep 14 23:29:57 2016

Setting recovery target incarnation to 3

RECOVER TO LOGICAL STANDBY: Complete - Database mounted as logical standby

Completed: alter database recover to logical standby keep identity

Wed Sep 14 23:29:59 2016

Created guaranteed restore point PRU_0202

Wed Sep 14 23:30:00 2016

alter database open

Wed Sep 14 23:30:01 2016

......

Wed Sep 14 23:30:08 2016

QMNC started with pid=38, OS id=2620

LOGSTDBY: Validating controlfile with logical metadata

LOGSTDBY: Validation skipped -- detected logical instantiation

LOGSTDBY: Validation complete

Wed Sep 14 23:30:11 2016

LOGSTDBY: skipping logfile pre-registration due to in-progress instantiation

Completed: alter database open

Wed Sep 14 23:30:17 2016

......

Created guaranteed restore point PRU_0203

Wed Sep 14 23:30:20 2016

LOGSTDBY: APPLY_SET: LOG_AUTO_DELETE changed to FALSE

LOGSTDBY: APPLY_SET: MAX_EVENTS_RECORDED changed to 2000000000

LOGSTDBY: APPLY_SET: RECORD_UNSUPPORTED_OPERATIONS changed to TRUE

LOGSTDBY: APPLY_SET: MAX_SERVERS changed to 15

LOGSTDBY: APPLY_SET: MAX_SGA changed to 50

Wed Sep 14 23:30:21 2016

alter database start logical standby apply immediate

LOGSTDBY: Creating new session for dbid 964239646 starting at scn 0x0000.00000000

LOGSTDBY: Created session of id 1

LOGSTDBY: Attempting to pre-register dictionary build logfiles

......

ALTER DATABASE START LOGICAL STANDBY APPLY (c02orcl1)

with optional part

IMMEDIATE

Attempt to start background Logical Standby process

LOGSTDBY parameters set by user:

LOGSTDBY MAX_SGA = 50

LOGSTDBY MAX_SERVERS = 15

LOGSTDBY MAX_EVENTS_RECORDED = 2000000000

LOGSTDBY RECORD_UNSUPPORTED_OPERATIONS = TRUE

LOGSTDBY LOG_AUTO_DELETE = FALSE

Wed Sep 14 23:30:22 2016

LSP0 started with pid=47, OS id=2703

Completed: alter database start logical standby apply immediate

LOGMINER: Parameters summary for session# = 1

LOGMINER: Number of processes = 3, Transaction Chunk Size = 201

LOGMINER: Memory Size = 50M, Checkpoint interval = 250M

LOGMINER: SpillScn 0, ResetLogScn 0

Wed Sep 14 23:30:44 2016

RFS LogMiner: RFS id [2826] assigned as thread [1] PING handler

......

LOGMINER: summary for session# = 1

LOGMINER: StartScn: 2586597 (0x0000.002777e5)

LOGMINER: EndScn: 0 (0x0000.00000000)

LOGMINER: HighConsumedScn: 2591736 (0x0000.00278bf8)

LOGMINER: session_flag: 0x1

LOGMINER: Read buffers: 16

LOGMINER: Memory LWM: limit 10M, LWM 40M, 80%

LOGMINER: Memory Release Limit: 1M

......

LOGMINER: Begin mining logfile during dictionary load for session 1 thread 1 sequence 435, +FRA/c02orcl/foreign_archivelog/c01orcl/2016_09_14/thread_1_seq_435.1038.922577449

......

Wed Sep 14 23:32:26 2016

Archived Log entry 877 added for thread 1 sequence 2 ID 0x39a1ba05 dest 1:

Wed Sep 14 23:32:45 2016

LOGMINER: End mining logfile during dictionary load for session 1 thread 1 sequence 435, +FRA/c02orcl/foreign_archivelog/c01orcl/2016_09_14/thread_1_seq_435.1038.922577449

LOGMINER: Begin mining logfile during dictionary load for session 1 thread 1 sequence 436, +FRA/c02orcl/foreign_archivelog/c01orcl/2016_09_14/thread_1_seq_436.1037.922577449

......

LOGMINER: Gathering statistics on logminer dictionary. (100)

Wed Sep 14 23:34:51 2016

LOGMINER: End mining logfiles during dictionary load for session 1

Wed Sep 14 23:34:53 2016

LSP2 started with pid=88, OS id=4535

Wed Sep 14 23:34:57 2016

LOGMINER: Begin mining logfile during commit scan for session 1 thread 1 sequence 435, +FRA/c02orcl/foreign_archivelog/c01orcl/2016_09_14/thread_1_seq_435.1038.922577449

LOGMINER: Begin mining logfile during commit scan for session 1 thread 2 sequence 370, +FRA/c02orcl/foreign_archivelog/c01orcl/2016_09_14/thread_2_seq_370.1040.922577473

......

LOGSTDBY Analyzer process AS00 started with server id=0 pid=90 OS id=4584

Wed Sep 14 23:35:06 2016

......

Wed Sep 14 23:35:21 2016

Created guaranteed restore point PRU_0204

......


最后,如果执行physru.sh脚本出错。我们需要 c02orcl回到第一次执行前的状态。使用以下步骤把Transient Logical Standby数据库转回物理Standby数据库:


1. 闪回Transient Logical Standby到保障闪回还原点PRU_0000_0001

SQL> STARTUP MOUNT FORCE

SQL> FLASHBACK DATABASE TO RESTORE POINT PRU_0000_0001;

SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;

SQL> SHUTDOWN ABORT

2. 如果Transient Logical Standby数据库已经升级成12c,需要用11.2.0.4的软件启动它到mount

SQL> ALTER SYSTEM SET _TRANSIENT_LOGICAL_CLEAR_HOLD_MRP_BIT=TRUE;

SQL> FLASHBACK DATABASE TO RESTORE POINT PRU_0000_0001;

SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;

SQL> SHUTDOWN ABORT

3. 开启Redo Apply:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE [USING CURRENT LOGFILE] DISCONNECT;

4. 主备库都移除保障闪回还原点PRU_0000_0001


3.4 Transient Logical Standby上执行dbua

因为dbua要求c02orcl所有实例都要启动,所以我们需要把被physru.sh脚本折腾成单实例的c02orcl重新启动成RAC数据库。

3.3physr.sh脚本执行完后,由于未说明的Bug ,在station13上的/u01/app/oracle/product/11.2.0/dbhome_1/dbs目录下会生成一个多余的spfilec02orcl1.ora文件。这个文件破坏了c02orcl数据库的正确配置,请一定将其删除station13上执行:


[oracle@station13 ~]$ rm -f /u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfilec02orcl1.ora

[oracle@station13 ~]$ srvctl stop database -d c02orcl -o abort

[oracle@station13 ~]$ srvctl start database -d c02orcl


确保“+FRA/C02ORCL/foreign_archivelog/c01orcl/”有从c01orcl传送来的所有日志,确保 c02orcl上的Logical Standby Apply紧紧跟随主库,在station13上执行:


[oracle@station13 ~]$ sqlplus /nolog


SQL*Plus: Release 11.2.0.4.0 Production on Fri Sep 16 22:39:21 2016


Copyright (c) 1982, 2013, Oracle. All rights reserved.


SQL> conn / as sysdba

Connected.

SQL> select APPLIED_SCN,LATEST_SCN, MINING_SCN from v$logstdby_progress;


APPLIED_SCN LATEST_SCN MINING_SCN

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

2908820 2908769 2908821


SQL>


确保 LATEST_SCN<=APPLIED_SCN,在c01orcl上更新一个表做下测试Real Time Logical Apply


[oracle@station11 ~]$ sqlplus /nolog


SQL*Plus: Release 11.2.0.4.0 Production on Fri Sep 16 22:56:54 2016


Copyright (c) 1982, 2013, Oracle. All rights reserved.


SQL> conn hr/oracle_4U

Connected.

SQL> update employees set salary=9999 where employee_id=109;


1 row updated.


SQL> commit;


Commit complete.



[oracle@station13 ~]$ sqlplus /nolog


SQL*Plus: Release 11.2.0.4.0 Production on Fri Sep 16 22:57:33 2016


Copyright (c) 1982, 2013, Oracle. All rights reserved.


SQL> conn hr/oracle_4U

Connected.

SQL> select salary from employees where employee_id=109;


SALARY

----------

9999


station11station12station13station14都以oracle用户预先采用“software-only installation”选项在/u01/app/oracle/product/12.1.0/dbhome_1目录下安装了12.1.0.2.0版本的数据库软件。c02orcl这个Transient Logical Standby数据库已经准备好从11.2.0.4升级到12c了。我们将使用dbua这个工具来进行升级。


station13图形界面上以oracle用户执行:


[oracle@station13 ~]$ /u01/app/oracle/product/12.1.0/dbhome_1/bin/dbua &










在进度条运行过程中,我们也可以到此目录下/u01/app/oracle/cfgtoollogs/dbua/c02orcl/upgrade1看日志。在截屏所示的Pre Upgrade Steps”的这一步,c02orcl数据库会自动被关闭。然后只有一个实例启动起来以进行之后的升级。

在备库c02orcl升级过程中,主库c01orcl依然打开着支持前台业务所有在主库上执行的事务将仍然能够在c02orcl升级后应用在它身上。为了证明这一点,就在此刻,我们在c01orcl上执行:


SQL> create table t12c as select * from employees;


Table created.


SQL>


c02orcl升级之后我们要在c02orclTransient Logical Standby)上去找这个表。



到此station13station14这两台主机上的c02orcl成功升级完成,请把station13/home/oracle/.bash_profile文件以oracle用户改成:


# .bash_profile


# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi


# User specific environment and startup programs


PATH=$PATH:$HOME/bin


export PATH

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1

export ORACLE_SID=c02orcl1

export TNS_ADMIN=/u01/app/12.1.0/grid/network/admin

export NLS_LANG=american_america.AL32UTF8

export ORACLE_TERM=xterm

export EDITOR=vi

export PATH=$ORACLE_HOME/bin:$PATH

export LANG=en_US


改后要以oracle用户使其生效:


. .bash_profile


请把station14/home/oracle/.bash_profile文件以oracle用户改成:


# .bash_profile


# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi


# User specific environment and startup programs


PATH=$PATH:$HOME/bin


export PATH

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1

export ORACLE_SID=c02orcl2

export TNS_ADMIN=/u01/app/12.1.0/grid/network/admin

export NLS_LANG=american_america.AL32UTF8

export ORACLE_TERM=xterm

export EDITOR=vi

export PATH=$ORACLE_HOME/bin:$PATH

export LANG=en_US


改后要以oracle用户使其生效:


. .bash_profile


station13上的/etc/oratab文件内容从:


c02orcl1:/u01/app/oracle/product/11.2.0/dbhome_1:N # line added by Agent

+ASM1:/u01/app/12.1.0/grid:N # line added by Agent

-MGMTDB:/u01/app/12.1.0/grid:N # line added by Agent

c02orcl:/u01/app/oracle/product/12.1.0/dbhome_1:N # line added by Agent


改成:


+ASM1:/u01/app/12.1.0/grid:N # line added by Agent

-MGMTDB:/u01/app/12.1.0/grid:N # line added by Agent

c02orcl1:/u01/app/oracle/product/12.1.0/dbhome_1:N # line added by Agent


station14上的/etc/oratab文件内容从:


c02orcl2:/u01/app/oracle/product/11.2.0/dbhome_1:N # line added by Agent

+ASM2:/u01/app/12.1.0/grid:N # line added by Agent

c02orcl:/u01/app/oracle/product/12.1.0/dbhome_1:N # line added by Agent


改成:


+ASM2:/u01/app/12.1.0/grid:N # line added by Agent

c02orcl2:/u01/app/oracle/product/12.1.0/dbhome_1:N # line added by Agent


c02orcl做一下验证:


[oracle@station13 ~]$ srvctl config database -d c02orcl -v

Database unique name: c02orcl

Database name:

Oracle home: /u01/app/oracle/product/12.1.0/dbhome_1

Oracle user: oracle

Spfile: +DATA/c02orcl/spfilec02orcl.ora

Password file:

Domain: example.com

Start options: open

Stop options: immediate

Database role: PHYSICAL_STANDBY

Management policy: AUTOMATIC

Server pools:

Disk Groups: DATA,FRA

Mount point paths:

Services:

Type: RAC

Start concurrency:

Stop concurrency:

OSDBA group: dba

OSOPER group: oper

Database instances: c02orcl1,c02orcl2

Configured nodes: station13,station14

Database is administrator managed

[oracle@station13 ~]$ srvctl status database -d c02orcl

Instance c02orcl1 is running on node station13

Instance c02orcl2 is running on node station14


Database role”显示成“PHYSICAL_STANDBY”是最早11.2.0.4MAA注册在集群件里造成的,不必介意。数据库真实的role是“Transient Logical Standby”

下面来更新12c目录下的网络配置文件:


[oracle@station13 ~]$ cp /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/tnsnames.ora


[oracle@station14 ~]$ cp /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/tnsnames.ora


station13上以grid用户,把/u01/app/12.1.0/grid/network/admin/listener.ora文件改成:


MGMTLSNR=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=MGMTLSNR)))) # line added by Agent

# listener.ora Network Configuration File: /u01/app/12.1.0/grid/network/admin/listener.ora

# Generated by Oracle configuration tools.


ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN3 = ON


ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN2 = ON


ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1 = ON


SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = c02orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c02orcl1)

)

(SID_DESC =

(GLOBAL_DBNAME = c02orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c02orcl2)

)

(SID_DESC =

(GLOBAL_DBNAME = c02orcl.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c02orcl1)

)

)


SID_LIST_LISTENER_SCAN3 =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = c02orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c02orcl1)

)

(SID_DESC =

(GLOBAL_DBNAME = c02orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c02orcl2)

)

)


SID_LIST_LISTENER_SCAN2 =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = c02orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c02orcl1)

)

(SID_DESC =

(GLOBAL_DBNAME = c02orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c02orcl2)

)

)


SID_LIST_LISTENER_SCAN1 =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = c02orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c02orcl1)

)

(SID_DESC =

(GLOBAL_DBNAME = c02orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c02orcl2)

)

)


LISTENER =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER))

)


ADR_BASE_LISTENER = /u01/app/grid


ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER = ON


LISTENER_SCAN3 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN3))

)


LISTENER_SCAN2 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN2))

)


ADR_BASE_LISTENER_SCAN3 = /u01/app/grid


LISTENER_SCAN1 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN1))

)


ADR_BASE_LISTENER_SCAN2 = /u01/app/grid


ADR_BASE_LISTENER_SCAN1 = /u01/app/grid


VALID_NODE_CHECKING_REGISTRATION_LISTENER=SUBNET # line added by Agent

VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN1=OFF # line added by Agent

VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN3=OFF # line added by Agent

VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN2=OFF # line added by Agent

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_MGMTLSNR=ON # line added by Agent

VALID_NODE_CHECKING_REGISTRATION_MGMTLSNR=SUBNET # line added by Agent


station14上以grid用户,把/u01/app/12.1.0/grid/network/admin/listener.ora文件改成:


SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = c02orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c02orcl1)

)

(SID_DESC =

(GLOBAL_DBNAME = c02orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c02orcl2)

)

)


SID_LIST_LISTENER_SCAN3 =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = c02orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c02orcl1)

)

(SID_DESC =

(GLOBAL_DBNAME = c02orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c02orcl2)

)

)


SID_LIST_LISTENER_SCAN2 =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = c02orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c02orcl1)

)

(SID_DESC =

(GLOBAL_DBNAME = c02orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c02orcl2)

)

)


SID_LIST_LISTENER_SCAN1 =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = c02orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c02orcl1)

)

(SID_DESC =

(GLOBAL_DBNAME = c02orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c02orcl2)

)

)


LISTENER =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER))

)


ADR_BASE_LISTENER = /u01/app/grid


ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER = ON


LISTENER_SCAN3 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN3))

)


LISTENER_SCAN2 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN2))

)


ADR_BASE_LISTENER_SCAN3 = /u01/app/grid


LISTENER_SCAN1 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN1))

)


ADR_BASE_LISTENER_SCAN2 = /u01/app/grid


ADR_BASE_LISTENER_SCAN1 = /u01/app/grid


ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN2=ON # line added by Agent

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN3=ON # line added by Agent

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent

VALID_NODE_CHECKING_REGISTRATION_LISTENER=SUBNET # line added by Agent

VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN1=OFF # line added by Agent

VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN3=OFF # line added by Agent


station13上以grid用户执行:


[grid@station13 ~]$ srvctl stop listener

[grid@station13 ~]$ srvctl start listener


确保“+FRA/C02ORCL/foreign_archivelog/c01orcl/”有从c01orcl传送来的所有日志,确保 c02orcl上的Logical Standby Apply紧紧跟随主库station13上执行:


[oracle@station13 trace]$ sqlplus /nolog


SQL*Plus: Release 12.1.0.2.0 Production on Sat Sep 17 17:26:35 2016


Copyright (c) 1982, 2014, Oracle. All rights reserved.


SQL> conn / as sysdba

Connected.

SQL> alter database start logical standby apply immediate ;


Database altered.


SQL> select APPLIED_SCN,LATEST_SCN, MINING_SCN from v$logstdby_progress;


APPLIED_SCN LATEST_SCN MINING_SCN

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

3039226 3039219 3039227


SQL>


确保 LATEST_SCN<=APPLIED_SCN,验证但是在c01orcl建的表t12c是否存在


[oracle@station13 ~]$ sqlplus /nolog


SQL*Plus: Release 11.2.0.4.0 Production on Fri Sep 16 22:57:33 2016


Copyright (c) 1982, 2013, Oracle. All rights reserved.


SQL> conn hr/oracle_4U

Connected.

SQL> select * from t12c;


EMPLOYEE_ID FIRST_NAME LAST_NAME

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

EMAIL PHONE_NUMBER HIRE_DATE JOB_ID

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

SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID

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

189 Jennifer Dilly

JDILLY 650.505.2876 13-AUG-05 SH_CLERK

3600 122 50


190 Timothy Gates

...


3.5 第二次执行physru.sh

station11上执行(在出现提示“Please enter the sysdba password:”时输入“oracle_4U”):


[oracle@station11 ~]$ ./physru.sh sys c01orcl1 c02orcl1 c01orcl c02orcl 12.1.0.2.0

Please enter the sysdba password:


### Initialize script to either start over or resume execution

Sep 17 18:14:27 2016 [0-1] Identifying rdbms software version

Sep 17 18:14:27 2016 [0-1] database c01orcl is at version 11.2.0.4.0

Sep 17 18:14:28 2016 [0-1] database c02orcl is at version 12.1.0.2.0

Sep 17 18:14:30 2016 [0-1] verifying flashback database is enabled at c01orcl and c02orcl

Sep 17 18:14:31 2016 [0-1] verifying available flashback restore points

Sep 17 18:14:32 2016 [0-1] verifying DG Broker is disabled

Sep 17 18:14:32 2016 [0-1] looking up prior execution history

Sep 17 18:14:34 2016 [0-1] last completed stage [2-4] using script version 0001

Sep 17 18:14:34 2016 [0-1] resuming execution of script


### Stage 3: Validate upgraded transient logical standby

Sep 17 18:14:34 2016 [3-1] database c02orcl is no longer in OPEN MIGRATE mode

Sep 17 18:14:34 2016 [3-1] database c02orcl is at version 12.1.0.2.0


### Stage 4: Switch the transient logical standby to be the new primary

Sep 17 18:14:39 2016 [4-1] waiting for c02orcl to catch up (this could take a while)

Sep 17 18:14:42 2016 [4-1] waiting for apply lag to fall under 30 seconds

Sep 17 18:15:07 2016 [4-1] apply lag measured at 22 seconds

Sep 17 18:15:09 2016 [4-2] switching c01orcl to become a logical standby

Sep 17 18:15:44 2016 [4-2] c01orcl is now a logical standby

Sep 17 18:15:46 2016 [4-3] waiting for standby c02orcl to process end-of-redo from primary

Sep 17 18:15:50 2016 [4-4] switching c02orcl to become the new primary

Sep 17 18:17:18 2016 [4-4] c02orcl is now the new primary


### Stage 5: Flashback former primary to pre-upgrade restore point and convert to physical

Sep 17 18:17:36 2016 [5-1] verifying instance c01orcl1 is the only active instance


WARN: c01orcl is a RAC database. Before this script can continue, you

must manually reduce the RAC to a single instance. This can be

accomplished with the following step:


1) Shutdown all instances other than instance c01orcl1.

eg: srvctl stop instance -d c01orcl -i c01orcl2 -o abort


Once these steps have been performed, enter 'y' to continue the script.

If desired, you may enter 'n' to exit the script to perform the required

steps, and recall the script to resume from this point.


Are you ready to continue? (y/n):


先不输入。

Stage 4中验证了c02orcl这个Transient Logical Standby数据库和主库c01orcl同步。在Stage 4的最后,执行标准的Dataguard Switchover,使c02orcl成为新主库,而c01orcl成为新的Transient Logical Standby数据库。在Stage 5中,c01orcl将闪回到之前的保障闪回还原点PRU_0000_0001。这样使c01orcl回到物理Standby的状态,并能在之后的 Media Recovery过程中紧紧地跟随上c02orcl。为此目的需要在station11上执行:


[oracle@station11 ~]$ srvctl stop instance -d c01orcl -i c01orcl2 -o abort


回到执行physru.sh的窗口:


Are you ready to continue? (y/n): y


Sep 17 18:26:24 2016 [5-1] continuing

Sep 17 18:26:24 2016 [5-1] verifying instance c01orcl1 is the only active instance

Sep 17 18:26:25 2016 [5-1] shutting down database c01orcl

./physru.sh: line 3674: warning: here-document at line 3670 delimited by end-of-file (wanted `EOF')

Sep 17 18:27:56 2016 [5-1] mounting database c01orcl

./physru.sh: line 3301: warning: here-document at line 3296 delimited by end-of-file (wanted `EOF')

Sep 17 18:28:28 2016 [5-2] flashing back database c01orcl to restore point PRU_0000_0001

Sep 17 18:31:21 2016 [5-3] converting c01orcl into physical standby

Sep 17 18:31:28 2016 [5-4] shutting down database c01orcl

./physru.sh: line 3674: warning: here-document at line 3670 delimited by end-of-file (wanted `EOF')


NOTE: Database c01orcl has been shutdown, and is now ready to be started

using the newer version Oracle binary. This script requires the

database to be mounted (on all active instances, if RAC) before calling

this script to resume the rolling upgrade.


NOTE: Database c01orcl is no longer limited to single instance operation since

the database has been successfully converted into a physical standby.

For increased availability, Oracle recommends starting all instances in

the RAC on the newer binary by performing the following step:


1) Startup and mount all instances for database c01orcl

eg: srvctl start database -d c01orcl -o mount


3.6 手工重配置cluster01以便使用12.1.0.2数据库软件直接打开c01orclmount的状态

c01orcl已经闪回到之前的保障闪回还原点PRU_0000_0001。这样c01orcl已经由逻辑Standby回到物理Standby。如前所述station11station12station13station14都以oracle用户预先采用“software-only installation”选项在/u01/app/oracle/product/12.1.0/dbhome_1目录下安装了12.1.0.2.0版本的数据库软件。接下来,我们要手工重配置cluster01以便使用12.1.0.2数据库软件打开c01orclmount的状态。

station11上以oracle用户执行:


[oracle@station11 ~]$ cp /u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwc01orcl1 /u01/app/oracle/product/12.1.0/dbhome_1/dbs

[oracle@station11 ~]$ cp /u01/app/oracle/product/11.2.0/dbhome_1/dbs/initc01orcl1.ora /u01/app/oracle/product/12.1.0/dbhome_1/dbs


station12上以oracle用户执行:


[oracle@station12 ~]$ cp /u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwc01orcl2 /u01/app/oracle/product/12.1.0/dbhome_1/dbs/

[oracle@station12 ~]$ cp /u01/app/oracle/product/11.2.0/dbhome_1/dbs/initc01orcl2.ora /u01/app/oracle/product/12.1.0/dbhome_1/dbs


为了让12c数据库软件能够有权限访问ASM磁盘组。需要在station11station12上都以root用户执行setasmgid


[root@station11 ~]# . oraenv

ORACLE_SID = [root] ? +ASM1

The Oracle base has been set to /u01/app/grid

[root@station11 ~]# setasmgid o=/u01/app/oracle/product/12.1.0/dbhome_1/bin/oracle


[root@station12 ~]# . oraenv

ORACLE_SID = [root] ? +ASM2

The Oracle base has been set to /u01/app/grid

[root@station12 ~]# setasmgid o=/u01/app/oracle/product/12.1.0/dbhome_1/bin/oracle


GI中重新注册12cRAC数据库资源:


[oracle@station11 ~]$ /u01/app/oracle/product/11.2.0/dbhome_1/bin/srvctl remove database -d c01orcl

Remove the database c01orcl? (y/[n]) y

[oracle@station11 ~]$ /u01/app/oracle/product/12.1.0/dbhome_1/bin/srvctl add database -d c01orcl -o /u01/app/oracle/product/12.1.0/dbhome_1

[oracle@station11 ~]$ /u01/app/oracle/product/12.1.0/dbhome_1/bin/srvctl add instance -d c01orcl -i c01orcl1 -n station11

[oracle@station11 ~]$ /u01/app/oracle/product/12.1.0/dbhome_1/bin/srvctl add instance -d c01orcl -i c01orcl2 -n station12

[oracle@station11 ~]$ srvctl start database -d c01orcl -o mount


请把station11/home/oracle/.bash_profile文件以oracle用户改成:


# .bash_profile


# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi


# User specific environment and startup programs


PATH=$PATH:$HOME/bin


export PATH

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1

export ORACLE_SID=c01orcl1

export TNS_ADMIN=/u01/app/12.1.0/grid/network/admin

export NLS_LANG=american_america.AL32UTF8

export ORACLE_TERM=xterm

export EDITOR=vi

export PATH=$ORACLE_HOME/bin:$PATH

export LANG=en_US


改后要以oracle用户使其生效:


. .bash_profile


请把station12/home/oracle/.bash_profile文件以oracle用户改成:


# .bash_profile


# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi


# User specific environment and startup programs


PATH=$PATH:$HOME/bin


export PATH

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1

export ORACLE_SID=c01orcl2

export TNS_ADMIN=/u01/app/12.1.0/grid/network/admin

export NLS_LANG=american_america.AL32UTF8

export ORACLE_TERM=xterm

export EDITOR=vi

export PATH=$ORACLE_HOME/bin:$PATH

export LANG=en_US


改后要以oracle用户使其生效:


. .bash_profile


station11上的/etc/oratab文件内容改成:


+ASM1:/u01/app/12.1.0/grid:N # line added by Agent

-MGMTDB:/u01/app/12.1.0/grid:N # line added by Agent

c01orcl1:/u01/app/oracle/product/12.1.0/dbhome_1:N # line added by Agent


station12上的/etc/oratab文件内容改成:


+ASM2:/u01/app/12.1.0/grid:N # line added by Agent

c01orcl2:/u01/app/oracle/product/12.1.0/dbhome_1:N # line added by Agent


c01orcl做一下验证:


[oracle@station11 ~]$ srvctl config database -d c01orcl

Database unique name: c01orcl

Database name:

Oracle home: /u01/app/oracle/product/12.1.0/dbhome_1

Oracle user: oracle

Spfile:

Password file:

Domain: example.com

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools:

Disk Groups: DATA,FRA

Mount point paths:

Services:

Type: RAC

Start concurrency:

Stop concurrency:

OSDBA group: dba

OSOPER group: oper

Database instances: c01orcl1,c01orcl2

Configured nodes: station11,station12

Database is administrator managed


Database role”显示成“PRIMARY是最早11.2.0.4MAA注册在集群件里造成的,不必介意。数据库真实的role是“PHYSICAL_STANDBY”

下面来更新12c目录下的网络配置文件:


[oracle@station11 ~]$ cp /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/tnsnames.ora


[oracle@station12 ~]$ cp /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/tnsnames.ora


station11上以grid用户,把/u01/app/12.1.0/grid/network/admin/listener.ora文件改成:


MGMTLSNR=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=MGMTLSNR)))) # line added by Agent

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c01orcl1)

)

(SID_DESC =

(GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c01orcl2)

)

(SID_DESC =

(GLOBAL_DBNAME = c01orcl.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c01orcl1)

)

)


SID_LIST_LISTENER_SCAN3 =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c01orcl1)

)

(SID_DESC =

(GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c01orcl2)

)

)


SID_LIST_LISTENER_SCAN2 =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c01orcl1)

)

(SID_DESC =

(GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c01orcl2)

)

)


SID_LIST_LISTENER_SCAN1 =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c01orcl1)

)

(SID_DESC =

(GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c01orcl2)

)

)


LISTENER =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER))

)


ADR_BASE_LISTENER = /u01/app/grid


ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER = ON


LISTENER_SCAN3 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN3))

)


LISTENER_SCAN2 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN2))

)


ADR_BASE_LISTENER_SCAN3 = /u01/app/grid


LISTENER_SCAN1 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN1))

)


ADR_BASE_LISTENER_SCAN2 = /u01/app/grid


ADR_BASE_LISTENER_SCAN1 = /u01/app/grid


ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN2=ON # line added by Agent

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN3=ON # line added by Agent

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_MGMTLSNR=ON # line added by Agent

VALID_NODE_CHECKING_REGISTRATION_MGMTLSNR=SUBNET # line added by Agent

VALID_NODE_CHECKING_REGISTRATION_LISTENER=SUBNET # line added by Agent


station12上以grid用户,把/u01/app/12.1.0/grid/network/admin/listener.ora文件改成:


MGMTLSNR=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=MGMTLSNR)))) # line added by Agent

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c01orcl1)

)

(SID_DESC =

(GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c01orcl2)

)

)


SID_LIST_LISTENER_SCAN3 =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c01orcl1)

)

(SID_DESC =

(GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c01orcl2)

)

)


SID_LIST_LISTENER_SCAN2 =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c01orcl1)

)

(SID_DESC =

(GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c01orcl2)

)

)


SID_LIST_LISTENER_SCAN1 =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c01orcl1)

)

(SID_DESC =

(GLOBAL_DBNAME = c01orcl_DGMGRL.example.com)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = c01orcl2)

)

)


LISTENER =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER))

)


ADR_BASE_LISTENER = /u01/app/grid


ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER = ON


LISTENER_SCAN3 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN3))

)


LISTENER_SCAN2 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN2))

)


ADR_BASE_LISTENER_SCAN3 = /u01/app/grid


LISTENER_SCAN1 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN1))

)


ADR_BASE_LISTENER_SCAN2 = /u01/app/grid


ADR_BASE_LISTENER_SCAN1 = /u01/app/grid


ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN2=ON # line added by Agent

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN3=ON # line added by Agent

VALID_NODE_CHECKING_REGISTRATION_LISTENER=SUBNET # line added by Agent

VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN3=OFF # line added by Agent

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_MGMTLSNR=ON # line added by Agent

VALID_NODE_CHECKING_REGISTRATION_MGMTLSNR=SUBNET # line added by Agent

VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN1=OFF # line added by Agent


station11上以grid用户执行:


[grid@station11 ~]$ srvctl stop listener

[grid@station11 ~]$ srvctl start listener


由于生产环境在之前的过程中于 +FRA中积累了大量的日志,因此建议开始3.7步骤前,尽快把station11station12station13station14上的归档日志备份并移动到磁带机腾出+FRA的空间。以上建议也适用于我们的实验环境。


3.7 最后一次执行physru.sh

station11上执行(在出现提示“Please enter the sysdba password:”时输入“oracle_4U”):


[oracle@station11 ~]$ ./physru.sh sys c01orcl1 c02orcl1 c01orcl c02orcl 12.1.0.2.0

Please enter the sysdba password:


### Initialize script to either start over or resume execution

Sep 17 20:13:39 2016 [0-1] Identifying rdbms software version

Sep 17 20:13:40 2016 [0-1] database c01orcl is at version 12.1.0.2.0

Sep 17 20:13:40 2016 [0-1] database c02orcl is at version 12.1.0.2.0

Sep 17 20:13:44 2016 [0-1] verifying flashback database is enabled at c01orcl and c02orcl

Sep 17 20:13:45 2016 [0-1] verifying available flashback restore points

Sep 17 20:13:46 2016 [0-1] verifying DG Broker is disabled

Sep 17 20:13:47 2016 [0-1] looking up prior execution history

Sep 17 20:13:48 2016 [0-1] last completed stage [5-4] using script version 0001

Sep 17 20:13:48 2016 [0-1] resuming execution of script


### Stage 6: Run media recovery through upgrade redo

Sep 17 20:13:52 2016 [6-1] upgrade redo region identified as scn range [2609830, 4866568]

Sep 17 20:13:53 2016 [6-1] starting media recovery on c01orcl

Sep 17 20:14:04 2016 [6-1] confirming media recovery is running

Sep 17 20:14:05 2016 [6-1] waiting for media recovery to initialize v$recovery_progress

Sep 17 20:15:40 2016 [6-1] monitoring media recovery's progress

Sep 17 20:15:44 2016 [6-2] last applied scn 2587148 is approaching upgrade redo start scn 2609830

Sep 17 20:16:00 2016 [6-2] failed to determine the last applied scn by media recovery

Sep 17 20:16:00 2016 [6-2] confirming media recovery is running

Sep 17 20:16:18 2016 [6-2] last applied scn 2595979 is approaching upgrade redo start scn 2609830

Sep 17 20:16:35 2016 [6-2] last applied scn 2597985 is approaching upgrade redo start scn 2609830

Sep 17 20:16:52 2016 [6-2] last applied scn 2599788 is approaching upgrade redo start scn 2609830

Sep 17 20:17:09 2016 [6-2] last applied scn 2600006 is approaching upgrade redo start scn 2609830

Sep 17 20:17:27 2016 [6-2] last applied scn 2600025 is approaching upgrade redo start scn 2609830

Sep 17 20:17:44 2016 [6-2] last applied scn 2601861 is approaching upgrade redo start scn 2609830

Sep 17 20:18:01 2016 [6-2] last applied scn 2608158 is approaching upgrade redo start scn 2609830

Sep 17 20:20:01 2016 [6-3] recovery of upgrade redo at 01% - estimated complete at Sep 18 02:10:44

Sep 17 20:20:20 2016 [6-3] recovery of upgrade redo at 02% - estimated complete at Sep 17 23:36:52

Sep 17 20:20:58 2016 [6-3] recovery of upgrade redo at 03% - estimated complete at Sep 17 22:42:02

Sep 17 20:21:16 2016 [6-3] recovery of upgrade redo at 04% - estimated complete at Sep 17 22:34:29

Sep 17 20:22:32 2016 [6-3] recovery of upgrade redo at 05% - estimated complete at Sep 17 22:09:21

Sep 17 20:22:51 2016 [6-3] recovery of upgrade redo at 06% - estimated complete at Sep 17 22:10:44

Sep 17 20:23:29 2016 [6-3] recovery of upgrade redo at 07% - estimated complete at Sep 17 21:54:36

Sep 17 20:23:48 2016 [6-3] recovery of upgrade redo at 08% - estimated complete at Sep 17 21:53:05

Sep 17 20:24:26 2016 [6-3] recovery of upgrade redo at 09% - estimated complete at Sep 17 21:50:37

Sep 17 20:26:00 2016 [6-3] recovery of upgrade redo at 10% - estimated complete at Sep 17 21:57:37

Sep 17 20:26:57 2016 [6-3] recovery of upgrade redo at 11% - estimated complete at Sep 17 21:53:51

Sep 17 20:27:16 2016 [6-3] recovery of upgrade redo at 12% - estimated complete at Sep 17 21:49:55

Sep 17 20:28:12 2016 [6-3] recovery of upgrade redo at 13% - estimated complete at Sep 17 21:51:06

Sep 17 20:28:51 2016 [6-3] recovery of upgrade redo at 14% - estimated complete at Sep 17 21:49:40

Sep 17 20:29:28 2016 [6-3] recovery of upgrade redo at 15% - estimated complete at Sep 17 21:43:29

Sep 17 20:29:47 2016 [6-3] recovery of upgrade redo at 16% - estimated complete at Sep 17 21:43:06

Sep 17 20:30:45 2016 [6-3] recovery of upgrade redo at 17% - estimated complete at Sep 17 21:41:43

Sep 17 20:32:39 2016 [6-3] recovery of upgrade redo at 18% - estimated complete at Sep 17 21:46:15

Sep 17 20:32:58 2016 [6-3] recovery of upgrade redo at 19% - estimated complete at Sep 17 21:45:39

Sep 17 20:34:33 2016 [6-3] recovery of upgrade redo at 20% - estimated complete at Sep 17 21:48:16

Sep 17 20:35:49 2016 [6-3] recovery of upgrade redo at 21% - estimated complete at Sep 17 21:50:24

Sep 17 20:36:27 2016 [6-3] recovery of upgrade redo at 22% - estimated complete at Sep 17 21:47:34

Sep 17 20:36:46 2016 [6-3] recovery of upgrade redo at 23% - estimated complete at Sep 17 21:45:49

Sep 17 20:37:44 2016 [6-3] recovery of upgrade redo at 24% - estimated complete at Sep 17 21:44:47

Sep 17 20:38:03 2016 [6-3] recovery of upgrade redo at 25% - estimated complete at Sep 17 21:44:33

Sep 17 20:39:56 2016 [6-3] recovery of upgrade redo at 26% - estimated complete at Sep 17 21:48:45

Sep 17 20:42:46 2016 [6-3] recovery of upgrade redo at 27% - estimated complete at Sep 17 21:54:51

Sep 17 20:44:20 2016 [6-3] recovery of upgrade redo at 28% - estimated complete at Sep 17 21:57:18

Sep 17 20:44:39 2016 [6-3] recovery of upgrade redo at 29% - estimated complete at Sep 17 21:55:12

Sep 17 20:45:17 2016 [6-3] recovery of upgrade redo at 30% - estimated complete at Sep 17 21:52:54

Sep 17 20:45:54 2016 [6-3] recovery of upgrade redo at 31% - estimated complete at Sep 17 21:52:10

Sep 17 20:46:33 2016 [6-3] recovery of upgrade redo at 32% - estimated complete at Sep 17 21:50:25

Sep 17 20:47:11 2016 [6-3] recovery of upgrade redo at 33% - estimated complete at Sep 17 21:48:46

Sep 17 20:47:30 2016 [6-3] recovery of upgrade redo at 34% - estimated complete at Sep 17 21:48:19

Sep 17 20:48:26 2016 [6-3] recovery of upgrade redo at 35% - estimated complete at Sep 17 21:47:35

Sep 17 20:49:23 2016 [6-3] recovery of upgrade redo at 36% - estimated complete at Sep 17 21:46:56

Sep 17 20:50:00 2016 [6-3] recovery of upgrade redo at 37% - estimated complete at Sep 17 21:47:25

Sep 17 20:51:15 2016 [6-3] recovery of upgrade redo at 38% - estimated complete at Sep 17 21:48:53

Sep 17 20:51:53 2016 [6-3] recovery of upgrade redo at 39% - estimated complete at Sep 17 21:48:19

Sep 17 20:52:12 2016 [6-3] recovery of upgrade redo at 40% - estimated complete at Sep 17 21:45:23

Sep 17 20:52:31 2016 [6-3] recovery of upgrade redo at 41% - estimated complete at Sep 17 21:45:35

Sep 17 20:54:25 2016 [6-3] recovery of upgrade redo at 42% - estimated complete at Sep 17 21:46:16

Sep 17 20:54:44 2016 [6-3] recovery of upgrade redo at 43% - estimated complete at Sep 17 21:46:27

Sep 17 20:59:11 2016 [6-3] recovery of upgrade redo at 44% - estimated complete at Sep 17 21:54:03

Sep 17 21:03:01 2016 [6-3] recovery of upgrade redo at 45% - estimated complete at Sep 17 21:59:52

Sep 17 21:06:13 2016 [6-3] recovery of upgrade redo at 46% - estimated complete at Sep 17 22:05:21

Sep 17 21:08:06 2016 [6-3] recovery of upgrade redo at 47% - estimated complete at Sep 17 22:06:59

Sep 17 21:08:45 2016 [6-3] recovery of upgrade redo at 48% - estimated complete at Sep 17 22:05:15

Sep 17 21:09:04 2016 [6-3] recovery of upgrade redo at 49% - estimated complete at Sep 17 22:04:02

Sep 17 21:09:42 2016 [6-3] recovery of upgrade redo at 50% - estimated complete at Sep 17 22:03:10

Sep 17 21:10:21 2016 [6-3] recovery of upgrade redo at 52% - estimated complete at Sep 17 22:00:37

Sep 17 21:11:00 2016 [6-3] recovery of upgrade redo at 53% - estimated complete at Sep 17 21:59:28

Sep 17 21:11:38 2016 [6-3] recovery of upgrade redo at 54% - estimated complete at Sep 17 21:59:08

Sep 17 21:13:16 2016 [6-3] recovery of upgrade redo at 55% - estimated complete at Sep 17 22:00:18

Sep 17 21:17:40 2016 [6-3] recovery of upgrade redo at 57% - estimated complete at Sep 17 22:20:29

Sep 17 21:18:55 2016 [6-3] recovery of upgrade redo at 58% - estimated complete at Sep 17 22:22:20

Sep 17 21:20:11 2016 [6-3] recovery of upgrade redo at 59% - estimated complete at Sep 17 22:36:01

Sep 17 21:23:02 2016 [6-3] recovery of upgrade redo at 60% - estimated complete at Sep 17 22:59:50

Sep 17 21:26:30 2016 [6-3] recovery of upgrade redo at 61% - estimated complete at Sep 17 23:17:55

Sep 17 21:33:10 2016 [6-3] recovery of upgrade redo at 62% - estimated complete at Sep 17 23:54:39

Sep 17 21:35:59 2016 [6-3] recovery of upgrade redo at 63% - estimated complete at Sep 17 23:50:51

Sep 17 21:37:53 2016 [6-3] recovery of upgrade redo at 64% - estimated complete at Sep 17 23:41:21

Sep 17 21:39:28 2016 [6-3] recovery of upgrade redo at 65% - estimated complete at Sep 17 23:42:00

Sep 17 21:41:40 2016 [6-3] recovery of upgrade redo at 66% - estimated complete at Sep 17 23:34:29

Sep 17 21:42:18 2016 [6-3] recovery of upgrade redo at 67% - estimated complete at Sep 17 23:31:39

Sep 17 21:43:53 2016 [6-3] recovery of upgrade redo at 68% - estimated complete at Sep 17 23:27:10

Sep 17 21:44:50 2016 [6-3] recovery of upgrade redo at 69% - estimated complete at Sep 17 23:22:32

Sep 17 21:45:28 2016 [6-3] recovery of upgrade redo at 70% - estimated complete at Sep 17 23:17:49

Sep 17 21:46:06 2016 [6-3] recovery of upgrade redo at 71% - estimated complete at Sep 17 23:14:23

Sep 17 21:48:59 2016 [6-3] recovery of upgrade redo at 72% - estimated complete at Sep 17 23:16:44

Sep 17 21:50:34 2016 [6-3] recovery of upgrade redo at 73% - estimated complete at Sep 17 23:14:45

Sep 17 21:53:24 2016 [6-3] recovery of upgrade redo at 74% - estimated complete at Sep 17 23:15:42

Sep 17 21:54:59 2016 [6-3] recovery of upgrade redo at 75% - estimated complete at Sep 17 23:15:41

Sep 17 21:56:36 2016 [6-3] recovery of upgrade redo at 76% - estimated complete at Sep 17 23:15:15

Sep 17 21:58:31 2016 [6-3] recovery of upgrade redo at 77% - estimated complete at Sep 17 23:14:40

Sep 17 21:59:47 2016 [6-3] recovery of upgrade redo at 78% - estimated complete at Sep 17 23:12:46

Sep 17 22:00:25 2016 [6-3] recovery of upgrade redo at 79% - estimated complete at Sep 17 23:09:57

Sep 17 22:08:43 2016 [6-3] recovery of upgrade redo at 80% - estimated complete at Sep 17 23:22:56

Sep 17 22:13:10 2016 [6-3] recovery of upgrade redo at 81% - estimated complete at Sep 17 23:24:06

Sep 17 22:13:48 2016 [6-3] recovery of upgrade redo at 82% - estimated complete at Sep 17 23:21:41

Sep 17 22:15:41 2016 [6-3] recovery of upgrade redo at 83% - estimated complete at Sep 17 23:23:04

Sep 17 22:18:32 2016 [6-3] recovery of upgrade redo at 84% - estimated complete at Sep 17 23:24:10

Sep 17 22:27:40 2016 [6-3] recovery of upgrade redo at 85% - estimated complete at Sep 17 23:33:17

Sep 17 22:38:09 2016 [6-3] recovery of upgrade redo at 86% - estimated complete at Sep 17 23:45:11

Sep 17 22:39:07 2016 [6-3] recovery of upgrade redo at 87% - estimated complete at Sep 17 23:44:05

Sep 17 22:40:43 2016 [6-3] recovery of upgrade redo at 88% - estimated complete at Sep 17 23:42:30

Sep 17 22:42:57 2016 [6-3] recovery of upgrade redo at 89% - estimated complete at Sep 17 23:40:47

Sep 17 22:43:55 2016 [6-3] recovery of upgrade redo at 90% - estimated complete at Sep 17 23:39:46

Sep 17 22:46:26 2016 [6-3] recovery of upgrade redo at 91% - estimated complete at Sep 17 23:39:49

Sep 17 22:47:43 2016 [6-3] recovery of upgrade redo at 92% - estimated complete at Sep 17 23:36:41

Sep 17 22:48:02 2016 [6-3] recovery of upgrade redo at 93% - estimated complete at Sep 17 23:35:26

Sep 17 22:48:40 2016 [6-3] recovery of upgrade redo at 94% - estimated complete at Sep 17 23:32:39

Sep 17 22:48:59 2016 [6-3] recovery of upgrade redo at 95% - estimated complete at Sep 17 23:30:39

Sep 17 22:49:37 2016 [6-3] recovery of upgrade redo at 96% - estimated complete at Sep 17 23:28:18

Sep 17 22:50:16 2016 [6-3] recovery of upgrade redo at 97% - estimated complete at Sep 17 23:25:59

Sep 17 22:50:35 2016 [6-3] recovery of upgrade redo at 98% - estimated complete at Sep 17 23:24:54

Sep 17 22:51:14 2016 [6-3] recovery of upgrade redo at 99% - estimated complete at Sep 17 23:21:44

Sep 17 22:51:32 2016 [6-4] media recovery has finished recovering through upgrade


### Stage 7: Switch back to the original roles prior to the rolling upgrade


NOTE: At this point, you have the option to perform a switchover

which will restore c01orcl back to a primary database and

c02orcl back to a physical standby database. If you answer 'n'

to the question below, c01orcl will remain a physical standby

database and c02orcl will remain a primary database.


Do you want to perform a switchover? (y/n):


先不输入。

Stage 6要把c02orcl经历dbua时的所有日志通过网络传送到c01orcl并进行物理APPLYc01orcl的物理Standby身份才能进行这种sys schema的同步(逻辑Standby是不会理睬sys schema的)。在dbua时,我们手动做的两事务(改109号员工工资和创建t12表),也会被同步到c01orcl这个物理Standby

Stage7中只是做Dataguard Switchover再把c01orcl变为主库。

回到执行physru.sh的窗口:


Do you want to perform a switchover? (y/n): y


Sep 17 23:27:07 2016 [7-1] continuing

Sep 17 23:27:08 2016 [7-2] verifying instance c02orcl1 is the only active instance


WARN: c02orcl is a RAC database. Before this script can continue, you

must manually reduce the RAC to a single instance. This can be

accomplished with the following step:


1) Shutdown all instances other than instance c02orcl1.

eg: srvctl stop instance -d c02orcl -i c02orcl2


Once these steps have been performed, enter 'y' to continue the script.

If desired, you may enter 'n' to exit the script to perform the required

steps, and recall the script to resume from this point.


Are you ready to continue? (y/n):


先不输入。

根据提示,在station13上执行:


[oracle@station13 ~]$ srvctl stop instance -d c02orcl -i c02orcl2


回到执行physru.sh的窗口:


Are you ready to continue? (y/n): y

Sep 17 23:29:51 2016 [7-2] continuing

Sep 17 23:29:52 2016 [7-2] verifying instance c02orcl1 is the only active instance

Sep 17 23:29:57 2016 [7-2] waiting for apply lag to fall under 30 seconds

Sep 17 23:40:24 2016 [7-2] apply lag measured at 626 seconds

Sep 17 23:40:27 2016 [7-2] apply lag measured at 3 seconds

Sep 17 23:40:30 2016 [7-3] switching c02orcl to become a physical standby

Sep 17 23:40:44 2016 [7-3] c02orcl is now a physical standby

Sep 17 23:40:44 2016 [7-3] shutting down database c02orcl

./physru.sh: line 3674: warning: here-document at line 3670 delimited by end-of-file (wanted `EOF')

Sep 17 23:40:47 2016 [7-3] mounting database c02orcl

./physru.sh: line 3301: warning: here-document at line 3296 delimited by end-of-file (wanted `EOF')

Sep 17 23:41:23 2016 [7-4] waiting for standby c01orcl to process end-of-redo from primary

Sep 17 23:41:27 2016 [7-5] switching c01orcl to become the new primary

Sep 17 23:41:32 2016 [7-5] c01orcl is now the new primary

Sep 17 23:41:32 2016 [7-5] opening database c01orcl

./physru.sh: line 3337: warning: here-document at line 3332 delimited by end-of-file (wanted `EOF')

Sep 17 23:43:18 2016 [7-6] starting media recovery on c02orcl

Sep 17 23:43:28 2016 [7-6] confirming media recovery is running


NOTE: Database c01orcl has completed the switchover to the primary role, but

instance c01orcl1 is the only open instance. For increased availability,

Oracle recommends opening the remaining active instances which are

currently in mounted mode by performing the following steps:


1) Shutdown all instances other than instance c01orcl1.

eg: srvctl stop instance -d c01orcl -i c01orcl2


2) Startup and open all inactive instances for database c01orcl.

eg: srvctl start database -d c01orcl


NOTE: Database c02orcl is no longer limited to single instance operation since

it has completed the switchover to the physical standby role. For

increased availability, Oracle recommends starting the inactive

instances in the RAC by performing the following step:


1) Startup and mount inactive instances for database c02orcl

eg: srvctl start database -d c02orcl -o mount


### Stage 8: Statistics

script start time: 14-Sep-16 22:29:56

script finish time: 17-Sep-16 23:45:00

total script execution time: +03 01:15:04

wait time for user upgrade: +02 18:39:15

active script execution time: +00 06:35:49

transient logical creation start time: 14-Sep-16 23:27:25

transient logical creation finish time: 14-Sep-16 23:29:59

primary to logical switchover start time: 17-Sep-16 18:15:08

logical to primary switchover finish time: 17-Sep-16 18:17:22

primary services offline for: +00 00:02:14

total time former primary in physical role: +00 04:55:28

time to reach upgrade redo: +00 00:02:39

time to recover upgrade redo: +00 03:03:09

primary to physical switchover start time: 17-Sep-16 23:27:07

physical to primary switchover finish time: 17-Sep-16 23:43:16

primary services offline for: +00 00:16:09


SUCCESS: The physical rolling upgrade is complete


从以上Stage8的统计信息可以得出结论,primary services offline的时间只有短短的2分钟。而且这2分钟几乎都是Dataguard Switchover时产生的。在随后的3.8节中我们还要验证一下数据的完整性。


3.8 三次成功执行physru.sh后的善后工作

要想充分享受Rolling Patch这套12cMAA带来的好处,还要做一下的善后工作:

3.8.1 打开c01orcl的所有实例

station11上以oracle用户执行:


[oracle@station11 ~]$ srvctl status database -d c01orcl -v

Instance c01orcl1 is running on node station11. Instance status: Open.

Instance c01orcl2 is running on node station12. Instance status: Mounted (Closed).

[oracle@station11 ~]$ srvctl stop instance -d c01orcl -i c01orcl2

[oracle@station11 ~]$ srvctl start database -d c01orcl

[oracle@station11 ~]$ srvctl status database -d c01orcl -v

Instance c01orcl1 is running on node station11. Instance status: Open.

Instance c01orcl2 is running on node station12. Instance status: Open.


3.8.2 打开c02orcl的所有实例

station13上以oracle用户执行:


[oracle@station13 ~]$ srvctl status database -d c02orcl -v

Instance c02orcl1 is running on node station13. Instance status: Mounted (Closed).

Instance c02orcl2 is not running on node station14

[oracle@station13 ~]$ srvctl stop database -d c02orcl

[oracle@station13 ~]$ srvctl start database -d c02orcl

[oracle@station13 ~]$ srvctl status database -d c02orcl -v

Instance c02orcl1 is running on node station13. Instance status: Open,Readonly.

Instance c02orcl2 is running on node station14. Instance status: Open,Readonly.


3.8.3 验证在dbua过程中做的两个事务在主备库中都存在

station11上以oracle用户执行:


[oracle@station11 ~]$ sqlplus /nolog


SQL*Plus: Release 12.1.0.2.0 Production on Wed Sep 21 22:34:05 2016


Copyright (c) 1982, 2014, Oracle. All rights reserved.


SQL> conn hr/oracle_4U

Connected.

SQL> select salary from employees where employee_id=109;


SALARY

----------

9999


SQL> select * from t12c;


EMPLOYEE_ID FIRST_NAME LAST_NAME

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

EMAIL PHONE_NUMBER HIRE_DATE JOB_ID

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

SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID

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

189 Jennifer Dilly

JDILLY 650.505.2876 13-AUG-05 SH_CLERK

3600 122 50


190 Timothy Gates

......


station13上以oracle用户执行:


[oracle@station13 ~]$ sqlplus /nolog


SQL*Plus: Release 12.1.0.2.0 Production on Wed Sep 21 22:39:35 2016


Copyright (c) 1982, 2014, Oracle. All rights reserved.


SQL> conn hr/oracle_4U

Connected.

SQL> select salary from employees where employee_id=109;


SALARY

----------

9999


SQL> select * from t12c;


EMPLOYEE_ID FIRST_NAME LAST_NAME

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

EMAIL PHONE_NUMBER HIRE_DATE JOB_ID

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

SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID

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

189 Jennifer Dilly

JDILLY 650.505.2876 13-AUG-05 SH_CLERK

3600 122 50


190 Timothy Gates


3.8.4 重新启用Datagurad Broker

station11上以oracle用户执行:


SQL> conn / as sysdba

Connected.

SQL> alter system set dg_broker_start=true scope=both;


System altered.


SQL> exit

Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Advanced Analytics and Real Application Testing options


station13上以oracle用户执行:


SQL> conn / as sysdba

Connected.

SQL> alter system set dg_broker_start=true scope=both;


System altered.


SQL> exit

Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Advanced Analytics and Real Application Testing options


station11上以oracle用户执行:


[oracle@station11 ~]$ dgmgrl

DGMGRL for Linux: Version 12.1.0.2.0 - 64bit Production


Copyright (c) 2000, 2013, Oracle. All rights reserved.


Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle_4U@c01orcl

Connected as SYSDBA.

DGMGRL> enable configuration;

Enabled.

DGMGRL> show configuration verbose;


Configuration - dg_config


Protection Mode: MaxPerformance

Members:

c01orcl - Primary database

c02orcl - Physical standby database


Properties:

FastStartFailoverThreshold = '30'

OperationTimeout = '30'

TraceLevel = 'USER'

FastStartFailoverLagLimit = '30'

CommunicationTimeout = '180'

ObserverReconnect = '0'

FastStartFailoverAutoReinstate = 'TRUE'

FastStartFailoverPmyShutdown = 'TRUE'

BystandersFollowRoleChange = 'ALL'

ObserverOverride = 'FALSE'

ExternalDestination1 = ''

ExternalDestination2 = ''

PrimaryLostWriteAction = 'CONTINUE'


Fast-Start Failover: DISABLED


Configuration Status:

SUCCESS


DGMGRL> show database c02orcl


Database - c02orcl


Role: PHYSICAL STANDBY

Intended State: APPLY-ON

Transport Lag: 0 seconds (computed 0 seconds ago)

Apply Lag: 0 seconds (computed 1 second ago)

Average Apply Rate: 27.00 KByte/s

Real Time Query: ON

Instance(s):

c02orcl1 (apply instance)

c02orcl2


Database Status:

SUCCESS


3.8.5 主备库设置compatible参数为12.1.0.2.0

为了使用12c的新功能,我们要提升compatible参数的值。但是改动compatible参数要慎重,因此在改动之前应该做充分测试。比如闪回数据库不能闪回到改动该参数之前。正因为如此,首先让我们删除所有的保障闪回还原点(physru.sh在成功退出前已经删除了它创建的保障闪回还原点PRU_0000_0001,我们只需要删除dbua创建的那个就行了)。另外在Dataguard环境中要先升备库的compatible参数的值,再升级主库的compatible参数的值。

station13上以oracle用户执行:


[oracle@station13 ~]$ sqlplus /nolog


SQL*Plus: Release 12.1.0.2.0 Production on Thu Sep 22 14:57:12 2016


Copyright (c) 1982, 2014, Oracle. All rights reserved.


SQL> conn / as sysdba

Connected.

SQL> col name format a40

SQL> select name, GUARANTEE_FLASHBACK_DATABASE from v$restore_point;


NAME GUA

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

GRP_1474033308098 YES

GRP_1474038973612 YES


SQL> drop restore point GRP_1474033308098;


Restore point dropped.


SQL> drop restore point GRP_1474038973612;


Restore point dropped.


SQL> show parameter compatible


NAME TYPE VALUE

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

compatible string 11.2.0.4.0

noncdb_compatible boolean FALSE

SQL> alter system set compatible='12.1.0.2.0' scope=spfile;


System altered.


SQL> exit

Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Advanced Analytics and Real Application Testing options

[oracle@station13 ~]$ srvctl stop database -d c02orcl

[oracle@station13 ~]$ srvctl start database -d c02orcl

[oracle@station13 ~]$ sqlplus /nolog


SQL*Plus: Release 12.1.0.2.0 Production on Thu Sep 22 15:13:56 2016


Copyright (c) 1982, 2014, Oracle. All rights reserved.


SQL> conn / as sysdba

Connected.

SQL> show parameter compatible


NAME TYPE VALUE

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

compatible string 12.1.0.2.0

noncdb_compatible boolean FALSE


station11上以oracle用户执行:


[oracle@station11 ~]$ sqlplus /nolog


SQL*Plus: Release 12.1.0.2.0 Production on Thu Sep 22 15:15:43 2016


Copyright (c) 1982, 2014, Oracle. All rights reserved.


SQL> conn / as sysdba

Connected.

SQL> col name format a40

SQL> select name, GUARANTEE_FLASHBACK_DATABASE from v$restore_point;


no rows selected


SQL> show parameter compatible


NAME TYPE VALUE

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

compatible string 11.2.0.4.0

noncdb_compatible boolean FALSE

SQL> alter system set compatible='12.1.0.2.0' scope=spfile;


System altered.


SQL> exit

Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Advanced Analytics and Real Application Testing options

[oracle@station11 ~]$ srvctl stop database -d c01orcl

[oracle@station11 ~]$ srvctl start database -d c01orcl

[oracle@station11 ~]$ sqlplus /nolog


SQL*Plus: Release 12.1.0.2.0 Production on Thu Sep 22 15:43:17 2016


Copyright (c) 1982, 2014, Oracle. All rights reserved.


SQL> conn / as sysdba

Connected.

SQL> show parameter compatible


NAME TYPE VALUE

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

compatible string 12.1.0.2.0

noncdb_compatible boolean FALSE


总结
	

我们已经完成了Oracle MAA 11.2.0.4滚动升级到12.1.0.2的过程。利用物理Standby->逻辑Standby->物理Standby的转换,整个升级过程中前台业务暂停的时间只有短短的2分钟,几乎可以认定是无影响。


参考文档:

11gR1官方文档: http://download.oracle.com/docs/cd/B28359_01/server.111/b28294/rollup.htm#CHDHCBGA

11gR2官方文档: http://download.oracle.com/docs/cd/E11882_01/server.112/e10700/rollup.htm#CHDHCBGA

MAA Best Practices for SQL Apply文档:http://www.oracle.com/technetwork/database/features/availability/maa-wp-11gr1-sqlapplybestpractices-131426.pdf

MAA Best Practices for Database Rolling Upgrades using the Transient Logical Standby process文档:http://www.oracle.com/technetwork/database/features/availability/maa-wp-11g-transientlogicalrollingu-1-131927.pdf


附件:

1.  physru_unsupported.log完整内容:

physru_unsupported.log.zip

2. station11、station12、station13和station14的网络配置文件和克隆脚本以及其他脚本(本文中提到的physru.sh脚本是MOS的财产,做了加密)下载:

stage1_after.install.11g.primary.database.configure.11gmaa.zip

stage2_after-upgrade-12c-grid-infrastructure_NEED_MOS_ACCOUNT_TO_DECRYPT.zip

2

路过

雷人

握手

鲜花

鸡蛋

刚表态过的朋友 (2 人)

QQ|手机版|Bo's Oracle Station   

GMT+8, 2022-3-22 12:32 , Processed in 0.055879 second(s), 21 queries .

返回顶部