DATABASE ROLLING UPGRADE USING DATA GUARD SQL APPLY
DATABASE ROLLING UPGRADE USING DATA GUARD SQL APPLY
Contents
Introduction
Illustrations and Requirements
Perform a Rolling Upgrade Using SQL Apply
Flashing Back the Database after a Failed Upgrade
Recover Production from Primary Site Failure during Upgrade
About the Author
Introduction
This guide provides best practices for leveraging Data Guard SQL Apply to
perform a rolling Oracle database upgrade with minimal downtime. Total
database downtime is limited to the time it takes to execute a Data Guard
switchover, compared to the longer downtime required for a conventional
database upgrade.
In this guide, a rolling database migration using Data Guard SQL Apply will
be deployed to migrate from Oracle Database 10g Release 2 (10.2.0.5) to
Oracle Database 11g Release 2 (11.2.0.3). This same guide can also be
used to perform rolling database upgrades using Data Guard SQL Apply.
For example, upgrading Oracle Database 11g Release 2 (11.2.0.1) to
(11.2.0.3).
To learn more about important patches and workarounds for Oracle 10g
rolling database upgrades using Data Guard SQL Apply (Logical Standby),
see [ID 300479.1] on the My Oracle Support web site.
This section illustrates the steps and requirements that are used to perform
a rolling upgrade (or rolling migration) using SQL Apply. Performing an
upgrade using SQL Apply will be covered in the next section.
The example Data Guard configuration used in this guide will consist of a
primary database, a logical standby database, and an optional archived
redo log repository that will receive redo during the logical standby upgrade
phases as shown in Figure 1. The logical standby may already exist, or you
may create it to use on a temporary basis for a rolling database upgrade.
An optional archived redo log repository will be created on the same
machine running the logical standby database.
Creating an archived redo log repository for the rolling upgrade ensures
that you can meet the Recovery Point Objectives (RPO) if the primary site
fails during the upgrade of the logical standby database. There are two
occasions during a SQL Apply rolling upgrade where a logical standby site
is being upgraded and not receiving redo from the primary. Without an
archived redo log repository, the primary database is unprotected while the
logical standby is being upgraded. During these times, it is highly
recommended to use an archived redo log repository to protect the primary
database. To learn more about creating an archived redo log repository,
visit Data Guard Archived Redo Log Repository or [ID 887471.1] on the My
Oracle Support web site.
While the logical standby database is being upgraded, it will not accept
redo data from the primary database. In order to protect the primary
database, redo will continue to be sent to the archived redo log repository
running at the logical standby site.
Figure 2 shows the primary database running database release X and the
logical standby database running database release Y. During the upgrade,
redo data accumulates on the primary system and also sent to the archived
redo log repository.
Why is it recommended to create an archived redo log repository?
If the primary site fails while performing the upgrade on the logical
standby, all of the archived redo log files that were transferred to
the archived redo log repository during that time can be registered
with the logical standby database and a failover to the logical
standby would need to occur. This significantly reduces data loss
when failing over to the logical standby.
Restart SQL Apply and operate with database release X on the primary
and database release Y on the logical standby.
Perform a Switchover
When you are satisfied that the upgraded database software is operating
properly, perform a switchover to reverse the database roles and activate
the user applications and services on the database now running in the
primary database role.
Immediately after the switchover, disable the archived redo log repository
on the new primary site, create a new archived redo log repository on the
former primary site using the upgraded database release Y software,
update the tnsnames.ora file to reflect the change, and configure it to
receive redo data from the new primary database as shown in Figure 4.
Figure 4: After First Switchover
The former primary database is still running database release X and cannot
apply redo data from the new primary until you upgrade it and start SQL
Apply.
Also upgrade any additional physical standby databases that may be part
of the Data Guard configuration. Any additional physical standby databases
will remain down and not brought online until the final switchover where the
original primary site is running in the primary role with the new database
release. Support for multi-standby configurations will be discussed later in
this guide.
After upgrading the former primary site (which is now the new logical
standby), restart SQL Apply on the new logical standby database. Both
databases are now upgraded and running database release Y as shown in
Figure 6.
After completing the rolling upgrade, you can remove or keep the archived
redo log repository.
1. For the purpose of this guide, it is assumed that Oracle Database 10g
Release 2 and any patchsets have been installed on all nodes in the
Data Guard configuration.
2. A logical standby database already exists that will be used to perform
a rolling upgrade of the Oracle Database. Click here for instructions
on how to create a logical standby database from a primary database
using Oracle Database 10g Release 2 (10.2) operating in maximum
performance protection mode.
3. The Data Guard protection mode must be set to either maximum
availability or maximum performance. The Data Guard protection
mode cannot be set to maximum protection during the rolling
upgrade.
4. The databases must not be part of a Data Guard Broker
configuration. Data Guard Broker configurations are not supported
during a rolling upgrade. If Data Guard Broker is being used, it will
need to be disabled on both the primary and standby. Data Guard
Broker can be re-enabled after completing the rolling upgrade.
5. To ensure the primary database can proceed while the logical
standby database is being upgraded, the LOG_ARCHIVE_DEST_n
initialization parameter for the logical standby database destination
must be set to OPTIONAL (not MANDATORY).
6. The COMPATIBLE initialization parameter must match the software
release prior to the upgrade. That is, a rolling upgrade from database
release X to database release Y requires that the COMPATIBLE
initialization parameter be set to database release X on both the
primary and standby databases throughout the rolling upgrade
process. The COMPATIBLE parameter will be set to the new Oracle
version after completing the rolling upgrade when both databases
have been upgraded and you are satisfied with the new Oracle
version.
7. Rolling database upgrade is not supported by Oracle Enterprise
Manager (OEM) Grid Control.
8. Since the SQL Apply rolling upgrade method uses a logical standby,
identify and resolve any unsupported data types for the logical
database. Consider the following options for using a rolling upgrade
when unsupported data types exist.
o Suspend or prohibit changes to the unsupported tables for the
period of time it takes to perform the upgrade procedure. This
option requires that you prevent users from modifying any
unsupported tables from the time you create the logical standby
control file to the time you complete the upgrade. You can
monitor transaction activity in the DBA_LOGSTDBY_EVENTS
view and discontinue the upgrade (if necessary) up to the time
you perform the first switchover.
o If you cannot prevent changes to unsupported tables during the
upgrade, any unsupported transactions that occur can be
recorded in the DBA_LOGSTDBY_EVENTS table on the logical
standby database. After the upgrade is completed, identify any
unsupported operations in the DBA_LOGSTDBY_EVENTS table
and use the Oracle Data Pump Export/Import utility to import
the changed tables to the upgraded database.
Database altered.
SQL> exec
dbms_logstdby.apply_set('MAX_EVENTS_RECORDED',DBMS_LOGST
SQL> exec
dbms_logstdby.apply_set('RECORD_UNSUPPORTED_OPERATIONS',
Database altered.
Although not used in this example, you may also have one or more
physical standby databases in the Data Guard configuration being used for
disaster recovery. If this is the case, you must also perform the upgrade of
any physical standby databases in your Data Guard configuration as part of
the rolling upgrade.
Unlike upgrading the primary and logical standby databases involved in the
SQL Apply rolling upgrade, you will not be running the Database Upgrade
Assistant (DBUA) on the additional physical standby databases. Only the
the listener, /etc/oratab file, and initialization parameters will need to be
updated to prepare the physical standby database to be started with the
new database software release. Once the physical standby database is
mounted and has caught up with the original primary, its database objects
will be upgraded automatically by Redo Apply.
Make certain that you retain all archived redo log files generated by the
original primary database after it and the additional physical standby
databases are shutdown for the first switchover. These log files will be
needed to catch up the physical standby databases at the end of the rolling
upgrade when they are brought back into the Data Guard configuration as
physical standbys of the original primary site.
Oracle Configuration
Primary Database
Database Name
modesto
(db_name)
Database Domain
idevelopment.info
(db_domain)
Compatibility Level
10.2.0.5.0
(compatible)
Database Files -
/u02/oradata
(db_create_file_dest)
Data Guard
Configuration - dg_config=(modesto,turlock,alrepos)
(log_archive_config)
location=use_db_recovery_file_dest
Local Redo Log Files -
valid_for=(online_logfiles,all_roles)
(log_archive_dest_1)
db_unique_name=modesto
location=/u04/oracle/oraarch/MODESTO
Logical Standby Logs -
valid_for=(standby_logfiles,standby_role)
(log_archive_dest_3)
db_unique_name=modesto
Archived Redo Log service=alrepos.idevelopment.info lgwr async
Repository - valid_for=(online_logfiles,primary_role)
(log_archive_dest_4) db_unique_name=alrepos
Database Name
TURLOCK
(db_name)
Database Domain
idevelopment.info
(db_domain)
Compatibility Level
10.2.0.5.0
(compatible)
Database Files -
/u02/oradata
(db_create_file_dest)
Data Guard
Configuration - dg_config=(modesto,turlock,alrepos)
(log_archive_config)
location=use_db_recovery_file_dest
Local Redo Log Files -
valid_for=(online_logfiles,all_roles)
(log_archive_dest_1)
db_unique_name=turlock
location=/u04/oracle/oraarch/TURLOCK
Logical Standby Logs -
valid_for=(standby_logfiles,standby_role)
(log_archive_dest_3)
db_unique_name=turlock
vmlinux2.idevelopment.info —
Host Name
(192.168.1.162)
Database Domain
idevelopment.info
(db_domain)
Compatibility Level
10.2.0.5.0
(compatible)
location=use_db_recovery_file_dest
Local Redo Log Files -
valid_for=(all_logfiles,all_roles)
(log_archive_dest_1)
db_unique_name=alrepos
tnsnames.ora
MODESTO.IDEVELOPMENT.INFO =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =
vmlinux1.idevelopment.info)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = modesto.idevelopment.info)
)
)
TURLOCK.IDEVELOPMENT.INFO =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =
vmlinux2.idevelopment.info)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = turlock.idevelopment.info)
)
)
ALREPOS.IDEVELOPMENT.INFO =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =
vmlinux2.idevelopment.info)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = alrepos.idevelopment.info)
)
)
2. Primary
FLASHBACK_ON
------------------
NO
Database altered.
Database altered.
FLASHBACK_ON
------------------
YES
3. Standby
FLASHBACK_ON
------------------
NO
Database altered.
Database altered.
Database altered.
Database altered.
FLASHBACK_ON
------------------
YES
6. After installing the new Oracle Database release software, copy the
listener.ora, tnsnames.ora, and optionally the sqlnet.ora
file from the current ORACLE_HOME/network/admin to the new
11gR2 ORACLE_HOME/network/admin on both the primary and
standby site.
Primary
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME =
/u01/app/oracle/product/11.2.0/dbhome_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =
vmlinux1.idevelopment.info)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
Standby
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME =
/u01/app/oracle/product/11.2.0/dbhome_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =
vmlinux2.idevelopment.info)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
Also modify the the sqlnet.ora file to reflect the new 11gR2 home.
Do not start the listener in the new 11gR2 home at this time. This will
be performed during the switchover later in this guide.
7. Apply any important patches and workarounds for Oracle 10g rolling
database upgrades using Data Guard SQL Apply (Logical Standby)
as noted in [ID 300479.1] on the My Oracle Support web site.
PATCH_FILE
----------------------------------------------------
----------------------------
?/sysman/admin/emdrep/sql/empatch.sql
--
@&EM_SQL_ROOT/core/latest/admin/admin_submit_dbms_jobs.s
8. Make sure you capture information about transactions running on the
primary database that will not be supported by a logical standby
database. Run the following procedures on the logical standby
database to capture and record the information as events in the
DBA_LOGSTDBY_EVENTS view.
Database altered.
SQL> exec
dbms_logstdby.apply_set('MAX_EVENTS_RECORDED',DBMS_LOGSTDBY.
SQL> exec
dbms_logstdby.apply_set('RECORD_UNSUPPORTED_OPERATIONS','TRU
Database altered.
EVENT_TIMESTAMP
----------------------------------------------------------
EVENT
----------------------------------------------------------
STATUS
----------------------------------------------------------
25-MAY-12 01.19.13.478058 PM
ALTER DATABASE OPEN
ORA-16226: DDL skipped due to lack of support
...
25-MAY-12 01.21.36.673051 PM
create pfile from spfile
ORA-16226: DDL skipped due to lack of support
...
25-MAY-12 03.12.01.278268 PM
DML on "SYSMAN"."MGMT_SYSTEM_PERFORMANCE_LOG"
ORA-16129: unsupported dml encountered
25-MAY-12 03.12.01.378676 PM
DML on "SYSMAN"."MGMT_METRIC_COLLECTIONS"
ORA-16129: unsupported dml encountered
...
25-MAY-12 03.12.02.266377 PM
TRUNCATE TABLE utl_recomp_sorted
ORA-16247: DDL skipped on internal schema
25-MAY-12 03.12.02.549499 PM
CREATE SEQUENCE utl_recomp_seq START WITH 0 MINVALUE 0 ORDER
ORA-16247: DDL skipped on internal schema
...
25-MAY-12 03.12.17.909027 PM
DML on "OLAPSYS"."OLAP_IRID"
ORA-16129: unsupported dml encountered
25-MAY-12 03.12.17.948123 PM
DML on "OLAPSYS"."CWM2$DIMENSION"
ORA-16129: unsupported dml encountered
25-MAY-12 03.12.17.958946 PM
DML on "OLAPSYS"."CWM2$OLAPMANAGERTABLE"
ORA-16129: unsupported dml encountered
...
25-MAY-12 10.01.00.816260 PM
create global temporary table sys.ora_temp_1_ds_20068 on com
preserve rows ca
che noparallel as select /*+ no_parallel(t) no_parallel_inde
dbms_stats curs
or_sharing_exact use_weak_name_resl dynamic_sampling(0) no_m
*/"OBJ#","
COL#","ROW#","BUCKET","ENDPOINT","INTCOL#","EPVALUE","SPARE1
from "SYS
"."HISTGRM$" sample ( 12.6381580459) t where 1 = 2
ORA-16247: DDL skipped on internal schema
10. The example output above indicates that not all changes that
occurred on the primary database have been applied to the logical
standby database. These specific errors are fairly common and can
be ignored as they indicate DML and DDL executing under internal
schemas (SYS, SYSMAN, OLAPSYS, etc.) and specific database
configuration commands like ALTER DATABASE OPEN and create
pfile from spfile that are known to be ignored by logical
standby database. These errors are nothing more than informational
statements provided to record the event for diagnostic purposes. For
a complete list of internal schemas ignored by logical standby,
execute the following query:
OWNER
------------------------------
ANONYMOUS
BI
CTXSYS
DBSNMP
DIP
DMSYS
EXFSYS
MDDATA
MDSYS
MGMT_VIEW
OLAPSYS
ORACLE_OCM
ORDPLUGINS
ORDSYS
OUTLN
SI_INFORMTN_SCHEMA
SYS
SYSMAN
SYSTEM
WKPROXY
WKSYS
WK_TEST
WMSYS
XDB
System altered.
PROTECTION_MODE
--------------------
MAXIMUM PERFORMANCE
14. To ensure the primary database can proceed while the logical
standby database is being upgraded, the LOG_ARCHIVE_DEST_n
initialization parameter for the logical standby database destination
must be set to OPTIONAL (not MANDATORY).
Primary
System altered.
Standby
System altered.
Primary
NAME VALUE
--------------- ---------------
compatible 10.2.0.5.0
Standby
NAME VALUE
--------------- ---------------
compatible 10.2.0.5.0
Archived Redo Log Repository
NAME VALUE
--------------- ---------------
compatible 10.2.0.5.0
SQL> @utlrp
TIMESTAMP
----------------------------------------------------
----------------------------
COMP_TIMESTAMP UTLRP_END 2012-05-30 19:46:07
...
GUARD_STATUS
-------------------------
ALL
Database altered.
20. Note that this is not a fatal error that will cause the entire
upgrade to fail and can be safely ignored by the DBUA. If you plan on
configuring OEM Database Control after the upgrade, manually
restart the OEM Database Control configuration assistant at a later
time after modifying database GUARD to either STANDBY or NONE.
21. It is highly recommended to create a guarantee restore point on
the logical standby database prior to the upgrade which can be used
in case issues are encountered with the upgrade process and
fallback recover is required. In the event of any issues, this will
facilitate quick restoration of the database to it's pre-upgrade state via
flashback database rather than having to use the downgrade
procedure which can take as long as the upgrade procedure.
Instructions for performing fallback recover is discussed in section
Flashing Back the Database after a Failed Upgrade.
23. From the primary, stop redo transfer to the logical standby
database.
System altered.
Database altered.
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmlinux2.idevelopm
The command completed successfully
Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmlinux2.idevelopm
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.
Start Date 30-MAY-2012 19:55:50
Uptime 0 days 0 hr. 0 min. 1 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listen
Listener Log File
/u01/app/oracle/product/11.2.0/dbhome_1/log/diag/tnslsnr/vml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vmlinux2.idevelo
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) fo
The command completed successfully
Note: If the database GUARD is enabled and set to ALL, it prevents all
non-sys users from making changes to the logical standby and as a
result, the OEM Database Control configuration assistant will fail. If
you intend to configure OEM Database Control, set the database
GUARD to either STANDBY or NONE and restart the OEM Database
Control Configuration Assistant.
Figure 20: Database Upgrade Assistant - Results
SEQUENCE#
----------
98 <---- Start registering from here
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
20 rows selected.
33. This is an optional step that would typically only be used if you
had a significant amount of redo data to transfer from the primary to
the upgraded logical standby. This can occur if there was a large
amount of data being modified on the primary and the logical standby
was out of sync for an extended period of time. If the amount of data
to transfer is negligible, then it may be sufficient to skip this step and
allow the logical standby to catch up automatically by having the
primary resend the redo data.
Database altered.
Database altered.
Database altered.
34. If the log files are stored in Oracle ASM (which is not the case
in this guide) and the archived redo log repository is on the same
node as the logical standby, you could use the RMAN CATALOG
command to catalog and register the logs in the archived redo log
repository destination rather than manually registering as shown
above.
Database altered.
36. Check the alert.log on the logical standby for any warnings
or errors. The alert.log for Oracle Database 11g is located in the
directory specified using the diagnostic_dest initialization
parameter. For example,
<diagnostic_dest>/diag/rdbms/<db_name>/<instance_name>/trace
37. From the primary, restart log transport services for redo to the
logical standby database.
SQL> alter system set
log_archive_dest_state_2=enable scope=both;
System altered.
38. At this point, the primary is running the lower database release
(10gR2) and the logical standby is running the upgraded database
release (11gR2). See Figure 3.
39. Verify that any redo data that accumulated on the primary
system during the upgrade has been applied to the newly upgraded
logical standby and that the logical standby is keeping in sync with
the primary. Any redo data that was accumulating on the primary and
not applied to the logical standby will be automatically transmitted
and applied on the newly upgraded logical standby database. Use the
V$LOGSTDBY_PROGRESS view to monitor how quickly the logical
standby is applying redo.
Session altered.
SYSDATE APPLIED_TIME
-------------------- --------------------
31-MAY-2012 00:11:53 31-MAY-2012 00:10:32
40. The Data Guard configuration can run the mixed database
releases for an arbitrary period while you verify that the upgraded
Oracle Database software release is running properly on the logical
standby.
41. In the steps that follow, a switchover will be performed to
reverse the database roles so the same upgrade procedures can be
run on the current primary.
42. Before performing the switchover, review the
DBA_LOGSTDBY_EVENTS view on the logical standby to determine if
there were any user DDL or DML statements that have not been
applied to the logical standby database. If unsupported DML
statements were issued on the primary, import the latest version of
those tables using an import utility such as Oracle Data Pump.
43. If the logical standby site was configured with an archived redo
log repository to protect the primary database during the logical
standby database upgrade, it can be shutdown.
Disable log transport services from the primary to the archived redo
log repository destination.
System altered.
Database dismounted.
ORACLE instance shut down.
44. If the Data Guard configuration contains any addition physical
standby databases, disable log transport services from the primary
and shutdown the physical standby databases. The physical standby
databases will not take part in the rolling upgrade or switchover
phases.
shutdown immediate
45. This is the step where the switchover occurs and downtime is
required on the production database (not counting the downtime
needed for enabling flashback logging at the beginning of this
section). The switchover is quick and should take no longer than a
minute to perform.
NAME TYPE
VALUE
------------------------------------ ----------- ---
--------------------
job_queue_processes integer 10
System altered.
SWITCHOVER_STATUS
--------------------
TO STANDBY
Database altered.
SWITCHOVER_STATUS
--------------------
TO PRIMARY
Database altered.
49. The former logical standby is now the primary database and
also running the latest upgraded database release software. The new
logical standby (former primary) cannot receive or apply redo
because it is running a lower database version than the new primary
database; therefore, you must disable redo transport on the new
primary.
System altered.
50. We now turn our focus to the former primary (new logical
standby) site.
GUARD_STATUS
-------------------------
ALL
Database altered.
53. Note that this is not a fatal error that will cause the entire
upgrade to fail and can be safely ignored by the DBUA. If you plan on
configuring OEM Database Control after the upgrade, manually
restart the OEM Database Control configuration assistant at a later
time after modifying database GUARD to either STANDBY or NONE.
54. Shut down the former primary database (which is now the new
logical standby database).
55. Stop the listener running out of the old 10gR2 home on the
former primary (new logical standby) site.
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmlinux1.idevelopm
The command completed successfully
Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmlinux1.idevelopm
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.
Start Date 31-MAY-2012 12:35:19
Uptime 0 days 0 hr. 0 min. 1 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listen
Listener Log File
/u01/app/oracle/diag/tnslsnr/vmlinux1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vmlinux1.idevelopm
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) fo
The command completed successfully
Create a new archived redo log repository on the former primary site
using the upgraded database release software (11gR2). Update the
tnsnames.ora file to reflect the hostname change, and configure it
to receive redo data from the new primary database as shown in
Figure 4.
/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initalr
epos.ora
audit_file_dest =
'/u01/app/oracle/admin/alrepos/adump'
compatible = '10.2.0.5.0'
control_files =
'/u03/flash_recovery_area/ALREPOS/controlfile/control01.ctl'
db_block_size = 8192
db_name = turlock
db_recovery_file_dest = '/u03/flash_recovery_area'
db_recovery_file_dest_size = 32G
db_unique_name = alrepos
diagnostic_dest = '/u01/app/oracle'
log_archive_config = 'dg_config=(turlock,alrepos)'
log_archive_dest_1 =
'location=use_db_recovery_file_dest
valid_for=(all_logfiles,all_roles)'
log_archive_dest_state_1 = 'enable'
log_archive_max_processes = 4
log_file_name_convert = '/TURLOCK/','/ALREPOS/'
remote_login_passwordfile = exclusive
service_names = alrepos.idevelopment.info
sga_target = 120M
/u01/app/oracle/product/11.2.0/dbhome_1/network/adm
in/tnsnames.ora
...
ALREPOS.IDEVELOPMENT.INFO =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =
vmlinux1.idevelopment.info)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = alrepos.idevelopment.info)
)
)
...
If the archived redo log repository is not receiving logs from the
new primary, look in the alert.log file on the primary for any
errors.
...
Thu May 31 13:27:53 2012
Error 1031 received logging on to the standby
PING[ARC3]: Heartbeat failed to connect to
standby 'alrepos.idevelopment.info'. Error is
1031.
...
60. Using the same procedures that were used to upgrade the
previous logical standby database, upgrade the former primary
database which will become the new logical standby database as
shown in Figure 5.
SEQUENCE#
----------
196 <---- Start registering from here
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
54 rows selected.
63. This is an optional step that would typically only be used if you
had a significant amount of redo data to transfer from the primary to
the upgraded logical standby. This can occur if there was a large
amount of data being modified on the primary and the logical standby
was out of sync for an extended period of time. If the amount of data
to transfer is negligible, then it may be sufficient to skip this step and
allow the logical standby to catch up automatically by having the
primary resend the redo data.
Database altered.
Database altered.
Database altered.
64. If the log files are stored in Oracle ASM (which is not the case
in this guide) and the archived redo log repository is on the same
node as the logical standby, you could use the RMAN CATALOG
command to catalog and register the logs in the archived redo log
repository destination rather than manually registering as shown
above.
COUNT(1)
----------
14
The database link will be used with the NEW PRIMARY clause when
starting logical apply because during the previous switchover, we
needed to use the single-phased unprepared switchover to turn this
former primary into a logical standby database.
Database altered.
Check the alert.log on the new logical standby for any warnings
or errors. The alert.log for Oracle Database 11g is located in the
directory specified using the diagnostic_dest initialization
parameter. For example,
<diagnostic_dest>/diag/rdbms/<db_name>/<instance_name>/trace
66. From the primary, restart log transport services for redo to the
new logical standby database.
System altered.
67. At this point, both databases are now upgraded and running the
new database release (11gR2). See Figure 6.
68. Verify that any redo data that accumulated on the primary
system during the upgrade has been applied to the newly upgraded
logical standby and that the logical standby is keeping in sync with
the primary. Any redo data that was accumulating on the primary and
not applied to the logical standby will be automatically transmitted
and applied on the newly upgraded logical standby database. Use the
V$LOGSTDBY_PROGRESS view to monitor how quickly the logical
standby is applying redo.
Session altered.
SYSDATE APPLIED_TIME
-------------------- --------------------
31-MAY-2012 23:58:27 31-MAY-2012 23:58:05
69. Now that both databases have been upgraded, check and
modify any login scripts, maintenance jobs, /etc/oratab, etc. to
ensure they reflect the new Oracle home.
70. Drop the restore points created on the primary and logical
standby databases. Forgetting to do this will result in filling up your
Fast Recovery Area with flashback logs.
New Primary
NAME
-----------------------
PRE_LOGICAL_UPGRADE
New Standby
NAME
-----------------------
PRE_LOGICAL_UPGRADE
71. Now that all of the database upgrades have been completed,
you can optionally discard the archived redo log repository
configuration.
First, stop log transport services from the primary to the archived redo
log repository destination.
System altered.
Next, stop log transport services from the current logical standby to
the archived redo log repository destination so that it will not try to
enable if you decide to perform a final switchover and convert the
logical standby back to the primary database role.
System altered.
Connected to:
Oracle Database 11g Enterprise Edition Release
11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real
Application Testing options
Database dismounted.
ORACLE instance shut down.
SQL>
72. Once you are satisfied with the new Oracle database software
release, it is recommended to raise the compatibility level to the
rolling upgraded version on both databases.
SWITCHOVER_STATUS
--------------------
TO STANDBY
Database altered.
Database altered.
SWITCHOVER_STATUS
--------------------
PREPARING SWITCHOVER
SWITCHOVER_STATUS
--------------------
TO LOGICAL STANDBY
Database altered.
If many users are performing long running read/write
transactions on the the current primary database when you
issue the ALTER DATABASE statement above, you may see a
significant stall to the end users and the time it takes to
complete the switchover operation. This statement waits for all
current transactions on the current primary database to end and
prevents any new users from starting new transactions, and
establishes a point in time where the switchover will be
committed.
For example:
SWITCHOVER_STATUS
--------------------
TO PRIMARY
Database altered.
Database altered.
Enable log transport services on the original primary for those now
upgraded physical standby databases.
75. If the Data Guard Broker was previously configured, it can now
be re-enabled. This needs to be performed on the primary and
standby databases.
System altered.
You can use Flashback Database to fall back to the pre-upgrade release
only if you have not changed the COMPATIBLE database parameter to the
target release.
The steps for flashing back the database after a failed upgrade (due to a
failure while running the catupgrd.sql script or a DBUA failure) are as
follows:
Flashback complete.
Database altered.
This section briefly describes the process of activating the logical standby
in case of a failure with the primary site during the upgrade phase of the
logical standby database.
First, you must decide whether or not to activate the user applications and
services on the new database software release or the prior release. If the
logical standby database upgrade completed successfully before the
primary site failed, you can perform a database flashback to restore and
open the database using the previous database release.
Figure 21: Primary Site Failure During Logical Standby Database Upgrade
Next, register any archived redo log files with the logical standby database
that have been transferred to the archived redo log repository while the
logical standby was being upgraded.
Finally, recover the logical standby database with any missing log files,
perform a failover to transition the logical standby to the primary database
role, and activate user applications and services to the new primary
database.