Parameter enabled_pdbs_on_standby and STANDBYS Option With Data Guard Subset Standby (Doc ID 2417018
Posted Lucifer三思而后行
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Parameter enabled_pdbs_on_standby and STANDBYS Option With Data Guard Subset Standby (Doc ID 2417018相关的知识,希望对你有一定的参考价值。
APPLIES TO
Oracle Database Cloud Service - Version N/A and later
Oracle Database - Enterprise Edition - Version 12.2.0.1 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Information in this document applies to any platform.
GOAL
NOTE: In the images and/or the document content below, the user information and environment data used represents fictitious data from the Oracle sample schema(s),
Public Documentation delivered with an Oracle database product or other training material. Any similarity to actual environments, actual persons, living or dead, is
purely coincidental and not intended in any manner.
For the purposes of this document, the following fictitious environment is used as an example to describe the procedure:
Database Name: dg12201
Pluggable Database Names: PDB1,PDB2,PDB3,PDB4
Directory Name: /u01/app/oracle/oradata and it’s sub-directories
This document provides details on usage of Parameter enabled_pdbs_on_standby and create pluggable databases (PDBs)
STANDBYS option in an Oracle Multitenant environment that includes a Data Guard physical standby database.
SOLUTION
・create pluggable databases … STANDBYS option.
This parameter determines whether to physically create the datafile in the standby database.
The new PDB is included in one or more standby CDBs. default value is “ALL”, include the new PDB in all standby CDBs.
STANDBYS=NONE to exclude the new PDB from all standby CDBs.
・Parameter enabled_pdbs_on_standby.
This parameter determines whether to apply the redo log to the PDB of the standby database.
Specifies which PDB to replicate on standby database. default value is “*”, replicate all PDBs.
enabled_pdbs_on_standby is meaningful only on standby databases
.
It settings are ignored on a primary database.
When creating a PDB in an Oracle Multitenant environment that includes a Data Guard physical standby database,
create pluggable databases … STANDBYS option and Parameter enabled_pdbs_on_standby take precedence as follows.
(*1) : Whether the datafile is physically created in the standby database.
(*2) : Whether the redo log is applied the PDB on the standby database ( v$pdbs.recovery_status ).
Cases 1 to 4 are explained in the following procedure. (Case1 : PDB1, Case2 : PDB2, Case3 : PDB3, Case4 : PDB4).
1. On Standby Database, Parameter enabled_pdbs_on_standby includes PDB1 and PDB3 (not includes PDB2 and PDB4).
SQL> alter system set enabled_pdbs_on_standby='PDB1','PDB3' scope=both;
System altered.
SQL> show parameter enabled_pdbs_on_standby
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
enabled_pdbs_on_standby string PDB1, PDB3
-- Check managed recovery mode
SQL> select distinct recovery_mode from v$archive_dest_status;
RECOVERY_MODE
-----------------------
MANAGED REAL TIME APPLY
2. On Primary Database, Creating the PDBs
-- PDB1 and PDB2 is specifie STANDBYS=ALL, PDB3 and PDB4 is specifie STANDBYS=NONE.
SQL> create pluggable database PDB1 admin user pdbadmin identified by "<password>" file_name_convert=('/u01/app/oracle/oradata/dg12201/pdbseed','/u01/app/oracle/oradata/dg12201/pdb1') STANDBYS=ALL;
Pluggable database created.
SQL> create pluggable database PDB2 admin user pdbadmin identified by "<password>" file_name_convert=('/u01/app/oracle/oradata/dg12201/pdbseed','/u01/app/oracle/oradata/dg12201/pdb2') STANDBYS=ALL;
Pluggable database created.
SQL> create pluggable database PDB3 admin user pdbadmin identified by "<password>" file_name_convert=('/u01/app/oracle/oradata/dg12201/pdbseed','/u01/app/oracle/oradata/dg12201/pdb3') STANDBYS=NONE;
Pluggable database created.
SQL> create pluggable database PDB4 admin user pdbadmin identified by "<password>" file_name_convert=('/u01/app/oracle/oradata/dg12201/pdbseed','/u01/app/oracle/oradata/dg12201/pdb4') STANDBYS=NONE;
Pluggable database created.
-- Open all PDBs
SQL> alter pluggable database all open;
Pluggable database altered.
-- Check the open_mode and recovery_status of all PDBs.
SQL> select con_id, name, open_mode, recovery_status from v$pdbs order by con_id, name;
CON_ID NAME OPEN_MODE RECOVERY
---------- ------------------------------------------- ---------- --------
2 PDB$SEED READ ONLY ENABLED
3 PDB1 READ WRITE ENABLED
4 PDB2 READ WRITE ENABLED
5 PDB3 READ WRITE ENABLED
6 PDB4 READ WRITE ENABLED
3. On Standby Database,
-- Redo logs are not applied to PDB2, PDB4 (v$pdbs.recovery_status = DISABLED).
SQL> select con_id, name, open_mode, recovery_status from v$pdbs order by con_id;
CON_ID NAME OPEN_MODE RECOVERY
---------- ------------------------------------------- ---------- --------
2 PDB$SEED READ ONLY ENABLED
3 PDB1 MOUNTED ENABLED
4 PDB2 MOUNTED DISABLED
5 PDB3 MOUNTED ENABLED
6 PDB4 MOUNTED DISABLED
-- Datafiles that are displayed as "UNNAMEDXXXXX" are not physically created in the standby database.
SQL> select con_id, name from v$datafile order by con_id;
CON_ID NAME
---------- ------------------------------------------------------------
1 /u01/app/oracle/oradata/dg12201/system01.dbf
1 /u01/app/oracle/oradata/dg12201/sysaux01.dbf
1 /u01/app/oracle/oradata/dg12201/undotbs01.dbf
1 /u01/app/oracle/oradata/dg12201/users01.dbf
2 /u01/app/oracle/oradata/dg12201/pdbseed/system01.dbf
2 /u01/app/oracle/oradata/dg12201/pdbseed/sysaux01.dbf
2 /u01/app/oracle/oradata/dg12201/pdbseed/undotbs01.dbf
3 /u01/app/oracle/oradata/dg12201/pdb1/sysaux01.dbf
3 /u01/app/oracle/oradata/dg12201/pdb1/system01.dbf
3 /u01/app/oracle/oradata/dg12201/pdb1/undotbs01.dbf
4 /u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/UNNAMED00089
4 /u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/UNNAMED00090
4 /u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/UNNAMED00091
5 /u01/app/oracle/oradata/dg12201/pdb3/system01.dbf
5 /u01/app/oracle/oradata/dg12201/pdb3/sysaux01.dbf
5 /u01/app/oracle/oradata/dg12201/pdb3/undotbs01.dbf
6 /u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/UNNAMED00095
6 /u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/UNNAMED00096
6 /u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/UNNAMED00097
STANDBYS option and Parameter enabled_pdbs_on_standby is effective when creating a new PDB after Data Guard configuration.
It does not affect the existing PDB before Data Guard configuration. Disabling PDB recovery after Data Guard configuration is as follows.
- On Standby Database,
-- Cancel managed recovery
SQL> recover managed standby database cancel;
Media recovery complete.
SQL>
-- Set container to target PDB
SQL> alter session set container=PDB1;
Session altered.
-- Change recovery_status to disable.
SQL> alter pluggable database PDB1 disable recovery;
Pluggable database altered.
SQL> select con_id, name, open_mode, recovery_status from v$pdbs order by con_id;
CON_ID NAME OPEN_MODE RECOVERY
---------- ------------------------------------------- ---------- --------
3 PDB1 MOUNTED DISABLED
PDB Enabled/Disabled only applies to the initial creation of the PDB.
At some point in the future PDB that had recovery enabled could have its recovery disabled and vice versa regardless of the settings of the parameter.
PDBs coming from external sources (plugins, remote clones) you still need to provide the files to the standby in some manner.
These parameters/clauses have no impact in regard to populating the files at the standby for these cases.
以上是关于Parameter enabled_pdbs_on_standby and STANDBYS Option With Data Guard Subset Standby (Doc ID 2417018的主要内容,如果未能解决你的问题,请参考以下文章