在 Oracle Database 21c中, Oracle 对 Sharding 进行了以下增强:
-
Sharding Advisor - 是随Oracle Sharding提供的一个工具,它可以通过分析当前的数据库模式和工作负载来帮助您设计最佳的Sharded数据库配置,并推荐Oracle Sharding拓扑配置和数据库模式设计。Sharding Advisor 的建议基于一些关键目标,如并行性(将查询执行均匀地分布在各分片之间)、最小化跨分片连接操作和最小化重复数据。
-
联合式 Sharding - 可让您将多个现有数据库统一到一个 Sharded 数据库架构中。在联合型 Sharding 配置中,Oracle Sharding 将每个独立的数据库视为一个 Shard,因此可以在这些 Shard 上发布多 Shard 查询。
-
集中式备份和恢复 - 为 Sharding 数据库备份和恢复操作提供了自动化和集中式管理和监控基础架构,包括使用 Oracle MAA 最佳实践记录这些操作。
在这些新特性中,集中的备份和恢复,极大了简化了 DBA 的维护工作,这一工作是通过 GDSCTL 来完成的。
以下是一个示范的配置:
GDSCTL> config backup -rccatalog rccatalog_connect_string
-destination “CATALOG::configure channel device type disk format ‘/tmp/rman/backups/%d_%U’”
-destination “dbs1,dbs2:configure device type disk parallelism 2:configure channel 1 device type disk format ‘/tmp/rman/backups/1/%U’;configure channel 2 device type disk format ‘/tmp/rman/backups/2/%U’”
-starttime ALL:00:00 -retention 14 -frequency 7,1 -catpwd gsmcatuser_password -cdb catcdb_connect_string;
通过 ENABLE 在所有 Shard 启用备份任务:
GDSCTL> ENABLE BACKUP
展示配置:
GDSCTL> config backup
Recovery catalog database user: rcadmin
Recovery catalog database connect descriptor: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=den02qxr)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=cdb6_pdb1.example.com)))
Catalog database root container user: gsm_admin
Catalog database root container connect descriptor: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=den02qxr)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=v1908.example.com)))
Backup retention policy in days: 14
Level 0 incremental backup repeat interval in minutes: 10080
Level 1 incremental backup repeat interval in minutes: 1440
Level 1 incremental backup type : DIFFERENTIAL
Backup target type: STANDBY
Backup destinations:
catalog::channel device type disk format '/tmp/rman/backups/%d_%u'
dbs1,dbs2:device type disk parallelism 2:channel 1 device type disk format '/tmp/rman/backups/1/%u';channel 2 device type disk format '/tmp/rman/backups/2/%u'
catalog::configure channel device type disk format '/tmp/rman/backups/%d_%u'
dbs1,dbs2:configure device type disk parallelism 2:configure channel 1 device type disk format '/tmp/rman/backups/1/%u';configure channel 2 device type disk format '/tmp/rman/backups/2/%u'
Backup start times:
all:00:00
也可以手工发起备份,系统会自动通过临时任务进行调度:
GDSCTL> RUN BACKUP -shard dbs1
详细文档列表参考:
https://www.modb.pro/db/41548