Oracle 19c新特性介绍(仅包含RAC、DG和备份)

本文参考:Oracle Database Database New Features Guide, 19c,目前版本为2023年03月。摘抄RAC、DG和备份这三块的新特性介绍。

1 RAC新特性

1.1 Grid零停机补丁升级

1.1.1 切换Grid主目录

原文摘抄:Use the -switchGridHome option to switch from the source Oracle GridInfrastructure home to the patched Oracle Grid Infrastructure home.

在RAC场景和单机的Restart服务中,可以使用-switchGridHome的方式给Grid打补丁,前线在新的目录中使用仅安装软件的方式来安装Grid和新的补丁,然后在新版本的Grid目录下执行gridSetup.sh -switchGridHome命令,最后再执行root.sh脚本即可。参考国外博文:DBA Plus Workshop: Zero-Downtime patching Oracle Grid Infrastructure 19c on Linux

1.1.2 不停止数据库实例

零停机补丁实际上结合切换Grid主目录Oracle FlexASM的功能以滚动方式实现,保证当前在切换Grid主目录节点时,正常远程访问ASM实例,为数据库提供存储I/O服务。

原文摘抄:with one node being patched at a time, while the database instances onthe node remain operational.

此处root.sh脚本可使用的选项参考:root.sh -transparent -nodriverupdate

1.1.3 升级期间自动排出实例的事务

原文摘抄:Once user transactions are drained, patching operations for a particular node ona cluster are completed.The instance and services are then restarted locally and new connections are established before the patching operation rolls on to the next node in the cluster.

在打补丁期间,使用快速补丁和配置功能减少补丁对事务的影响,一旦当前节点的事务被耗尽(处理完毕),实例和服务将在本地重新启动,并建立新的连接,补丁操作也随之完成,转入下一个节点执行补丁升级操作。

1.2 重新支持共享文件系统

在12.2版本中,Oracle RAC不支持将ocr和voting disk放在共享文件系统中,现在19c(19.3)重新开始支持。

原文摘抄:Starting with OracleGrid Infrastructure 19c (version 19.3), with Oracle Standalone Clusters, you can againplace OCR and voting disk files directly on shared file systems.

1.3 服务支持故障恢复首选节点

为动态数据库服务支持"preferred"(首选)和"available"(可用)的放置配置,可以给服务配置一个首选节点,当该节点发生故障重新恢复正常后,服务将自动切换回该节点上。

原文摘抄:specify that this service should fall back to a "preferred" instance when it becomesavailable if the service failed over to an available instance.

2 DG新特性

2.1 主库的还原点自动同步到备库

原文摘抄:Restore points created on the primary database are propagated to the standby sites,so that they are available even after a failover operation.

19c可以将主库的还原点自动同步到备库,在19c之前的还原点信息存放在控制文件中,一旦在备库创建还原点激活后,还原点信息也会随之消失。而现在备库上的还原点是由主库创建的,即使激活备库后,仍然能够读取得到还原点。

2.2 更细粒度的附加日志

原文摘抄:disable supplemental logging for uninteresting tables

原来的附加日志是数据库或者架构(schema)级别,开启后一些无关紧要、冗余数据较多、或者存放审计操作类的日志表会对redo和系统资源产生消耗。现在19c可以禁用这些表生成附加日志,减少redo和资源开销。

 SQL> ALTER SYSTEM SET enable_goldengate_replication=true;
 System altered.

SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA; 
 Database altered. 

 SQL> ALTER DATABASE DROP SUPPLEMENTAL LOG DATA [表名] DATABASE REPLICATION; 
 Database altered. 

 SQL> SELECT supplemental_log_data_min, supplemental_log_data_sr from v$database;

 SUPPLEMENTAL_LOG_DATA_MIN      SUPPLEMENTAL_LOG_DATA_SR
 ------------------------------ ------------------------------
 YES                            NO

 这在逻辑复制场景,比如ogg、逻辑dg都比较实用。

2.3 ADG重定向DML语句到主库

原文摘抄:DML redirection helps in load balancing between the primary and standby databases. Whenincidental DML is issued on an Active Data Guard standby database, the update is passed tothe primary database where it is executed. The resulting redo of the transaction updates thestandby database after which control is returned to the application.

在ADG备库执行DML操作的过程中,备库会使用一个内部的dblink访问主库来执行DML,主库再通过备库返回事务状态给客户端。后台保持redo同步。需要在主库和备库设置ADG_REDIRECT_DML参数,备库会使用内部的dblink访问主库完成更新。

--主库
begin
 for a in 1..500 loop
 insert into TEST values (a,'test'||to_char(a));
 end loop;
 commit;
 end;
 /

 PL/SQL procedure successfully completed.
 Elapsed: 00:00:00.05
 
--备库
 begin
 for a in 1..500 loop
 insert into TEST values (a,'test'||to_char(a));
 end loop;
 commit;
 end;
 /

 PL/SQL procedure successfully completed.
 Elapsed: 00:08:18.72

通过对比可以发现,由于网络的延迟,在大批量更新中重定向DML的性能比较差,仅用于执行一些比较简单的DML操作。

2.4 备库随主库恢复还原点数据

要求主库开启FLASHBACK ON功能,在执行flashback后,备库会接收到主库flashback的通知,由MRP0进程自动恢复还原点数据。

原文摘抄:This feature introduces anew parameter that enables the standby database to be flashed back automaticallywhen a flashback operation is performed on the primary database

3 备份恢复

3.1 定期清除闪回区日志

闪回区需要使用db_flashback_retention_targetdb_recovery_file_dest_size参数来手动管理,19c开始简化闪回区的空间管理,在删除闪回区日志前会从存储管理的角度计算出可释放的空间,当db_flashback_retention_target参数减少或者超过该参数值后,立即删除超出保留期的闪回日志。

原文摘抄:Fast recovery area management and database health are improved by automatically deletingflashback logs that are beyond the retention period.

这能够在一定程度上减低闪回区被写满导致无法写入归档日志的概率发生,从而降低了数据库hung住的概率。

3.2 PDB的VPC虚拟私有恢复目录

12c开始就支持使用RMAN对PDB执行的备份和恢复,19c支持使用VPC用户在PDB级别来做细粒度的备份和还原操作,可以对VPC用户进行权限控制,限制只能查看已授权的数据。

原文摘抄:You can use a virtual private catalog (VPC) user to granularlycontrol permissions to perform backup and restore operations at a PDB level. Metadata viewis also limited, so a VPC user can view only data for which the user has been granted permission.

posted @ 2023-06-21 16:06  十亩菠萝地  阅读(406)  评论(0编辑  收藏  举报