botang 发表于 2018-11-17 20:58:13

课程第56/57次(2018-11-18星期日上下午)使用保障前台业务0暂停的方式升级Oracle11gR2 MAA到Oracle12c MAA

1. 环境概览
1.1升级前环境概览
1.2备库升级后环境概览
2. 通过两次Dataguard切换,升级所有GI
2.1主库Dataguard切换
2.2原主库(新备库)升级后环境概览
2.3主库Dataguard切换,原主库(新备库)重新成为主库
3. 通过TransientLogical Standby转换,升级所有DB
3.1MyOracle Support Bulletin 949322.1综述
3.2升级前的准备工作
3.2.1停用DataguradBroker
3.2.2确保主库和备库闪回区都存在,并都设置了正确的大小
3.2.3主库和备库都配置闪回数据库
3.2.4确保升级前,备库进行着健康的RecoverManaged Standby Database
3.3第一次执行physru.sh
3.4 在TransientLogical Standby上执行dbua
3.5第二次执行physru.sh
3.6手工重配置cluster01以便使用12.1.0.2数据库软件直接打开c01orcl到mount的状态
3.7最后一次执行physru.sh                              
3.8三次成功执行physru.sh后的善后工作                              
3.8.1打开c01orcl的所有实例
3.8.2打开c02orcl的所有实例
3.8.3验证在dbua过程中做的两个事务在主备库中都存在
3.8.4重新启用DataguradBroker
3.8.5主备库设置compatible参数为12.1.0.2.0




在1.2的过程中,
用户连主库就没影响,
备库实际上有重启过:
$ 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
      Warning: ORA-16857: standby disconnected from redo source for longer than specified threshold

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:
WARNING

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

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


physru.sh脚本的输出:
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): y

Nov 18 11:04:40 2018 continuing
Nov 18 11:04:40 2018 verifying RAC is disabled at c02orcl
Nov 18 11:04:41 2018 verifying database roles
Nov 18 11:04:42 2018 verifying physical standby is mounted
Nov 18 11:04:42 2018 verifying database protection mode
Nov 18 11:04:42 2018 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): y

Nov 18 11:18:58 2018 continuing
Nov 18 11:18:59 2018 starting media recovery on c02orcl
Nov 18 11:19:06 2018 confirming media recovery is running
Nov 18 11:19:08 2018 waiting for apply lag to fall under 30 seconds
Nov 18 11:19:12 2018 apply lag measured at 3 seconds
Nov 18 11:19:12 2018 stopping media recovery on c02orcl
Nov 18 11:19:14 2018 executing dbms_logstdby.build on database c01orcl
Nov 18 11:19:47 2018 converting physical standby into transient logical standby
Nov 18 11:19:57 2018 opening database c02orcl
./physru.sh: line 3337: warning: here-document at line 3332 delimited by end-of-file (wanted `EOF')
Nov 18 11:20:06 2018 configuring transient logical standby parameters for rolling upgrade
Nov 18 11:20:07 2018 starting logical standby on database c02orcl
Nov 18 11:20:14 2018 waiting until logminer dictionary has fully loaded
Nov 18 11:21:18 2018 dictionary load 10% complete
Nov 18 11:21:28 2018 dictionary load 41% complete
Nov 18 11:21:39 2018 dictionary load 60% complete
Nov 18 11:21:50 2018 dictionary load 62% complete
Nov 18 11:22:10 2018 dictionary load 74% complete
Nov 18 11:22:21 2018 dictionary load 75% complete
Nov 18 11:22:31 2018 dictionary load is complete
Nov 18 11:22:31 2018 waiting for apply lag to fall under 30 seconds
Nov 18 11:23:11 2018 apply lag measured at 37 seconds




同时备库第一个实例上的日志:
Sun Nov 18 11:18:58 2018
Created guaranteed restore point PRU_0201
Sun Nov 18 11:18:59 2018
alter database recover managed standby database using current logfile through next switchover disconnect
Attempt to start background Managed Standby Recovery process (c02orcl1)
Sun Nov 18 11:18:59 2018
MRP0 started with pid=46, OS id=20863
MRP0: Background Managed Standby Recovery process started (c02orcl1)
started logmerger process
Sun Nov 18 11:19:04 2018
Managed Standby Recovery starting Real Time Apply
Parallel Media Recovery started with 4 slaves
Waiting for all non-current ORLs to be archived...
All non-current ORLs have been archived.
Media Recovery Log +FRA/c02orcl/archivelog/2018_11_18/thread_2_seq_39.350.992517005
Media Recovery Log +FRA/c02orcl/archivelog/2018_11_18/thread_1_seq_40.353.992517007
Completed:   alter database recover managed standby database using current logfile through next switchover disconnect
Media Recovery Log +FRA/c02orcl/archivelog/2018_11_18/thread_2_seq_40.349.992517003
Sun Nov 18 11:19:08 2018
Standby controlfile consistent with primary
RFS: Selected log 5 for thread 1 sequence 45 dbid 1035727207 branch 991429098
Media Recovery Log +FRA/c02orcl/archivelog/2018_11_18/thread_1_seq_41.351.992517007
Sun Nov 18 11:19:08 2018
Archived Log entry 99 added for thread 1 sequence 44 ID 0x3dcb3c16 dest 1:
Media Recovery Log +FRA/c02orcl/archivelog/2018_11_18/thread_1_seq_42.354.992517009
Media Recovery Log +FRA/c02orcl/archivelog/2018_11_18/thread_2_seq_41.352.992517007
Media Recovery Log +FRA/c02orcl/archivelog/2018_11_18/thread_2_seq_42.356.992517071
Media Recovery Log +FRA/c02orcl/archivelog/2018_11_18/thread_1_seq_43.355.992517069
Media Recovery Log +FRA/c02orcl/archivelog/2018_11_18/thread_1_seq_44.357.992517549
Media Recovery Waiting for thread 2 sequence 43 (in transit)
Recovery of Online Redo Log: Thread 2 Group 9 Seq 43 Reading mem 0
Mem# 0: +DATA/c02orcl/onlinelog/group_9.274.991772999
Mem# 1: +FRA/c02orcl/onlinelog/group_9.270.991773009
Media Recovery Waiting for thread 1 sequence 45 (in transit)
Recovery of Online Redo Log: Thread 1 Group 5 Seq 45 Reading mem 0
Mem# 0: +DATA/c02orcl/onlinelog/group_5.270.991772955
Mem# 1: +FRA/c02orcl/onlinelog/group_5.266.991772961
Standby controlfile consistent with primary
RFS: Selected log 6 for thread 1 sequence 46 dbid 1035727207 branch 991429098
Sun Nov 18 11:19:11 2018
Archived Log entry 100 added for thread 1 sequence 45 ID 0x3dcb3c16 dest 1:
Media Recovery Waiting for thread 1 sequence 46 (in transit)
Sun Nov 18 11:19:12 2018
alter database recover managed standby database cancel
Recovery of Online Redo Log: Thread 1 Group 6 Seq 46 Reading mem 0
Mem# 0: +DATA/c02orcl/onlinelog/group_6.271.991772965
Mem# 1: +FRA/c02orcl/onlinelog/group_6.267.991772973
MRP0: Background Media Recovery cancelled with status 16037
Errors in file /u01/app/oracle/diag/rdbms/c02orcl/c02orcl1/trace/c02orcl1_pr00_20877.trc:
ORA-16037: user requested cancel of managed recovery operation
Managed Standby Recovery not using Real Time Apply
Recovery interrupted!
Sun Nov 18 11:19:13 2018
MRP0: Background Media Recovery process shutdown (c02orcl1)
Managed Standby Recovery Canceled (c02orcl1)
Completed:   alter database recover managed standby database cancel
Sun Nov 18 11:19:19 2018
Standby controlfile consistent with primary
RFS: Selected log 5 for thread 1 sequence 47 dbid 1035727207 branch 991429098
Sun Nov 18 11:19:19 2018
Archived Log entry 101 added for thread 1 sequence 46 ID 0x3dcb3c16 dest 1:
Standby controlfile consistent with primary
RFS: Selected log 6 for thread 1 sequence 48 dbid 1035727207 branch 991429098
Sun Nov 18 11:19:20 2018
Archived Log entry 102 added for thread 1 sequence 47 ID 0x3dcb3c16 dest 1:
Sun Nov 18 11:19:21 2018
Standby controlfile consistent with primary
RFS: Selected log 8 for thread 2 sequence 44 dbid 1035727207 branch 991429098
Archived Log entry 103 added for thread 2 sequence 43 ID 0x3dcb3c16 dest 1:
Sun Nov 18 11:19:27 2018
db_recovery_file_dest_size of 14655 MB is 50.47% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
Sun Nov 18 11:19:36 2018
Standby controlfile consistent with primary
RFS: Selected log 5 for thread 1 sequence 49 dbid 1035727207 branch 991429098
Sun Nov 18 11:19:37 2018
Archived Log entry 104 added for thread 1 sequence 48 ID 0x3dcb3c16 dest 1:
Sun Nov 18 11:19:42 2018
Standby controlfile consistent with primary
RFS: Selected log 9 for thread 2 sequence 45 dbid 1035727207 branch 991429098
Sun Nov 18 11:19:42 2018
Archived Log entry 105 added for thread 2 sequence 44 ID 0x3dcb3c16 dest 1:
Standby controlfile consistent with primary
RFS: Selected log 6 for thread 1 sequence 50 dbid 1035727207 branch 991429098
Sun Nov 18 11:19:44 2018
Archived Log entry 106 added for thread 1 sequence 49 ID 0x3dcb3c16 dest 1:
Standby controlfile consistent with primary
RFS: Selected log 8 for thread 2 sequence 46 dbid 1035727207 branch 991429098
Archived Log entry 107 added for thread 2 sequence 45 ID 0x3dcb3c16 dest 1:
Sun Nov 18 11:19:47 2018
Standby controlfile consistent with primary
RFS: Selected log 5 for thread 1 sequence 51 dbid 1035727207 branch 991429098
Archived Log entry 108 added for thread 1 sequence 50 ID 0x3dcb3c16 dest 1:
Sun Nov 18 11:19:47 2018
alter database recover to logical standby keep identity
Media Recovery Start: Managed Standby Recovery (c02orcl1)
started logmerger process
Sun Nov 18 11:19:48 2018
Managed Standby Recovery not using Real Time Apply
Parallel Media Recovery started with 4 slaves
Media Recovery Log +FRA/c02orcl/archivelog/2018_11_18/thread_1_seq_46.359.992517559
Media Recovery Log +FRA/c02orcl/archivelog/2018_11_18/thread_2_seq_43.361.992517561
Media Recovery Log +FRA/c02orcl/archivelog/2018_11_18/thread_1_seq_47.360.992517561
Media Recovery Log +FRA/c02orcl/archivelog/2018_11_18/thread_1_seq_48.362.992517577
Media Recovery Log +FRA/c02orcl/archivelog/2018_11_18/thread_2_seq_44.363.992517583
Media Recovery Log +FRA/c02orcl/archivelog/2018_11_18/thread_1_seq_49.364.992517585
Media Recovery Log +FRA/c02orcl/archivelog/2018_11_18/thread_2_seq_45.365.992517587
Media Recovery Log +FRA/c02orcl/archivelog/2018_11_18/thread_1_seq_50.366.992517587
Incomplete Recovery applied until change 1350596 time 11/18/2018 11:19:44
Media Recovery Complete (c02orcl1)
Sun Nov 18 11:19:53 2018
Killing 7 processes with pids 17473,17479,17481,17500,17502,17504,17514 (all RFS) in order to disallow current and future RFS connections. Requested by OS process 15414
Begin: Standby Redo Logfile archival
End: Standby Redo Logfile archival
RESETLOGS after incomplete recovery UNTIL CHANGE 1350596
Resetting resetlogs activation ID 1036729366 (0x3dcb3c16)
Online log +DATA/c02orcl/onlinelog/group_1.266.991772911: Thread 1 Group 1 was previously cleared
Online log +FRA/c02orcl/onlinelog/group_1.262.991772919: Thread 1 Group 1 was previously cleared
Online log +DATA/c02orcl/onlinelog/group_2.267.991772921: Thread 1 Group 2 was previously cleared
Online log +FRA/c02orcl/onlinelog/group_2.263.991772929: Thread 1 Group 2 was previously cleared
Online log +DATA/c02orcl/onlinelog/group_3.268.991772931: Thread 2 Group 3 was previously cleared
Online log +FRA/c02orcl/onlinelog/group_3.264.991772939: Thread 2 Group 3 was previously cleared
Online log +DATA/c02orcl/onlinelog/group_4.269.991772945: Thread 2 Group 4 was previously cleared
Online log +FRA/c02orcl/onlinelog/group_4.265.991772951: Thread 2 Group 4 was previously cleared
Standby became primary SCN: 1350594
Sun Nov 18 11:19:56 2018
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
Sun Nov 18 11:19:57 2018
Created guaranteed restore point PRU_0202
Sun Nov 18 11:19:57 2018
alter database open
Sun Nov 18 11:19:57 2018
Assigning activation ID 1036776380 (0x3dcbf3bc)
Thread 1 opened at log sequence 1
Current log# 1 seq# 1 mem# 0: +DATA/c02orcl/onlinelog/group_1.266.991772911
Current log# 1 seq# 1 mem# 1: +FRA/c02orcl/onlinelog/group_1.262.991772919
Successful open of redo thread 1
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Sun Nov 18 11:19:57 2018
SMON: enabling cache recovery
Redo thread 2 internally disabled at seq 1 (CKPT)
Sun Nov 18 11:19:59 2018
ARC2: Archiving disabled thread 2 sequence 1
Successfully onlined Undo Tablespace 2.
Undo initialization finished serial:0 start:58040994 end:58041604 diff:610 (6 seconds)
Dictionary check beginning
Dictionary check complete
Verifying file header compatibility for 11g tablespace encryption..
Verifying 11g file header compatibility for tablespace encryption completed
SMON: enabling tx recovery
Database Characterset is AL32UTF8
No Resource Manager plan active
replication_dependency_tracking turned off (no async multimaster replication found)
Archived Log entry 109 added for thread 2 sequence 1 ID 0x0 dest 1:
Sun Nov 18 11:20:00 2018
Primary database is in MAXIMUM AVAILABILITY mode
Changing standby controlfile to RESYNCHRONIZATION level
Archive log rejected (thread 1 sequence 53) by RFS clients
Starting background process QMNC
Sun Nov 18 11:20:01 2018
QMNC started with pid=38, OS id=21202
LOGSTDBY: Validating controlfile with logical metadata
LOGSTDBY: Validation skipped -- detected logical instantiation
LOGSTDBY: Validation complete
LOGSTDBY: skipping logfile pre-registration due to in-progress instantiation
Sun Nov 18 11:20:04 2018
RFS LogMiner: RFS id assigned as thread PING handler
Sun Nov 18 11:20:05 2018
Primary database is in MAXIMUM AVAILABILITY mode
Standby controlfile consistent with primary
Standby controlfile consistent with primary
Completed: alter database open
RFS: Assigned to RFS process 21222
RFS: Selected log 9 for thread 2 sequence 48 dbid 1035727207 branch 991429098
Sun Nov 18 11:20:05 2018
Created guaranteed restore point PRU_0203
Sun Nov 18 11:20:06 2018
RFS: Assigned to RFS process 21236
RFS: Selected log 10 for thread 2 sequence 47 dbid 1035727207 branch 991429098
Sun Nov 18 11:20:06 2018
Starting background process CJQ0
Sun Nov 18 11:20:06 2018
CJQ0 started with pid=47, OS id=21246
Sun Nov 18 11:20:07 2018
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
Sun Nov 18 11:20:07 2018
alter database start logical standby apply immediate
LOGSTDBY: Creating new session for dbid 1035727207 starting at scn 0x0000.00000000
LOGSTDBY: Created session of id 1
LOGSTDBY: Attempting to pre-register dictionary build logfiles
LOGMINER: Error 308 encountered, failed to readlogfile 1_49_991429098.dbf
LOGMINER: Encountered error 1291 while adding logfile 1_49_991429098.dbf to session 1
LOGMINER: Error 308 encountered, failed to readlogfile 2_44_991429098.dbf
LOGMINER: Encountered error 1291 while adding logfile 2_44_991429098.dbf to session 1
LOGMINER: Error 308 encountered, failed to readlogfile 2_43_991429098.dbf
LOGMINER: Encountered error 1291 while adding logfile 2_43_991429098.dbf to session 1
LOGMINER: Error 308 encountered, failed to readlogfile 1_48_991429098.dbf
LOGMINER: Encountered error 1291 while adding logfile 1_48_991429098.dbf to session 1
LOGSTDBY: Unable to register recovery logfiles, will resend
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
LOGSTDBYRECORD_UNSUPPORTED_OPERATIONS = TRUE
LOGSTDBY                LOG_AUTO_DELETE = FALSE
Sun Nov 18 11:20:08 2018
LSP0 started with pid=45, OS id=21256
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
Sun Nov 18 11:21:05 2018
RFS: Opened log for thread 2 sequence 44 dbid 1035727207 branch 991429098
Sun Nov 18 11:21:05 2018
RFS: Assigned to RFS process 21527
RFS: Opened log for thread 2 sequence 43 dbid 1035727207 branch 991429098
RFS LogMiner: Registered logfile [+FRA/c02orcl/foreign_archivelog/c01orcl/2018_11_18/thread_2_seq_44.369.992517665] to LogMiner session id
RFS LogMiner: Registered logfile [+FRA/c02orcl/foreign_archivelog/c01orcl/2018_11_18/thread_2_seq_43.370.992517665] to LogMiner session id
Sun Nov 18 11:21:06 2018
LOGMINER: summary for session# = 1
LOGMINER: StartScn: 1348931 (0x0000.00149543)
LOGMINER: EndScn: 0 (0x0000.00000000)
LOGMINER: HighConsumedScn: 1350595 (0x0000.00149bc3)
LOGMINER: session_flag: 0x1
LOGMINER: Read buffers: 16
LOGMINER: Memory LWM: limit 10M, LWM 40M, 80%
LOGMINER: Memory Release Limit: 1M
Sun Nov 18 11:21:06 2018
RFS: Assigned to RFS process 21181
RFS: Opened log for thread 1 sequence 48 dbid 1035727207 branch 991429098
RFS: Opened log for thread 1 sequence 49 dbid 1035727207 branch 991429098
RFS: Opened log for thread 2 sequence 45 dbid 1035727207 branch 991429098
RFS LogMiner: Registered logfile [+FRA/c02orcl/foreign_archivelog/c01orcl/2018_11_18/thread_1_seq_49.372.992517667] to LogMiner session id
RFS LogMiner: Registered logfile [+FRA/c02orcl/foreign_archivelog/c01orcl/2018_11_18/thread_2_seq_45.373.992517667] to LogMiner session id
RFS: Opened log for thread 1 sequence 50 dbid 1035727207 branch 991429098
RFS: Selected log 8 for thread 2 sequence 46 dbid 1035727207 branch 991429098
RFS LogMiner: Registered logfile [+FRA/c02orcl/foreign_archivelog/c01orcl/2018_11_18/thread_1_seq_50.374.992517667] to LogMiner session id
Sun Nov 18 11:21:07 2018
RFS LogMiner: Registered logfile [+FRA/c02orcl/foreign_archivelog/c01orcl/2018_11_18/thread_2_seq_46.375.992517667] to LogMiner session id
RFS: Selected log 5 for thread 1 sequence 51 dbid 1035727207 branch 991429098
RFS: Opened log for thread 1 sequence 52 dbid 1035727207 branch 991429098
RFS: Opened log for thread 2 sequence 47 dbid 1035727207 branch 991429098
RFS LogMiner: Registered logfile [+FRA/c02orcl/foreign_archivelog/c01orcl/2018_11_18/thread_1_seq_52.376.992517667] to LogMiner session id
Sun Nov 18 11:21:08 2018
RFS LogMiner: Registered logfile [+FRA/c02orcl/foreign_archivelog/c01orcl/2018_11_18/thread_1_seq_51.377.992517669] to LogMiner session id
RFS LogMiner: Registered logfile [+FRA/c02orcl/foreign_archivelog/c01orcl/2018_11_18/thread_1_seq_48.371.992517667] to LogMiner session id
RFS LogMiner: Registered logfile [+FRA/c02orcl/foreign_archivelog/c01orcl/2018_11_18/thread_2_seq_47.378.992517669] to LogMiner session id
RFS LogMiner: RFS id assigned as thread PING handler
Sun Nov 18 11:21:09 2018
LOGMINER: session#=1 (Logical_Standby$), reader MS00 pid=50 OS id=21546 sid=514 started
Sun Nov 18 11:21:09 2018
LOGMINER: session#=1 (Logical_Standby$), builder MS01 pid=51 OS id=21548 sid=767 started
Sun Nov 18 11:21:09 2018
LOGMINER: session#=1 (Logical_Standby$), preparer MS02 pid=53 OS id=21550 sid=266 started
LOGMINER: Begin mining logfile during dictionary load for session 1 thread 1 sequence 48, +FRA/c02orcl/foreign_archivelog/c01orcl/2018_11_18/thread_1_seq_48.371.992517667
Sun Nov 18 11:21:15 2018
Starting background process SMCO
Sun Nov 18 11:21:15 2018
SMCO started with pid=54, OS id=21568
Sun Nov 18 11:21:43 2018
LOGMINER: End   mining logfile during dictionary load for session 1 thread 1 sequence 48, +FRA/c02orcl/foreign_archivelog/c01orcl/2018_11_18/thread_1_seq_48.371.992517667
LOGMINER: Begin mining logfile during dictionary load for session 1 thread 1 sequence 49, +FRA/c02orcl/foreign_archivelog/c01orcl/2018_11_18/thread_1_seq_49.372.992517667

同时,主库对备库变成逻辑standby的反映:
Archived Log entry 163 added for thread 1 sequence 49 ID 0x3dcb3c16 dest 1:
Sun Nov 18 11:19:44 2018
Logminer Bld: Done
LOGMINER: Dictionary Build: Waiting for txns in-flight at scn 0x0000.00149543 to complete
LOGMINER: Dictionary Build: All in-flight txns at scn 0x0000.00149543 completed
Thread 1 cannot allocate new log, sequence 51
Checkpoint not complete
Current log# 1 seq# 50 mem# 0: +DATA/c01orcl/onlinelog/group_1.261.991429099
Current log# 1 seq# 50 mem# 1: +FRA/c01orcl/onlinelog/group_1.257.991429105
3.4 dbua过程中备库不可用

确保“+FRA/C02ORCL/foreign_archivelog/c01orcl/”有从c01orcl传送来的所有日志,确保 c02orcl上的Logical Standby Apply紧紧跟随主库,
逻辑standby故障处理:
SQL>select APPLIED_SCN,LATEST_SCN, MINING_SCN from v$logstdby_progress;

APPLIED_SCN LATEST_SCN MINING_SCN
----------- ---------- ----------
    1352467    1353758


SQL> select* from v$logstdby_process;
SQL> alter database start logical standby apply;

Database altered.

如果打开后,马上断掉(v$logstdby_process瞬间消失),查event, dbms_logstdby.skip跳过event:
SQL> select event from dba_logstdby_events order byevent_time desc;

逻辑standby的skip:
selectto_char(e.EVENT), e.EVENT_TIME
from dba_logstdby_events e order by 2 desc;


select* from dba_logstdby_skip;

select APPLIED_SCN,LATEST_SCN, MINING_SCN from v$logstdby_progress;

select* from dba_logstdby_progress;

   
   begin
   dbms_logstdby.skip_error('DML','SH','CMP4$88063');
   end;

begin
   dbms_logstdby.skip_error('SCHEMA_DDL','SH','CMP4$88063');
   end;

begin
   dbms_logstdby.skip_error('TABLE','SH','CMP4$88063');
   end;dbms_logstdby.skip_error的第一个参数的介绍:
Supported Values for the stmt Parameter
Keyword         Associated SQL Statements

NON_SCHEMA_DDL
      All DDL that does not pertain to a particular schema
Note: SCHEMA_NAME and OBJECT_NAME must be null

SCHEMA_DDL
      All DDL statements that create, modify, or drop schema objects (for example: tables, indexes, and columns)
Note: SCHEMA_NAME and OBJECT_NAME must not be null

DML
      Includes DML statements on a table (for example: INSERT, UPDATE, and DELETE)

CLUSTER
      AUDIT CLUSTER
CREATE CLUSTER
DROP CLUSTER
TRUNCATE CLUSTER

CONTEXT
      CREATE CONTEXT
DROP CONTEXT

DATABASE LINK
      CREATE DATABASE LINK
CREATE PUBLIC DATABASE LINK
DROP DATABASE LINK
DROP PUBLIC DATABASE LINK

DIMENSION
      ALTER DIMENSION
CREATE DIMENSION
DROP DIMENSION

DIRECTORY
      CREATE DIRECTORY
DROP DIRECTORY

INDEX
      ALTER INDEX
CREATE INDEX
DROP INDEX

PROCEDURE
      ALTER FUNCTION
ALTER PACKAGE
ALTER PACKAGE BODY
ALTER PROCEDURE
CREATE FUNCTION
CREATE LIBRARY
CREATE PACKAGE
CREATE PACKAGE BODY
CREATE PROCEDURE
DROP FUNCTION
DROP LIBRARY
DROP PACKAGE
DROP PACKAGE BODY
DROP PROCEDURE

PROFILE
      ALTER PROFILE
CREATE PROFILE
DROP PROFILE

ROLE
      ALTER ROLE
CREATE ROLE
DROP ROLE
SET ROLE

ROLLBACK STATEMENT
      ALTER ROLLBACK SEGMENT
CREATE ROLLBACK SEGMENT
DROP ROLLBACK SEGMENT

SEQUENCE
      ALTER SEQUENCE
CREATE SEQUENCE
DROP SEQUENCE

SYNONYM
      CREATE PUBLIC SYNONYM
CREATE SYNONYM
DROP PUBLIC SYNONYM
DROP SYNONYM

TABLE
      ALTER TABLE
CREATE TABLE
DROP TABLE

TABLESPACE
      CREATE TABLESPACE
DROP TABLESPACE
TRUNCATE TABLESPACE

TRIGGER
      ALTER TRIGGER
CREATE TRIGGER
DISABLE ALL TRIGGERS
DISABLE TRIGGER
DROP TRIGGER
ENABLE ALL TRIGGERS
ENABLE TRIGGER

TYPE
      ALTER TYPE
ALTER TYPE BODY
CREATE TYPE
CREATE TYPE BODY
DROP TYPE
DROP TYPE BODY

USER
      ALTER USER
CREATE USER
DROP USER

VIEW
      CREATE VIEW
DROP VIEW

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

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









页: [1]
查看完整版本: 课程第56/57次(2018-11-18星期日上下午)使用保障前台业务0暂停的方式升级Oracle11gR2 MAA到Oracle12c MAA