docs.oracle.com-3 Upgrading Databases with Oracle Data Guard Standbys
docs.oracle.com-3 Upgrading Databases with Oracle Data Guard Standbys
Standbys
docs.oracle.com/en/database/oracle/oracle-database/23/upgrd/upgrading-databases-with-oracle-data-guard-
standby-databases.html
When you upgrade a database to a new release that uses one or more Oracle Data
Guard Standby databases, you use the redo logs from the primary database.
This scenario assumes you are using Oracle Data Guard broker.
1/16
Creating a Physical Standby Task 5: Set Up the Environment to Support the
Standby Database
Set up the environment by creating a Microsoft Windows-based service, a password
file, and an SPFILE, and then setting up the Oracle Net environment.
Creating a Physical Standby Task 6: Start the Physical Standby Database
These are the steps to start the physical standby database and Redo Apply.
Creating a Physical Standby Task 7: Verify the Physical Standby Database Is
Performing Properly
After you create the physical standby database and set up redo transport services,
you may want to verify database modifications are being successfully transmitted
from the primary database to the standby database.
If you perform your upgrade using Oracle Data Guard to carry out a rolling upgrade, then
you must move the Data Guard broker configuration files before starting your upgrade.
The default location for the DB_BROKER_CONFIG files is in the dbs directory in the earlier
release Oracle Database Oracle home. When you perform a rolling upgrade of database
instances using Oracle Data Guard, you must move the DG_BROKER_CONFIG files to a
mount point location outside of the earlier release Oracle home. Also ensure that the
DG_BROKER_CONFIG_FILEn parameters specify that location, instead of a location in the
earlier release Oracle home. During database upgrade, don't migrate the listener. After
the upgrade is complete, stop the listener, shut down the database, copy over the
listener.ora and tnsnames.ora from the earlier source Oracle Database release
environment to the new Oracle Database release environment, and start the listener and
database
To enable access to the DB_BROKER_CONFIG files during a rolling upgrade, you must
complete the following tasks before starting the upgrade
2/16
1. Before you start the upgrade, if you are not using Oracle Automatic Storage
Management (Oracle ASM) for storage, then set the Oracle Data Guard files
DG_BROKER_CONFIG_FILE1 and DG_BROKER_CONFIG_FILE2 to a separate mount point
on your server that is outside of the Oracle home path for either the source or target
Oracle Database Oracle homes.
Note:
2. Complete a successful upgrade of your earlier release Oracle home to the new
Oracle Database release.
See:
Refer to Oracle Data Guard Broker for information about moving your Data Guard broker
configuration files.
See a Demonstration of how to upgrade with AutoUpgrade and Oracle Data Guard
Daniel Overby Hansen provides you with an overview of how you can use AutoUpgrade
to perform upgrades of Oracle Databases using Oracle Data Guard standby databases.
Check it out!
Related Topics
3/16
Renaming the Broker Configuration Files
If you are using the Oracle Data Guard broker to manage your configuration, follow
the instructions in Oracle Data Guard Broker
Make note of any tablespaces or data files that need recovery due to OFFLINE
IMMEDIATE. Before starting an upgrade, tablespaces or data files should be
recovered, and either online or offline.
Far sync instances are an exception to the automatic updating feature. Updated
password files must still be manually copied to far sync instances, because far sync
instances receive redo, but do not apply it. When a password file is manually
updated at a far sync instance, the redo containing the same password changes
from the primary database is automatically propagated to any standby databases
that are set up to receive redo from that far sync instance. The password file is
updated on the standby when the redo is applied.
Note:
If there are cascaded standbys in your configuration, then those cascaded standbys must
follow the same rules as any other standby, but should be shut down last, and restarted in
the new home first.
Related Topics
4/16
Parent topic: Upgrading Databases with Oracle Data Guard Standbys
In actuality, when you specify NOLOGGING, a redo record is still written to the online redo
log file, but there is no data associated with the record. This specification can result in log
application or data access errors at the standby site. Manual recovery might be required
to resume applying log files. Depending on whether you have a logical standby or
physical standby, you can avoid these errors by doing the following:
Logical standbys
Specify the FORCE LOGGING clause in the CREATE DATABASE or ALTER DATABASE
statements.
Physical standbys
Specify a logging mode that is appropriate to the way in which you plan to use your
Data Guard configuration.
You can see the current logging mode in the V$DATABASE.FORCE_LOGGING column (for
CDBs), or the DBA_PDBS.FORCE_LOGGING column (for PDBs).
The default logging mode of a database that is not part of an Oracle Data Guard
configuration allows certain data loading operations to be performed in a nonlogged
manner. This default mode is not appropriate to a database with a standby, because it
leads to the loaded data being missing from the standby, which requires manual
intervention to fix.
In addition to the default logging mode, there are three other modes that are appropriate
for a primary database:
5/16
FORCE LOGGING mode prevents any load operation from being performed in a
nonlogged manner. This mode can slow down the load process, because the
loaded data must be copied into the redo logs. FORCE LOGGING mode is enabled
using the following command:
STANDBY NOLOGGING FOR DATA AVAILABILITY mode causes the load operation to
send the loaded data to each standby through its own connection to the standby.
The commit is delayed until all the standbys have applied the data as part of
running managed recovery in an Active Data Guard environment. It is enabled with
the following command:
STANDBY NOLOGGING FOR LOAD PERFORMANCE is similar to the previous mode except
that the loading process can stop sending the data to the standbys if the network
cannot keep up with the speed at which data is being loaded to the primary. In this
mode it is possible that the standbys may have missing data, but each standby
automatically fetches the data from the primary as a normal part of running
managed recovery in an Active Data Guard environment. It is enabled with the
following command:
When you issue any of these statements, the primary database must at least be mounted
(and it can also be open). The statement can take a considerable amount of time to
complete, because it waits for all unlogged direct write I/O to finish.
Note:
When you enable STANDBY NOLOGGING FOR DATA AVAILABILITY or STANDBY NOLOGGING
FOR LOAD PERFORMANCE on the primary database, any standbys that are using multi-
instance redo apply functionality will stop applying redo with the error ORA-10892. You
must first restart redo apply and allow the affected standbys to progress past the
NOLOGGING operation period and then enable multi-instance redo apply.
Related Topics
See Also:
6/16
Oracle Database Administrator’s GuideFor more information about the ramifications of
specifying FORCE LOGGING mode
Parent topic: Upgrading Databases with Oracle Data Guard Standbys
You can use any backup copy of the primary database to create the physical standby
database, as long as you have the necessary archived redo log files to completely
recover the database.
Oracle recommends that you use the Recovery Manager utility (RMAN).
Related Topics
Backing Up the Database, Oracle Database Backup and Recovery User’s Guide
Creating a Physical Standby Task 2: Create a Control File for the Standby
Database
Create the control file for the standby database. The primary database does not have to
be open, but it must at least be mounted.
You must create a control file for the standby database. You cannot use a single control
file for both the primary and standby databases. They each must have their own file.
Example 3-1 Creating the Control File for the Standby Database
The ALTER DATABASE command designates the database that you want to operate in the
standby role. In this example, that standby database is named boston:
Note:
If a control file backup is taken on the primary, and restored on a standby (or vice-versa),
then the location of the snapshot control file on the restored system is configured to be
the default. The default value for the snapshot control file name is platform-specific, and
dependent on the Oracle home. Manually reconfigure it to the correct value by using the
RMAN command CONFIGURE SNAPSHOT CONTROLFILE. For more information see Oracle
Globally Distributed Database Guide
7/16
Create a parameter file (PFILE) from the server parameter file (SPFILE) used by the
primary database.
To create a parameter file for the standby database, perform the following steps:
1. On the primary database, issue a SQL statement to create a copy of the primary
database parameter file.
In the following example,
2. Modify the parameter values in the copy parameter file as needed to use this copy
as the parameter file for the standby database.
Although most of the initialization parameter settings in the parameter file are also
appropriate for the physical standby database, some modifications must be made.
This example shows the parameters created earlier on the primary that must be changed.
The parameters that must be changed for the physical standby database are shown in
bold typeface. Any parameter, such as DB_NAME, that is not shown in bold typeface
should retain the same value on the standby database that it has on the primary
database.
.
.
.
DB_NAME=chicago
DB_UNIQUE_NAME=boston
LOG_ARCHIVE_CONFIG='DG_CONFIG=(chicago,boston)'
CONTROL_FILES='/arch1/boston/control1.ctl', '/arch2/boston/control2.ctl'
DB_FILE_NAME_CONVERT='/chicago/','/boston/'
LOG_FILE_NAME_CONVERT='/chicago/','/boston/'
LOG_ARCHIVE_FORMAT=log%t_%s_%r.arc
LOG_ARCHIVE_DEST_1=
'LOCATION=USE_DB_RECOVERY_FILE_DEST
VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=boston'
LOG_ARCHIVE_DEST_2=
'SERVICE=chicago ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=chicago'
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
STANDBY_FILE_MANAGEMENT=AUTO
FAL_SERVER=chicago
.
.
.
8/16
Ensure the COMPATIBLE initialization parameter is set to the same value on both the
primary and standby databases. If the values differ, then redo transport services may be
unable to transmit redo data from the primary database to the standby databases.
It is always a good practice to use the SHOW PARAMETERS command to verify that no other
parameters need to be changed.
The following table provides a brief explanation about the parameter settings shown in
that have different settings from the primary database.
CONTROL_FILES Specify the path name for the control files on the standby
database. The example in this topic shows how to specify
the path name for two control files. Oracle recommends that
you ensure a copy of the control file is available, so that if a
control file is corrupted, an instance can be easily restarted
after copying the good control file to the location of the bad
control file.
DB_FILE_NAME_CONVERT Specify the path name and filename location of the primary
database data files, followed by the standby location. The
CONTROL_FILES parameter converts the path names of the
primary database data files to the standby data file path
names.
LOG_FILE_NAME_CONVERT Specify the location of the primary database online redo log
files followed by the standby location. This parameter
converts the path names of the primary database log files to
the path names on the standby database.
9/16
Parameter Recommended Setting
FAL_SERVER Specify the Oracle Net service name of the FAL (fetch
archive log) server for a standby database. Typically, this
service name is for the database running in the primary role.
When the Boston database is running in the standby role, it
uses the Chicago database as the FAL server from which to
fetch (request) missing archived redo log files, if Chicago is
unable to automatically send the missing log files.
Note:
Review the initialization parameter file for additional parameters that may need to be
modified. For example, you may need to modify the dump destination parameters if the
directory location on the standby database is different from those specified on the primary
database.
Related Topics
These steps show how to upgrade to Oracle Database when a physical standby database
is present in the configuration.
10/16
Note:
Do not open standby databases until the primary database upgrade is completed.
See Start the Physical Standby Database for information on how to start a physical
standby database.
11/16
12. (Optional) When ready. modify the COMPATIBLE initialization parameter.
Note:
Creating a Physical Standby Task 4: Copy Files from the Primary System
to the Standby System
Ensure that all required directories are created. Use an operating system copy utility to
copy binary files from the primary system to their correct locations on the standby system.
Copy these binary files to the correct locations on the standby system:
12/16
1. If the standby database is going to be hosted on a Microsoft Windows system, then
use the ORADIM utility to create a Windows service.
For example:
The ORADIM utility automatically determines the username for which this service
should be created and prompts for a password for that username (if that username
needs a password).
See Oracle Database Administrator’s Reference for Microsoft Windows for more
information about using the ORADIM utility.
2. Copy the remote login password file from the primary database system to the
standby system and rename it appropriately (for example, rename the copied
orapwchicago to orapwboston).
This step is optional if operating system authentication is used for administrative
users, and if SSL is used for redo transport authentication. If that is not the case,
then copy the remote login password file from the primary database to the
appropriate directory on the physical standby database system.
Any subsequent changes to the password file on the primary are automatically
propagated to the standby. Changes to a password file can include when
administrative privileges (SYSDG, SYSOPER, SYSDBA, and so on) are granted or
revoked, and when passwords of any user with administrative privileges is changed.
Updated password files must still be manually copied to far sync instances because
far sync instances receive redo, but do not apply it. Once the password file is up-to-
date at the far sync instance, the redo containing the password update at the
primary is automatically propagated to any standby databases that are set up to
receive redo from that far sync instance. The password file is updated on the
standby when the redo is applied.
3. Configure and start a listener on the standby system if one is not already
configured.
See Configuring and Administering Oracle Net Listener in Oracle Database Net
Services Administrator's Guide.
13/16
4. Create Oracle Net service names.
On both the primary and standby systems, use Oracle Net Manager to create a
network service name for the primary and standby databases that are to be used by
redo transport services. The Net service names in this example are chicago and
boston.
The Oracle Net service name must resolve to a connect descriptor that uses the
same protocol, host address, port, and service that you specified when you
configured the listeners for the primary and standby databases. The connect
descriptor must also specify that a dedicated server be used.
5. On an idle standby database, use the SQL CREATE statement to create a server
parameter file for the standby database from the text initialization parameter file that
was edited in Task 3.
For example:
6. If the primary database has a database encryption wallet, then copy it to the
standby database system and configure the standby database to use this wallet.
Note:
The database encryption wallet must be copied from the primary database system
to each standby database system whenever the primary encryption key is updated.
These are the steps to start the physical standby database and Redo Apply.
1. On the standby database, issue the following SQL statement to start and mount the
database:
2. Restore the backup of the data files taken from the primary database data files, and
copied to the standby system.
14/16
3. On the standby database, issue the following command to start Redo Apply:
The statement includes the DISCONNECT FROM SESSION option, so that Redo Apply
runs in a background session.
After you create the physical standby database and set up redo transport services, you
may want to verify database modifications are being successfully transmitted from the
primary database to the standby database.
To verify that redo is being transmitted from the primary database and applied to the
standby database, connect to the standby database, and query the
V$DATAGUARD_PROCESS view.
The recovery logmerger role shows that redo is being applied at the standby.
Note:
15/16
16/16