创建Oracle sharding database

本文继『Oracle sharding database的一些概念』后,介绍如下搭建一个oracle sharding database的环境,以及可能在搭建过程中可能会遇到的known issue(有很多坑,且在mos上还没有解决方案,都是一个一个自己摸索解决的。)。

你在本文中可以看到:
(一)安装介质需求。
(二)HIGH LEVEL安装步骤。
(三)详细安装步骤。
(四)建立应用用户,利用应用用户建立sharded table和duplicated table:
(五)安装过程known issue。
(六)sharded table的一些测试,以及发现其对dml的一些限制。

关于sharding在架构上的一些想法和注意点,我准备下一篇文章再谈。

(一)安装介质:

(二)HIGH LEVEL安装步骤:

(三)详细安装步骤:

1.Oracle Sharding Prerequisites

2.Setting Up the Oracle Sharding Host Environment Scripts

3.Installing Oracle Database

4.Installing the Shard Director Software

4.b. Installer schagent in all shard node(admin guide文档没写这步骤,本人免费赠送)
update 2016-11-10:在12.2 beta 2版之后,不需要单独安装client.zip中的agent,schagent在database.zip中就包含了。安装完database就有了schagent。

5.Creating the Shard Catalog Database

6.Setting Up the Oracle Sharding Management and Routing Tier

7.Deploying and Managing a System-Managed SDB
我们开始部署,以最简单的System-Managed SDB为例。
另外,admin guide中介绍的是4台主机做shard node,其中每2台互为dataguard主备。我们这边为了节约空间和资源,不搞dataguard了,只建立primary库。因此只要2台主机做shard node。

此时,就开始部署shard了。在shard node上的agent会自动的调用netca和dbca,创建listener和database,2个shard node的操作是并行进行的。(如果是有datauard,那么是先建立一对主备,再建立另一对主备。)你可以在分别是两个shard node上ps -ef|grep ora_ 看到已经有sh1和sh2的实例了。

等deploy完,

我们可以检查一下shard的情况了:

建立service:

(四)建立应用用户,利用应用用户建立sharded table和duplicated table:

利用应用用户登录,创建sharded table和duplicated table

(五)安装过程known issue:
Known Issue(1)STANDARD_ERROR=”Launching external job failed: Invalid username or password”

Known Issue(2)ORA-06512: at “GSMADMIN_INTERNAL.DBMS_GSM_POOLADMIN”, line 14499

Known Issue(3)NET-40002: GSM endpoint not found in GSM.ora


Known Issue(4)ORA-02511: SQL query not allowed; the shard DDL is disabled.

Known Issue(5)Linux Error: 1: Operation not permitted

Known Issue(6)Listener “LISTENER_SH1” already exists


Known Issue(7)ERROR: Insecure database cannot be registered

Known Issue(8)BEGIN dbms_gsm_fixed.validateParameters(0); END;

Known Issue(9)GSM-45029 + could not resolve the connect identifier “GSMORA_CATALOG”

(六)sharded table的一些测试,以及发现其对dml的一些限制:
(1)当down掉一个shard node的时候进行查询sharded table的时候报错:

(2)sharded table不允许insert as select,也不允许PL/SQL function,所以加载数据有点麻烦:

但是如果是对duplicated table,这不存在上述2种的限制:

(3)sharded table不允许跨shard做delete:

相关文章

4条评论

  1. 请问你在create shard -shardgroup时没报错吗?我是12.2.0.1 的环境,执行完 add shardgroup -shardgroup primary_shardgroup -deploy_as primary -region region1,后,执行create shard -shardgroup primary_shardgroup -destination shardnode -credential oracle_cred,报ORA-03719: Shard character set does not match catalog character set。但检查两边字符集是一致的,有什么要注意的地方还请指教

    1. 如果你是静默安装的话,db.rsp 中的 oracle.install.db.config.starterdb.characterSet= 不要设置值.dbca.rsp里面的这两个参数这么设置 characterSet=AL32UTF8 , nationalCharacterSet=AL16UTF16 之后就不会遇到你这个错误了.你可以试试

回复 匿名 取消回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据