You can create a physical standby of a multitenant container database (CDB) just as you can create a physical standby of a regular primary database. The following are some of the behavioral differences to be aware of when you create and use a physical standby of a CDB:
创建一个多租户的CDB环境的DG.跟普通primary database一样
The database role is defined at the CDB level, not at the individual container level.--------------数据库主备角色的定义在CDB层
If you execute a switchover or failover operation, the entire CDB undergoes the role change.--------执行常规切换或者主备切换时,整个CDB的角色都将变更。
Any DDL related to role changes must be executed in the root container because a role is associated with an entire CDB. Individual pluggable databases (PDBs) do not have their own roles. -----------任何主备角色变更的操作都在root container下执行。
In a physical standby of a CDB, the syntax of SQL statements is generally the same as for noncontainer databases. However, the effect of some statements, including the following, may be different: -------在一个CDB的物理standby环境中,SQL的装换同普通DB一样。但也有部分差异性存在:
ALTER DATABASE RECOVER MANAGED STANDBY functions only in the root container; it is not allowed in a PDB.-------日志应用操作仅限于CDB.
A role is associated with an entire CDB; individual PDBs do not have their own roles. Therefore, the following role change DDL associated with physical standbys affect the entire CDB: -------主备角色与整个CDB相关。PDB不拥有主备角色。因此下列DDL操作将会影响整个CDB。
ALTER DATABASE SWITCHOVER TO target_db_name
ALTER DATABASE ACTIVATE PHYSICAL STANDBY
The ALTER PLUGGABLE DATABASE [OPEN|CLOSE] SQL statement is supported on the standby, provided you have already opened the root container.
PDB的开关操作在standby端同样支持。前提是已经打开了root container。
The ALTER PLUGGABLE DATABASE RECOVER statement is not supported on the standby. (Standby recovery is always at the CDB level.)
PDB不支持主库归档日志的应用操作,该操作仅限于CDB层。
To administer a multitenant environment, you must have the CDB_DBA role.
为了管理多租户环境,必须用CDB_DBA角色
Oracle recommends that the standby database have its own keystore.
oracle推荐standby拥有自己的秘钥库。
In a multitenant environment, the redo must be shipped to the root container of the standby database.
在多租户环境中,redo必须通过root container传到standby 端。
The following is an example of how to determine whether redo is being shipped to the root container. Suppose your primary database has the following settings:
如下日志传输配置解释了如何root container进行日志的输送。
LOG_ARCHIVE_DEST_2='SERVICE=boston ASYNC VALID_FOR=(ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME=boston'
Redo is being shipped to boston. The container ID (CON_ID) for the root container is always 1, so you must make sure that the CON_ID is 1 for the service boston. To do this, check the service name in the tnsnames.ora file. For example:
如下的配置都是基于CDB的服务的
boston = (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=sales.us.example.com))
The service name for boston is sales.us.example.com.
On the standby database, query the CDB_SERVICES view to determine the CON_ID. For example:
在standby端,查询CDB_SERVICES视图检查con_id。
SQL> SELECT NAME, CON_ID FROM CDB_SERVICES; NAME CON_ID --------------------------------------------- sales.us.example.com 1
The query result shows that the CON_ID for boston is 1.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/28612416/viewspace-2120220/ ,如需转载,请注明出处,否则将追究法律责任。